diff --git a/copier-template/.pre-commit-config.yaml b/copier-template/.pre-commit-config.yaml index cf6989529ba743dd5661fa7fb18b4e7104122b7d..0e2f34411e68e90b6aaf991ced06ea6ea5f9fe09 100644 --- a/copier-template/.pre-commit-config.yaml +++ b/copier-template/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: rev: 7.1.1 hooks: - id: flake8 - additional_dependencies: [flake8-bugbear==24.4.26] + additional_dependencies: [flake8-bugbear==24.4.26, flake8-pyproject] - repo: https://github.com/codespell-project/codespell rev: v2.3.0 diff --git a/copier-template/mypy.ini b/copier-template/mypy.ini deleted file mode 100644 index 2f5451e39a5a14e01c362d59a0cedf91d749e4ec..0000000000000000000000000000000000000000 --- a/copier-template/mypy.ini +++ /dev/null @@ -1,14 +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-pkg_resources.*] -ignore_missing_imports = True - -# [mypy-add_your_lib_here.*] -# ignore_missing_imports = True diff --git a/copier-template/pyproject.toml.jinja b/copier-template/pyproject.toml.jinja index 4bc7cb3d3d64a931d931f53f83013399c3039bcc..e1ebfa7f47d26b13f96321b4cb2457c66a93fe0a 100644 --- a/copier-template/pyproject.toml.jinja +++ b/copier-template/pyproject.toml.jinja @@ -57,3 +57,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/copier-template/pytest.ini b/copier-template/pytest.ini deleted file mode 100644 index fe398a0babf5a774f332240c7ce22d38f7330ba1..0000000000000000000000000000000000000000 --- a/copier-template/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -norecursedirs = build docs .* -asyncio_mode = strict -consider_namespace_packages = true diff --git a/copier-template/setup.cfg b/copier-template/setup.cfg deleted file mode 100644 index adf9af3e48c7da13135e5dfb6505a1909bc26066..0000000000000000000000000000000000000000 --- a/copier-template/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/copier.yml b/copier.yml index 095075945710b9b3adbde4f41104b961b30b9533..8fa3c7f58f3560f14a808ae26b1fb132baf10a85 100644 --- a/copier.yml +++ b/copier.yml @@ -22,12 +22,13 @@ python_minimal_version: help: What is the minimal version of Python this supports? default: "3.11" choices: - - 3.7 - - 3.8 - - 3.9 - - 3.10 - - 3.11 - - 3.12 + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + readme_format: type: str