diff --git a/.copier-answers.yml b/.copier-answers.yml index 2d053422340ab63fe68f8a6d5a24723a45e995bc..2c24d6fd9dbe74ab26e846eb8829435ef90257b4 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.1.5 +_commit: v0.1.6 _src_path: https://gitlab.softwareheritage.org/swh/devel/swh-py-template.git description: Software Heritage deposit server distribution_name: swh-deposit diff --git a/.gitignore b/.gitignore index 035b13951e98580e45e6b453c2bb6fa9aef9a59f..d44f090faaff2efa7c3dfa14d2a402ae0d6b4eaf 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,9 @@ __pycache__ build/ dist/ +# these are symlinks created by a hook in swh-docs' main sphinx conf.py docs/README.rst docs/README.md +# this should be a symlink for people who want to build the sphinx doc +# without using tox, generally created by the swh-env/bin/update script +docs/Makefile.sphinx diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6dd3da15e9c2076606f7bdde40c76bd258e68631..8dab855808a735a52157a62526db89a7183b0163 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,6 +31,9 @@ repos: name: Check source code spelling args: [-L sur] stages: [commit] + - id: codespell + name: Check commit message spelling + stages: [commit-msg] - repo: local hooks: diff --git a/docs/Makefile b/docs/Makefile index 3437a48778a2638e4beaed2e9e61e9e976c20de1..ac4259f27d07102ce6166831b7bbed08c4f70923 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,4 +1,4 @@ -include swh-docs/Makefile.sphinx +include Makefile.sphinx APIDOC_EXCLUDES += ../swh/*/settings/* diff --git a/pyproject.toml b/pyproject.toml index 0cc46a0fd9cd039108ec359f25133b556a4c9c81..092bd34b0c8b33f5139181757d80fbb9497c1f01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,3 +63,4 @@ use_parentheses = true ensure_newline_before_comments = true line_length = 88 force_sort_within_sections = true +known_first_party = ['swh'] diff --git a/pytest.ini b/pytest.ini index 98c5ccf6f89386ccf13d3d6cd81225d37e683cb3..04c78b48f82420a77215463237bd5709a201ece1 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,10 +1,11 @@ [pytest] # Remove the pytest_swh_* entries when they stop getting imported automatically -addopts = --ignore=swh/deposit/settings -p no:flask -p no:pytest_swh_scheduler -p no:pytest_swh_storage -p no:pytest_swh_core +addopts = --import-mode=importlib --ignore=swh/deposit/settings -p no:flask -p no:pytest_swh_scheduler -p no:pytest_swh_storage -p no:pytest_swh_core norecursedirs = build docs .* +asyncio_mode = strict + DJANGO_SETTINGS_MODULE = swh.deposit.settings.testing markers = db: execute tests using a postgresql database fs: execute tests using the filesystem -asyncio_mode = strict diff --git a/tox.ini b/tox.ini index b511d7dd585b57e9c4691c34bc61984f26879c43..5ce2689be3735d626f8e2a181f9f656d68706e94 100644 --- a/tox.ini +++ b/tox.ini @@ -21,21 +21,20 @@ deps = django3: Django>=3,<4 commands = pytest --doctest-modules \ - --import-mode importlib \ --rootdir {envsitepackagesdir} \ --cov={envsitepackagesdir}/swh/deposit \ --cov-branch \ --ignore {envsitepackagesdir}/swh/deposit/settings/ \ {envsitepackagesdir}/swh/deposit \ {posargs} -# --rootdir and --import-mode 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). +# --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 deps = - black==22.10.0 + black==23.1.0 commands = {envpython} -m black --check swh @@ -73,4 +72,4 @@ setenv = # turn warnings into errors SPHINXOPTS = -W commands = - make -I {env_dir}/share/ -C docs + make -I {env_dir}/share/swh-docs -C docs