diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 86e9ceb..94a3ee7 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,14 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: Install hatch - run: pipx install hatch - - uses: actions/setup-python@v5 with: - python-version: "3.11" - + python-version: "3.12" - name: Install system deps run: | sudo apt-get update @@ -29,11 +24,11 @@ jobs: python3-gi \ gobject-introspection \ libgtk-3-dev - - - name: Run pytest - run: hatch run test - + - name: Install python deps + run: pip install '.[dev]' + - name: Run tests + run: pytest - name: Coveralls - run: hatch run coveralls + run: coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index d5d40cc..32b456f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -11,13 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: Install hatch - run: pipx install hatch - - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install system deps run: | @@ -27,10 +23,14 @@ jobs: libcairo2-dev \ python3-gi \ gobject-introspection \ - libgtk-4-dev + libgtk-4-dev \ + libxml2-utils # required for pre-commit hooks - - name: Run project checks - run: hatch run check + - name: Install python deps + run: pip install '.[dev]' + + - name: Run tests + run: pre-commit run --all-files publish: name: Build & Publish @@ -46,13 +46,9 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Install hatch - run: pipx install hatch - - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install system deps run: | @@ -64,8 +60,8 @@ jobs: gobject-introspection \ libgtk-4-dev - - name: Build Python package - run: hatch build + - name: Install python deps + run: pip install '.[dev]' - name: Publish to PyPi uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/README.md b/README.md index 85ebc3b..60bbe6a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MyHumbleSelf -**_Utility to display webcam image for presentation or screencasts on Linux._** +**_Utility to display webcam image for presentations or screencasts on Linux._**


Tests passing diff --git a/myhumbleself/camera.py b/myhumbleself/camera.py index d78338d..9e397d8 100644 --- a/myhumbleself/camera.py +++ b/myhumbleself/camera.py @@ -20,6 +20,11 @@ def __init__(self) -> None: def read(self) -> tuple[bool, np.ndarray]: sleep(0.01) + if self._placeholder_image is None: + raise ValueError( + "Placeholder miss: %s", + str(Path(__file__).parent / "resources" / "placeholder.jpg"), + ) return True, self._placeholder_image.copy() def release(self) -> None: diff --git a/pyproject.toml b/pyproject.toml index 66ac98a..768ee02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,9 @@ build-backend = "setuptools.build_meta" requires = ["setuptools >= 61.0"] +[tool.setuptools.package-data] +myhumbleself = ["resources/*"] + [project] name = "MyHumbleSelf" version = "0.1.0" @@ -29,6 +32,7 @@ optional-dependencies = { dev = [ "pre-commit==3.8.0", "pytest==8.3.2", "pytest-cov==5.0.0", + "coveralls==4.0.1", "ruff==0.5.5", ] }