Skip to content

Commit 0a1234b

Browse files
update dependencies and add hatcling build system
1 parent e8ef9b6 commit 0a1234b

File tree

4 files changed

+90
-29
lines changed

4 files changed

+90
-29
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
44
hooks:
5-
- id: trailing-whitespace
6-
- id: end-of-file-fixer
7-
- id: check-yaml
8-
- id: check-added-large-files
9-
- id: check-merge-conflict
10-
- repo: https://github.com/crate-ci/typos
11-
rev: v1.29.4
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-merge-conflict
10+
- repo: https://github.com/crate-ci/typos
11+
rev: v1.36.2
1212
hooks:
13-
- id: typos
14-
- repo: https://github.com/DavidAnson/markdownlint-cli2
15-
rev: v0.17.2
13+
- id: typos
14+
- repo: https://github.com/DavidAnson/markdownlint-cli2
15+
rev: v0.18.1
1616
hooks:
17-
- id: markdownlint-cli2
17+
- id: markdownlint-cli2

template/.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
77
- id: check-yaml
88
- id: check-merge-conflict
99
- repo: https://github.com/astral-sh/ruff-pre-commit
1010
# Ruff version.
11-
rev: v0.9.3
11+
rev: v0.13.0
1212
hooks:
1313
# Run the linter.
1414
- id: ruff
1515
types_or: [python, pyi, jupyter]
16-
# Run the formatter.
16+
# Run the formatter.
1717
- id: ruff-format
1818
types_or: [python, pyi, jupyter]
1919
- repo: https://github.com/felixgwilliams/nbwipers-pre-commit
@@ -22,10 +22,10 @@ repos:
2222
- id: nbwipers-check-install
2323
- id: nbwipers-large-files
2424
- repo: https://github.com/crate-ci/typos
25-
rev: v1.29.4
25+
rev: v1.36.2
2626
hooks:
2727
- id: typos
2828
- repo: https://github.com/DavidAnson/markdownlint-cli2
29-
rev: v0.17.2
29+
rev: v0.18.1
3030
hooks:
3131
- id: markdownlint-cli2

template/pyproject.toml.jinja

Lines changed: 70 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,40 @@
11
[project]
22
name = "{{project_name}}"
3-
version = "0.0.0"
43
description = "Add your description here"
54
readme = "README.md"
65
requires-python = ">={{python_version}}"
76
dependencies = [
8-
"ipykernel>=6.29.5",
7+
"ipykernel>=6.29.5",
8+
]
9+
dynamic = ["version"]
10+
11+
[build-system]
12+
requires = ["hatchling"]
13+
build-backend = "hatchling.build"
14+
15+
[tool.coverage.report]
16+
exclude_also = [
17+
"def __repr__",
18+
"if self.debug:",
19+
"if settings.DEBUG",
20+
"raise AssertionError",
21+
"raise NotImplementedError",
22+
"if 0:",
23+
"if __name__ == .__main__.:",
24+
"if TYPE_CHECKING:",
25+
'class .*\bProtocol\):',
26+
'@(abc\.)?abstractmethod',
27+
]
28+
29+
[tool.hatch.version]
30+
path = "{{module_name}}/__init__.py"
31+
32+
[tool.hatch.build.targets.sdist]
33+
exclude = [
34+
"*.ipynb",
35+
"data/",
36+
".venv",
37+
"uv.lock",
938
]
1039

1140
[tool.ruff]
@@ -14,10 +43,37 @@ target-version = "py{{ python_version|replace('.', '') }}"
1443

1544
[tool.ruff.lint]
1645
select = ["ALL"]
17-
ignore = ["COM", "ERA", "ISC001"]
46+
ignore = [
47+
"COM", # trailing commas are not needed
48+
"ERA", # allow commentted code
49+
"ISC001", # conflicts with formatter
50+
"PTH", # allow opening files without pathlib
51+
"TRY003", # allow exception messages as string literals
52+
"TD", # allow FIXME messages
53+
"FIX", # allow FIXME messages
54+
"RUF002", # allow ambiguous characters in docstrings
55+
"RUF003", # allow ambiguous characters in comments
56+
"PLC0415", # allow import outside top level
57+
"PD", # most PD rules are not helpful
58+
]
59+
extend-select = [
60+
"PD002", # pandas-use-of-inplace-argument
61+
"PD007", # pandas-use-of-dot-ix
62+
"PD101", # pandas-nunique-constant-series-check
63+
]
1864

1965
[tool.ruff.lint.per-file-ignores]
20-
"!{{module_name}}/**.py" = ["ANN", "D", "S101", "PLR2004", "T20"]
66+
"!{{module_name}}/**.py" = [
67+
"ANN",
68+
"D",
69+
"S101",
70+
"PLR2004",
71+
"T20",
72+
"EM",
73+
"PLR0913",
74+
"FBT003",
75+
"INP001",
76+
]
2177

2278
[tool.ruff.lint.isort]
2379
required-imports = ["from __future__ import annotations"]
@@ -26,19 +82,22 @@ required-imports = ["from __future__ import annotations"]
2682
convention = "google"
2783

2884
[tool.typos]
29-
files.extend-exclude = ["*.ipynb"]
85+
files.extend-exclude = ["*.ipynb", ".gitignore"]
3086

3187
[tool.uv]
3288
default-groups = ["dev", "lint"]
3389

90+
[tool.nbwipers]
91+
strip-kernel-info = true
92+
3493
[dependency-groups]
3594
dev = [
36-
"nbwipers>=0.6.1",
37-
"pytest>=8",
38-
"pytest-cov>=6.0.0",
39-
"pre-commit>=4.1.0",
40-
"typos>=1.29.4",
95+
"nbwipers>=0.6.1",
96+
"pytest>=8",
97+
"pytest-cov>=7.0.0",
98+
"pre-commit>=4.3.0",
99+
"typos>=1.36.2",
41100
]
42101
lint = [
43-
"ruff>=0.9.3",
102+
"ruff>=0.13.0",
44103
]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
"""Module for {{project_name}}."""
22

33
from __future__ import annotations
4+
5+
__version__ = "0.0.0"

0 commit comments

Comments
 (0)