diff --git a/.copier-answers.yml b/.copier-answers.yml index 9266fb57d7684c1b65538bc2b788bafe69d96178..eaaaed83a6b145dba59f6fd535d3c56ab2c1bd63 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.1.6 +_commit: v0.2.0 _src_path: https://gitlab.softwareheritage.org/swh/devel/swh-py-template.git description: Software Heritage lister distribution_name: swh-lister diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 40800bba9f023fdc8cc9c54395041c7bcd8dcb19..ce247f184cbb17c7ee5dfd7592af5a3a22b0883c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,4 +43,13 @@ repos: pass_filenames: false language: system types: [python] - + - id: twine-check + name: twine check + description: call twine check when pushing an annotated release tag + entry: bash -c "ref=$(git describe) && + [[ $ref =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && + (python3 -m build --sdist && twine check $(ls -t dist/* | head -1)) || true" + pass_filenames: false + stages: [pre-push] + language: python + additional_dependencies: [twine, build] diff --git a/tox.ini b/tox.ini index c6aee5d2fc3342fd98b5b8b051841a367f3d5541..bf83ef489d9248ff9eb6c7bf1126b49d2621fcd6 100644 --- a/tox.ini +++ b/tox.ini @@ -7,20 +7,17 @@ envlist = py3 [testenv] +usedevelop = true extras = testing deps = pytest-cov commands = pytest --doctest-modules \ - --rootdir {envsitepackagesdir} \ - --cov={envsitepackagesdir}/swh/lister \ + --cov=swh/lister \ --cov-branch \ - {envsitepackagesdir}/swh/lister \ + swh/lister \ {posargs} -# --rootdir (with --import-mode from pytest.ini) are required to make tests -# that depends on the test file to be a proper submodule of the swh namespace -# after migration to PEP420 (implicit namespace). [testenv:black] skip_install = true