diff --git a/.copier-answers.yml b/.copier-answers.yml index f871bc0af3608077642952b1169c3573db870896..ecd49f60f3ed69c7e2a29b8e6d7fc6764b2147f1 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 datastore scrubber distribution_name: swh-scrubber diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e52b12f0332ea645f6b44e175fed9428dda2263..8e227e63d943ff7d9b5ffa4899b7bc1f8e07c035 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,3 +45,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 4d64639a3502596d62f57c493153216693ba3800..9a8c8bfbb30f02f281ccbe7e8121db7cdb6ab73d 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ envlist = py3 [testenv] +usedevelop = true passenv = JAVA_HOME SWH_CASSANDRA_LOG @@ -16,14 +17,10 @@ deps = pytest-cov commands = pytest --doctest-modules \ - --rootdir {envsitepackagesdir} \ - --cov={envsitepackagesdir}/swh/scrubber \ + --cov=swh/scrubber \ --cov-branch \ - {envsitepackagesdir}/swh/scrubber \ + swh/scrubber \ {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