Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ repos:
- id: codespell
additional_dependencies: [tomli]
exclude: (^|/)uv\.lock$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.20.0'
hooks:
- id: mypy
args: [
--no-strict-optional,
--ignore-missing-imports,
]
pass_filenames: false
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ test:

# Run type checking
typing:
uv run --group typing mypy hooks/ tests/
uv run --group typing --group test --isolated ty check

# Run linting and formatting
lint:
uv run --group lint pre-commit run --all-files
uvx prek run -a

# Build docs
docs:
Expand Down
24 changes: 7 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,14 @@ test = [
"pytest-cov",
"pytest-xdist",
]
typing = ["mypy"]
lint = ["pre-commit"]
typing = ["ty>=0.0.28"]

[tool.hatch.build.targets.wheel]
only-include = ["cookiecutter.json", "hooks", "{{cookiecutter.package_name}}"]

[tool.hatch.build.targets.sdist]
only-include = ["cookiecutter.json", "hooks", "{{cookiecutter.package_name}}"]

[tool.mypy]
files = ["tests"]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true

[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
ignore_errors = true

[tool.ruff]
fix = true
unsafe-fixes = true
Expand Down Expand Up @@ -116,6 +100,12 @@ extend-ignore = [
[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ty.src]
include = ["hooks", "tests"]

[tool.ty.terminal]
error-on-warning = true

[tool.pytest.ini_options]
addopts = ["--doctest-modules"]
filterwarnings = [
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""This file is necessary to apply custom mypy configurations for the tests."""
"""Test package marker for the type-checker configuration."""

from __future__ import annotations
271 changes: 26 additions & 245 deletions uv.lock

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions {{cookiecutter.package_name}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ repos:
additional_dependencies: [mdformat-gfm]
args: [--wrap, "88"]
files: (README\.md)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.19.1'
hooks:
- id: mypy
args: [
--no-strict-optional,
--ignore-missing-imports,
]
pass_filenames: false
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.package_name}}/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ test-cov:

# Run type checking
typing:
uv run --group typing --with-editable . mypy src/ tests/
uv run --group typing --group test --isolated ty check

# Run linting and formatting
lint:
uv run --group lint pre-commit run --all-files
uvx prek run -a

# Run all checks
check: lint typing test
27 changes: 8 additions & 19 deletions {{cookiecutter.package_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,7 @@ test = [
"pytest-xdist",
"pytask-parallel>=0.2",
]
typing = ["mypy"]
lint = ["pre-commit"]


[tool.mypy]
files = ["src", "tests"]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true


[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
ignore_errors = true
typing = ["ty>=0.0.28"]


[tool.pytask.ini_options]
Expand Down Expand Up @@ -102,3 +84,10 @@ markers = [
"end_to_end: Flag for tests that cover the whole program.",
]
norecursedirs = [".idea"]


[tool.ty.src]
include = ["src", "tests"]

[tool.ty.terminal]
error-on-warning = true
Loading