diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..872e604 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,34 @@ +name: LibraryOfCongress/tests-bagit-python + +permissions: {} + +on: + workflow_dispatch: + +jobs: + test: + name: Tests (Python ${{ matrix.python-version }}) + runs-on: ubuntu-latest + permissions: + contents: read + + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + + steps: + - uses: actions/checkout@v6 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + with: + version: "0.11.8" + + - name: Run tests with coverage + run: uv run pytest --cov diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml deleted file mode 100644 index d03a90b..0000000 --- a/.github/workflows/coveralls.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: LibraryOfCongress/tests-bagit-python -permissions: {} - -on: - workflow_dispatch: -jobs: - test: - permissions: - contents: read - runs-on: ubuntu-16.04 - steps: - - name: checkout - uses: actions/checkout@v3.5.0 - - uses: actions/setup-python@v4.6.0 - with: - python-version: "${{ matrix.python }}" - - run: apt-get -y install gettext - - run: pip install --upgrade pip - - run: pip install coveralls coverage - - run: coverage run --include=bagit.py setup.py test - - run: coveralls - if: "${{ success() }}" - strategy: - matrix: - python: - - "3.10" diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 1250573..aa2d5e6 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -10,12 +10,12 @@ jobs: contents: read runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: path: dist/*.tar.gz @@ -31,11 +31,12 @@ jobs: name: pypi url: https://pypi.org/p/bagit steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: # unpacks default artifact into dist/ # if `name: artifact` is omitted, the action will create extra parent dir name: artifact path: dist + - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4cc7f9..7c5402b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,11 +13,13 @@ jobs: contents: read runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + - run: pip install --user ruff - run: ruff check --output-format=github test: + name: Tests (Python ${{ matrix.python-version }}) needs: ruff permissions: contents: read @@ -26,14 +28,19 @@ jobs: fail-fast: false matrix: python-version: - ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} + - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + with: + version: "0.11.8" + - name: Run tests run: uv run pytest diff --git a/pyproject.toml b/pyproject.toml index 937984a..7719a68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ addopts = "-v" [tool.coverage.run] branch = true -include = "src" +include = ["src/*"] [tool.hatch.version] source = "vcs" @@ -61,5 +61,6 @@ include = [ dev = [ "coverage>=7.8.2", "pytest>=8.4.0", + "pytest-cov>=7.1.0", "ruff>=0.11.12", ]