diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0131be9..469b848 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,30 +3,30 @@ default_language_version: python: python3.11 repos: - - repo: https://github.com/pre-commit/pre-commit-hooks +- repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - - id: trailing-whitespace - - id: end-of-file-fixer + - id: trailing-whitespace + - id: end-of-file-fixer exclude: | (?x)^( .*\.svg )$ - - id: check-yaml - - id: check-added-large-files - - id: detect-private-key - - repo: https://github.com/python-poetry/poetry - rev: "1.8.0" + - id: check-yaml + - id: check-added-large-files + - id: detect-private-key +- repo: https://github.com/python-poetry/poetry + rev: "2.0.1" hooks: - - id: poetry-check - - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.4.3" + - id: poetry-check +- repo: https://github.com/tox-dev/pyproject-fmt + rev: "v2.5.0" hooks: - - id: pyproject-fmt - - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + - id: pyproject-fmt +- repo: https://github.com/codespell-project/codespell + rev: v2.4.1 hooks: - - id: codespell + - id: codespell exclude: | (?x)^( .*\.lock | @@ -34,40 +34,46 @@ repos: .*\.ipynb | .*\.cppipe )$ - - repo: https://github.com/executablebooks/mdformat +- repo: https://github.com/executablebooks/mdformat rev: 0.7.18 hooks: - - id: mdformat + - id: mdformat additional_dependencies: - - mdformat-gfm - - repo: https://github.com/citation-file-format/cffconvert + - mdformat-gfm +- repo: https://github.com/citation-file-format/cffconvert rev: b6045d78aac9e02b039703b030588d54d53262ac hooks: - - id: validate-cff - - repo: https://github.com/adrienverge/yamllint + - id: validate-cff +- repo: https://github.com/adrienverge/yamllint rev: v1.35.1 hooks: - - id: yamllint - - repo: https://github.com/rhysd/actionlint - rev: v1.7.3 + - id: yamllint + exclude: pre-commit-config.yaml +- repo: https://github.com/rhysd/actionlint + rev: v1.7.7 hooks: - - id: actionlint - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.0" + - id: actionlint +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.9.4" hooks: - - id: ruff-format - - id: ruff - - repo: local + - id: ruff-format + - id: ruff +- repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update + rev: v0.6.0 hooks: - - id: code-cov-gen + - id: pre-commit-update + args: ["--keep", "mdformat", "--keep", "pre-commit-update", "--keep", "cffconvert"] +- repo: local + hooks: + - id: code-cov-gen name: Generate code coverage language: system entry: poetry run coverage run -m pytest pass_filenames: false always_run: true - - repo: https://github.com/Weird-Sheep-Labs/coverage-pre-commit +- repo: https://github.com/Weird-Sheep-Labs/coverage-pre-commit rev: 0.1.1 hooks: - - id: coverage-xml - - id: coverage-badge + - id: coverage-xml + - id: coverage-badge args: ["-o", "media/coverage-badge.svg"] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 51e5e5e..baf8bfd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing -Please see our [contributing](https://WayScience.github.io/CytoDataFrame/main/contributing) documentation for more details on contributions, development, and testing. +Please see our [contributing](docs/src/contributing.md) documentation for more details on contributions, development, and testing. diff --git a/pyproject.toml b/pyproject.toml index b674a82..f7d36bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,9 @@ license = "BSD-3-Clause" readme = "README.md" packages = [ { include = "cytodataframe", from = "src" } ] +[tool.poetry.requires-plugins] +poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = [ "plugin" ] } + [tool.poetry.dependencies] python = ">=3.9,<3.13" # used for data management @@ -73,7 +76,7 @@ style = "pep440" vcs = "git" [tool.poetry-dynamic-versioning.substitution] -files = [ "src/CytoDataFrame/__init__.py" ] +files = [ "src/cytodataframe/__init__.py" ] # defines various development tasks diff --git a/tests/test_image.py b/tests/test_image.py index 0e5a0e1..5813681 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -109,9 +109,9 @@ def test_draw_outline_on_image_from_outline( if expected_non_black_mask: assert np.any(non_black_mask), "Expected a non-black outline but got none." else: - assert not np.any( - non_black_mask - ), "Expected no outline but got a non-black area." + assert not np.any(non_black_mask), ( + "Expected no outline but got a non-black area." + ) @pytest.mark.parametrize( @@ -220,6 +220,6 @@ def test_adjust_with_adaptive_histogram_equalization( # Test if the function processes the image and # returns a result with the expected shape result = adjust_with_adaptive_histogram_equalization(input_image) - assert ( - result.shape == expected_shape - ), f"Expected shape {expected_shape}, but got {result.shape}" + assert result.shape == expected_shape, ( + f"Expected shape {expected_shape}, but got {result.shape}" + )