diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index afbbabcd..172fd236 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,16 @@ repos: # Hooks that are run everywhere - repo: https://github.com/biomejs/pre-commit - rev: v2.0.0-beta.5 + rev: v2.5.0 hooks: - id: biome-format # Hooks that are run for scripts - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.6.0 + rev: v2.25.0 hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.11 + rev: v0.15.18 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/pyproject.toml b/pyproject.toml index 13e8e696..6298610f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] - dynamic = [ "version" ] dependencies = [ "adjusttext", @@ -46,7 +46,6 @@ dependencies = [ "scipy<1.16", # see https://github.com/statsmodels/statsmodels/issues/9584 "session-info", ] - optional-dependencies.dev = [ "furo", "myst-nb", @@ -67,7 +66,7 @@ optional-dependencies.docs = [ "myst-nb>=1.1", "pandas", "scvi-tools>=1.3.1", - "setuptools", # Until pybtex >0.23.0 releases: https://bitbucket.org/pybtex-devs/pybtex/issues/169/ + "setuptools", # Until pybtex >0.23.0 releases: https://bitbucket.org/pybtex-devs/pybtex/issues/169/ "sphinx>=8", "sphinx-autodoc-typehints", "sphinx-book-theme>=1", @@ -99,23 +98,19 @@ optional-dependencies.test = [ "pytest-split", "pytest-xdist>=3", ] - urls.Documentation = "https://cellflow.readthedocs.io/" urls.Home-page = "https://github.com/theislab/cellflow" urls.Source = "https://github.com/theislab/cellflow" -[tool.hatch.build.targets.wheel] -packages = [ 'src/cellflow' ] - -[tool.hatch.version] -source = "vcs" -fallback-version = "0.1.0" +[tool.hatch] +version.source = "vcs" +version.fallback-version = "0.1.0" +build.targets.wheel.packages = [ "src/cellflow" ] [tool.ruff] line-length = 120 src = [ "src" ] extend-include = [ "*.ipynb" ] - format.docstring-code-format = true lint.select = [ "B", # flake8-bugbear @@ -162,39 +157,62 @@ lint.per-file-ignores."docs/*" = [ "I" ] lint.per-file-ignores."tests/*" = [ "D" ] lint.pydocstyle.convention = "numpy" -[tool.pytest.ini_options] -testpaths = [ "tests" ] -xfail_strict = true -addopts = [ +[tool.mypy] +mypy_path = "$MYPY_CONFIG_FILE_DIR/src" +ignore_missing_imports = true +python_version = "3.11" +disallow_any_generics = true +disallow_untyped_calls = false +disallow_untyped_defs = true +disallow_incomplete_defs = true +check_untyped_defs = true +strict_optional = true +warn_redundant_casts = true +warn_unused_ignores = true +warn_return_any = false +warn_unreachable = false +ignore_errors = false +disable_error_code = [ "assignment", "comparison-overlap", "no-untyped-def", "override" ] +strict_equality = true +show_column_numbers = true +error_summary = true +plugins = "numpy.typing.mypy_plugin" +warn_unused_configs = true +no_implicit_optional = true +no_implicit_reexport = true +no_warn_no_return = true +show_error_codes = true + +[tool.pytest] +ini_options.testpaths = [ "tests" ] +ini_options.addopts = [ "--import-mode=importlib", # allow using test files with same name ] -markers = [ - "slow: marks tests as slow (deselect with '-m \"not slow\"')", +ini_options.markers = [ "internet: marks tests that require internet access (deselect with '-m \"not internet\"')", + "slow: marks tests as slow (deselect with '-m \"not slow\"')", ] +ini_options.xfail_strict = true -[tool.coverage.run] -branch = true -source = [ "src/" ] -concurrency = [ "multiprocessing" ] -parallel = "true" - -[tool.coverage.report] -exclude_lines = [ +[tool.coverage] +run.branch = true +run.concurrency = [ "multiprocessing" ] +run.parallel = "true" +run.source = [ "src/" ] +report.exclude_lines = [ '\#.*pragma:\s*no.?cover', - "^if __name__ == .__main__.:$", '^\s*raise AssertionError\b', '^\s*raise NotImplementedError\b', '^\s*return NotImplemented\b', + "^if __name__ == .__main__.:$", ] -precision = 2 -show_missing = true -skip_empty = true -sort = "Miss" +report.precision = 2 +report.show_missing = true +report.skip_empty = true +report.sort = "Miss" [tool.tox] -legacy_tox_ini = """ -[tox] +legacy_tox_ini = '''[tox] min_version = 4.0 env_list = lint-code,py{3.11,3.12,3.13} skip_missing_interpreters = true @@ -284,39 +302,7 @@ commands = biber --tool --output_file={tox_root}{/}docs{/}references.bib --nolog --output_align --output_indent=2 --output_fieldcase=lower \ --output_legacy_dates --output-field-replace=journaltitle:journal,thesis:phdthesis,institution:school \ {tox_root}{/}docs{/}references.bib -""" - -[tool.mypy] -mypy_path = "$MYPY_CONFIG_FILE_DIR/src" -python_version = "3.11" -plugins = "numpy.typing.mypy_plugin" - -ignore_errors = false - -warn_redundant_casts = true -warn_unused_configs = true -warn_unused_ignores = true - -disallow_untyped_calls = false -disallow_untyped_defs = true -disallow_incomplete_defs = true -disallow_any_generics = true - -strict_optional = true -strict_equality = true -warn_return_any = false -warn_unreachable = false -check_untyped_defs = true -no_implicit_optional = true -no_implicit_reexport = true -no_warn_no_return = true - -show_error_codes = true -show_column_numbers = true -error_summary = true -ignore_missing_imports = true - -disable_error_code = [ "assignment", "comparison-overlap", "no-untyped-def", "override" ] +''' [tool.cruft] skip = [