From ea8684453d2cbbf11a0057f95592048ff23d654e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 21:07:58 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/crate-ci/typos: v1.43.1 → v1](https://github.com/crate-ci/typos/compare/v1.43.1...v1) - [github.com/astral-sh/ruff-pre-commit: v0.15.0 → v0.15.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.0...v0.15.9) - [github.com/pre-commit/mirrors-mypy: v1.19.1 → v1.20.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.19.1...v1.20.0) - [github.com/tox-dev/pyproject-fmt: v2.12.1 → v2.21.0](https://github.com/tox-dev/pyproject-fmt/compare/v2.12.1...v2.21.0) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ebac51c9..da5e8fc7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: - id: detect-private-key - repo: https://github.com/crate-ci/typos - rev: v1.43.1 + rev: v1 hooks: - id: typos # empty to do not write fixes @@ -55,7 +55,7 @@ repos: args: ["--print-width=79"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.0 + rev: v0.15.9 hooks: # use black formatting - id: ruff-format @@ -67,13 +67,13 @@ repos: # it needs to be after formatting hooks because the lines might be changed - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.19.1 + rev: v1.20.0 hooks: - id: mypy files: "src/.*" - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.12.1 + rev: v2.21.0 hooks: - id: pyproject-fmt additional_dependencies: [tox] From 4cf1f3767ea36d46dced0b3c89daa05838120388 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 21:08:43 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyproject.toml | 83 +++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 49 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 13759f81..029c73bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,4 @@ # === Metadata & Build System === - [build-system] requires = [ "setuptools", @@ -22,7 +21,7 @@ keywords = [ ] license = { file = "LICENSE" } authors = [ - { name = "Shay Palachy Affek", email = 'shay.palachy@gmail.com' }, + { name = "Shay Palachy Affek", email = "shay.palachy@gmail.com" }, ] requires-python = ">=3.10" classifiers = [ @@ -49,7 +48,6 @@ dependencies = [ "pympler>=1", "watchdog>=2.3.1", ] - optional-dependencies.all = [ "boto3>=1.26", "pymongo>=4", @@ -70,31 +68,24 @@ optional-dependencies.sql = [ ] urls.Source = "https://github.com/python-cachier/cachier" # --- setuptools --- - scripts.cachier = "cachier.__main__:cli" [tool.setuptools] include-package-data = true - -[tool.setuptools.dynamic] -version = { attr = "cachier._version.__version__" } - -[tool.setuptools.packages.find] -where = [ +dynamic.version = { attr = "cachier._version.__version__" } +packages.find.where = [ "src", -] # list of folders that contain the packages (["."] by default) -include = [ +] # list of folders that contain the packages (["."] by default) +packages.find.include = [ "cachier*", -] # package names should match these glob patterns (["*"] by default) -namespaces = false # to disable scanning PEP 420 namespaces (true by default) +] # package names should match these glob patterns (["*"] by default) +packages.find.namespaces = false # to disable scanning PEP 420 namespaces (true by default) # === Linting & Formatting === - [tool.black] line-length = 120 # --- ruff --- - [tool.ruff] target-version = "py310" line-length = 120 @@ -113,12 +104,12 @@ lint.select = [ "D", # see: https://pypi.org/project/pydocstyle "E", "F", # see: https://pypi.org/project/pyflakes - "I", #see: https://pypi.org/project/isort/ + "I", # see: https://pypi.org/project/isort/ "RUF100", # alternative to yesqa - #"N", # see: https://pypi.org/project/pep8-naming - "S", # see: https://pypi.org/project/flake8-bandit + # "N", # see: https://pypi.org/project/pep8-naming + "S", # see: https://pypi.org/project/flake8-bandit "SIM", - "W", # see: https://pypi.org/project/pycodestyle + "W", # see: https://pypi.org/project/pycodestyle ] lint.extend-select = [ "A", # see: https://pypi.org/project/flake8-builtins @@ -156,13 +147,12 @@ lint.per-file-ignores."tests/**" = [ lint.unfixable = [ "F401", ] - # --- flake8 --- -#[tool.ruff.pydocstyle] +# [tool.ruff.pydocstyle] ## Use Google-style docstrings. -#convention = "google" -#[tool.ruff.pycodestyle] -#ignore-overlong-task-comments = true +# convention = "google" +# [tool.ruff.pycodestyle] +# ignore-overlong-task-comments = true # Unlike Flake8, default to a complexity level of 10. lint.mccabe.max-complexity = 10 @@ -173,20 +163,18 @@ wrap-summaries = 120 wrap-descriptions = 120 blank = true +[tool.pytest] # === Testing === - # --- pytest --- - -[tool.pytest.ini_options] -testpaths = [ +ini_options.testpaths = [ "cachier", "tests", ] -norecursedirs = [ +ini_options.norecursedirs = [ "dist", "build", ] -addopts = [ +ini_options.addopts = [ "--color=yes", "-r a", "-v", @@ -194,7 +182,7 @@ addopts = [ "-W error", # Note: parallel execution is opt-in via -n/--numprocesses (pytest-xdist) ] -markers = [ +ini_options.markers = [ "mongo: test the MongoDB core", "memory: test the memory core", "pickle: test the pickle core", @@ -208,29 +196,26 @@ markers = [ "seriallocal: local core tests that should run serially", ] -[tool.coverage.report] -show_missing = true -# Regexes for lines to exclude from consideration -exclude_lines = [ - "pragma: no cover", # Have to re-enable the standard pragma - "raise NotImplementedError", # Don't complain if tests don't hit defensive assertion code: - "if TYPE_CHECKING:", # Is only true when running mypy, not tests -] +[tool.coverage] # Parallel test execution configuration # Use: pytest -n auto (for automatic worker detection) # Or: pytest -n 4 (for specific number of workers) # Memory tests are safe to run in parallel by default # Pickle tests require isolation (handled by conftest.py fixture) - # --- coverage --- - -[tool.coverage.run] -branch = true -parallel = true +run.branch = true # dynamic_context = "test_function" -omit = [ - "tests/*", - "src/cachier/_version.py", - "src/cachier/__init__.py", +run.omit = [ "**/scripts/**", + "src/cachier/__init__.py", + "src/cachier/_version.py", + "tests/*", +] +run.parallel = true +# Regexes for lines to exclude from consideration +report.exclude_lines = [ + "if TYPE_CHECKING:", # Is only true when running mypy, not tests + "pragma: no cover", # Have to re-enable the standard pragma + "raise NotImplementedError", # Don't complain if tests don't hit defensive assertion code: ] +report.show_missing = true