diff --git a/.copier-answers.yml b/.copier-answers.yml index 314ee7a29c4ac9574145fb8a317e3835705b8f9f..42c02fbf713e02f83a8f61cdcec539b223c4d758 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.2.3 +_commit: v0.3.3 _src_path: https://gitlab.softwareheritage.org/swh/devel/swh-py-template.git description: Software Heritage git loader distribution_name: swh-loader-git diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf6989529ba743dd5661fa7fb18b4e7104122b7d..e777d356acfad2c3032000524d32354e19e798f9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,18 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: check-json - id: check-yaml - repo: https://github.com/python/black - rev: 24.8.0 + rev: 25.1.0 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 6.0.0 hooks: - id: isort @@ -20,14 +20,14 @@ repos: rev: 7.1.1 hooks: - id: flake8 - additional_dependencies: [flake8-bugbear==24.4.26] + additional_dependencies: [flake8-bugbear==24.12.12, flake8-pyproject] - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.1 hooks: - id: codespell name: Check source code spelling - stages: [commit] + stages: [pre-commit] - id: codespell name: Check commit message spelling stages: [commit-msg] diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index f48e919dad45136bc0cbb922a3fd62bce0738448..0000000000000000000000000000000000000000 --- a/mypy.ini +++ /dev/null @@ -1,23 +0,0 @@ -[mypy] -namespace_packages = True -warn_unused_ignores = True -explicit_package_bases = True -# ^ Needed for mypy to detect py.typed from swh packages installed -# in editable mode - -# 3rd party libraries without stubs (yet) - -[mypy-celery.*] -ignore_missing_imports = True - -[mypy-dulwich.*] -ignore_missing_imports = True - -[mypy-pkg_resources.*] -ignore_missing_imports = True - -[mypy-pytest.*] -ignore_missing_imports = True - -[mypy-swh.loader.*] -ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml index c3acccc2a979ea08a907995924e366ea753c0952..500b22233fae517ab7d44dec62dba923dffde2d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,3 +56,35 @@ ensure_newline_before_comments = true line_length = 88 force_sort_within_sections = true known_first_party = ['swh'] + +[tool.mypy] +namespace_packages = true +warn_unused_ignores = true +explicit_package_bases = true +# ^ Needed for mypy to detect py.typed from swh packages installed +# in editable mode + +plugins = [] + +# 3rd party libraries without stubs (yet) +# [[tool.mypy.overrides]] +# module = [ +# "package1.*", +# "package2.*", +# ] +# ignore_missing_imports = true + +[tool.flake8] +select = ["C", "E", "F", "W", "B950"] +ignore = [ + "E203", # whitespaces before ':' <https://github.com/psf/black/issues/315> + "E231", # missing whitespace after ',' + "E501", # line too long, use B950 warning from flake8-bugbear instead + "W503" # line break before binary operator <https://github.com/psf/black/issues/52> +] +max-line-length = 88 + +[tool.pytest.ini_options] +norecursedirs = "build docs .*" +asyncio_mode = "strict" +consider_namespace_packages = true diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 7877cd5b3d5cea41bf55bc46a6c2cb22d2207d7b..0000000000000000000000000000000000000000 --- a/pytest.ini +++ /dev/null @@ -1,12 +0,0 @@ -[pytest] -norecursedirs = build docs .* -asyncio_mode = strict -consider_namespace_packages = true - -addopts = - -p no:pytest_swh_scheduler - -p no:pytest_swh_storage - -# Drop this when these fixtures aren't imported automatically -markers = - fs: depends on writing to the filesystem diff --git a/requirements-test.txt b/requirements-test.txt index 6a772bbfcfaae24910677d37e6ab851a7bf2f45c..1e3183ebd028074ade4ad92c90e1f6b4ff2c88fd 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,3 +1,4 @@ +celery-types pytest >= 8.1 pytest-mock requests_mock diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index adf9af3e48c7da13135e5dfb6505a1909bc26066..0000000000000000000000000000000000000000 --- a/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[flake8] -# E203: whitespaces before ':' <https://github.com/psf/black/issues/315> -# E231: missing whitespace after ',' -# E501: line too long, use B950 warning from flake8-bugbear instead -# W503: line break before binary operator <https://github.com/psf/black/issues/52> -select = C,E,F,W,B950 -ignore = E203,E231,E501,E704,W503 -max-line-length = 88 diff --git a/tox.ini b/tox.ini index 1e9d9df6ea491ab3052fe7df6e7324e5df75a546..a65134c739618aac4a6f143e697150bf34829bc8 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,7 @@ commands = [testenv:black] skip_install = true deps = - black==24.8.0 + black==25.1.0 commands = {envpython} -m black --check swh @@ -30,8 +30,10 @@ commands = skip_install = true deps = flake8==7.1.1 - flake8-bugbear==24.4.26 + flake8-bugbear==24.12.12 + flake8-pyproject==1.2.3 pycodestyle==2.12.1 + commands = {envpython} -m flake8 @@ -39,7 +41,7 @@ commands = extras = testing deps = - mypy==1.11.1 + mypy==1.15.0 commands = mypy swh