diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51cac81a..02a51571 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,14 +17,18 @@ jobs: name: Build wheel runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 if: ${{ github.event_name == 'release' }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.ref }} if: ${{ github.event_name == 'workflow_dispatch' }} + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + run: python -m pip install hatch - name: Build package - run: pipx run build + run: hatch build - uses: actions/upload-artifact@v3 with: path: dist/* diff --git a/.packit.yaml b/.packit.yaml index 052b997c..f59aedd8 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -9,13 +9,12 @@ downstream_package_name: fmf # F37 works with setuptools_scm 7.0 actions: create-archive: - - "python3 -m build --sdist --outdir ." - - "sh -c 'echo fmf-$(hatch version).tar.gz'" + - "hatch build -t sdist" + - "sh -c 'echo dist/fmf-*.tar.gz'" get-current-version: - "hatch version" srpm_build_deps: - - python3-build - hatch - python3-hatch-vcs diff --git a/Makefile b/Makefile index 5063369b..feb8223d 100644 --- a/Makefile +++ b/Makefile @@ -17,18 +17,16 @@ tmp: # Run the test suite, optionally with coverage test: tmp - pytest tests/unit + hatch run test:unit smoke: tmp - pytest tests/unit/test_smoke.py + hatch run test:smoke coverage: tmp - coverage run --source=fmf -m py.test tests - coverage report - coverage annotate + hatch run cov:coverage # Build documentation, prepare man page docs: man - cd docs && make html + hatch run docs:html man: source cp docs/header.txt $(TMP)/man.rst tail -n+7 README.rst >> $(TMP)/man.rst @@ -52,9 +50,9 @@ packages: rpm srpm # Python packaging wheel: - python3 -m build + hatch build upload: - twine upload dist/*.whl + hatch publish # Vim tags and cleanup diff --git a/pyproject.toml b/pyproject.toml index 0fbe11d2..266b9cd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,6 +77,11 @@ features = ["tests-cov"] [tool.hatch.envs.cov.scripts] xml = ["pytest --cov --cov-report=xml"] +coverage = [ + "coverage run -m pytest -vvv -ra --showlocals tests", + "coverage report", + "coverage annotate", + ] [tool.hatch.envs.dev] description = "Development environment"