diff --git a/.copier-answers.yml b/.copier-answers.yml index 98fc181192645154981951ed9c14e69b0943a70c..7c24a13bac3d0bbd494725f544f2fbc6f55e5cbc 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 CVS Loader distribution_name: swh-loader-cvs diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d7037fd05757c1ea2bad0fc45ca13fff50e97193..814535049d8570f3dd357733bb959e2bfe6f7e74 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,4 +46,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/pytest.ini b/pytest.ini index 889b7a107f1adc8ec99d20a4fb01a3694d145ecd..5fecb0c04f69c951b46891108a96d92fffea6421 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,7 +1,7 @@ [pytest] norecursedirs = build docs .* asyncio_mode = strict -addopts = "--import-mode=importlib" +consider_namespace_packages = true markers = fs: execute tests that write to the filesystem diff --git a/requirements-test.txt b/requirements-test.txt index 00557c9c726b99cef00a9ed39e3f0359753fa925..a2e38d72c57100df1651867e24b23da10aa7f8ac 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,3 +1,3 @@ -pytest +pytest >= 8.1 pytest-mock swh.scheduler[testing] diff --git a/tox.ini b/tox.ini index e913b73e0140fd59b2b189a52839a54219bbd8d6..6679251522e6c2b0d0307939b15905cfdaaf2623 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ envlist = py3 [testenv] +usedevelop = true extras = testing deps = @@ -17,14 +18,10 @@ deps = swh.scheduler[testing] commands = pytest --doctest-modules \ - --rootdir {envsitepackagesdir} \ - --cov={envsitepackagesdir}/swh/loader/cvs \ + --cov=swh/loader/cvs \ --cov-branch \ - {envsitepackagesdir}/swh/loader/cvs \ + swh/loader/cvs \ {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