diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8172e035..cde5613d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,25 +5,25 @@ repos: - id: check-merge-conflict - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.15.13" + rev: "v0.16.7" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v2.1.0" + rev: "v2.3.1" hooks: - id: mypy additional_dependencies: [types-requests, types-PyYAML] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.44.0 + rev: v0.49.1 hooks: - id: markdownlint args: ["--disable", "MD013", "--disable", "MD025", "--"] - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell name: Check common misspellings in text files with codespell. @@ -31,7 +31,7 @@ repos: - tomli - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.21.2 + rev: v2.29.4 hooks: - id: pyproject-fmt name: Apply a consistent format to pyproject.toml diff --git a/docs/parameters_guide.md b/docs/parameters_guide.md index af549b9a..c55e9ee9 100644 --- a/docs/parameters_guide.md +++ b/docs/parameters_guide.md @@ -78,6 +78,7 @@ There may be cases where you want to change existing parameter groups, such as i ```python from swmmanywhere.parameters import register_parameter_group, TopologyDerivation, Field + @register_parameter_group("topology_derivation") class NewTopologyDerivation(TopologyDerivation): new_weight_scaling: float = Field( diff --git a/pyproject.toml b/pyproject.toml index 5c8096e7..00532585 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: GIS", "Typing :: Typed", @@ -91,15 +92,15 @@ urls.Issues = "https://github.com/ImperialCollegeLondon/SWMManywhere/issues" urls.Source = "https://github.com/ImperialCollegeLondon/SWMManywhere" [tool.hatch] +version.source = "vcs" +metadata.license = "BSD-3-clause" # Or your primary license name +metadata.license-files = [ "LICENSE", "src/netcomp/LICENSE.txt" ] build.hooks.vcs.version-file = "_version.py" build.targets.sdist.exclude = [ "*.zip", ] build.targets.wheel.only-include = [ "src" ] build.targets.wheel.sources = [ "src" ] -metadata.license = "BSD-3-clause" # Or your primary license name -metadata.license-files = [ "LICENSE", "src/netcomp/LICENSE.txt" ] -version.source = "vcs" [tool.ruff] lint.select = [ "D", "E", "F", "I" ] # pydocstyle, pycodestyle, Pyflakes, isort @@ -111,46 +112,48 @@ lint.isort.required-imports = [ "from __future__ import annotations" ] lint.pydocstyle.convention = "google" [tool.codespell] -skip = "src/swmmanywhere/defs/iso_converter.yml,*.inp,docs/paper/*" ignore-words-list = "gage,gages,Carrer,anc" +skip = "src/swmmanywhere/defs/iso_converter.yml,*.inp,docs/paper/*" [tool.mypy] +exclude = [ ".venv/" ] disallow_any_explicit = false disallow_any_generics = false -warn_unreachable = true -warn_unused_ignores = false disallow_untyped_defs = false -exclude = [ ".venv/" ] +warn_unused_ignores = false +warn_unreachable = true overrides = [ { module = "tests.*", disallow_untyped_defs = false } ] [tool.pytest] -ini_options.addopts = "-v --cov=src/swmmanywhere --cov-report=xml --doctest-modules --ignore=src/swmmanywhere/logging.py" +ini_options.addopts = """\ + -v --cov=src/swmmanywhere --cov-report=xml --doctest-modules --ignore=src/swmmanywhere/logging.py\ + """ ini_options.markers = [ "downloads: mark a test as requiring downloads", ] [tool.coverage] -run.branch = true -run.omit = [ - "**/__init__.py", -] run.source = [ "swmmanywhere", ] +run.omit = [ + "**/__init__.py", +] +run.branch = true paths.omit = [ "**/__init__.py", ] paths.source = [ "src", "*/site-packages" ] +report.omit = [ + "**/__init__.py", +] report.exclude_lines = [ "if TYPE_CHECKING:", ] report.ignore_errors = true -report.omit = [ - "**/__init__.py", -] [tool.refurb] ignore = [ - 184, # Because some frankly bizarre suggestions - 109, # Because pyyaml doesn't support tuples + 184, # Because some frankly bizarre suggestions + 109, # Because pyyaml doesn't support tuples ]