-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
200 lines (175 loc) · 5.92 KB
/
pyproject.toml
File metadata and controls
200 lines (175 loc) · 5.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
[project]
name = "ssb-statstruk"
version = "0.0.10"
description = "SSB Statstruk"
authors = [{ name = "Susie Jentoft", email = "coo@ssb.no" }]
license = "MIT"
readme = "README.md"
requires-python = ">=3.10,<4.0"
dynamic = ["classifiers"]
dependencies = [
"click>=8.0.1",
"numpy>=2.1.3",
"pandas>=2.2.3",
"statsmodels>=0.14.5",
"pandas-stubs>=2.2.3.241126",
]
[project.urls]
homepage = "https://github.com/statisticsnorway/ssb-statstruk"
repository = "https://github.com/statisticsnorway/ssb-statstruk"
documentation = "https://statisticsnorway.github.io/ssb-statstruk"
Changelog = "https://github.com/statisticsnorway/ssb-statstruk/releases"
[tool.poetry.dependencies]
python = ">=3.10,<4"
click = ">=8.0.1"
[dependency-groups]
lint = [
"black[jupyter]>=25.11.0",
"pre-commit>=4.4.0",
"pre-commit-hooks>=6.0.0",
"pydoclint>=0.8.3",
"ruff>=0.14.5",
]
doc = [
"furo>=2025.9.25; python_version >= '3.11'",
"myst-parser>=4.0.1; python_version >= '3.11'",
"sphinx>=8.2.3; python_version >= '3.11'",
"sphinx-autobuild>=2025.8.25; python_version >= '3.11'",
"sphinx-autodoc-typehints>=3.5.2; python_version >= '3.11'",
"sphinx-click>=6.1.0; python_version >= '3.11'",
]
# There is a bug in poetry regarding nested dependency groups. It
# has been fixed but not released yet, waiting for version 2.2.2. See:
# https://github.com/python-poetry/poetry/issues/10632
# Need to duplicate doc and lint dependencies in dev for now.
# Type hint stubs should be placed in the dev dependency group
dev = [
# lint dependencies
"black[jupyter]>=25.11.0",
"pre-commit>=4.4.0",
"pre-commit-hooks>=6.0.0",
"pydoclint>=0.8.3",
"ruff>=0.14.5",
# doc dependencies
"furo>=2025.9.25; python_version >= '3.11'",
"myst-parser>=4.0.1; python_version >= '3.11'",
"sphinx>=8.2.3; python_version >= '3.11'",
"sphinx-autobuild>=2025.8.25; python_version >= '3.11'",
"sphinx-autodoc-typehints>=3.5.2; python_version >= '3.11'",
"sphinx-click>=6.1.0; python_version >= '3.11'",
# dev dependendcies
"coverage[toml]>=7.11.3",
"deptry>=0.24.0",
"mypy>=1.18.2",
"pygments>=2.19.0",
"pytest>=9.0.0",
"typeguard>=2.13.3",
"xdoctest[colors]>=1.3.0",
]
[tool.poetry]
classifiers = ["Development Status :: 3 - Alpha"]
requires-poetry = ">=2.2"
packages = [{ include = "statstruk", from = "src" }]
[tool.poetry.requires-plugins]
poetry-plugin-export = ">=1.9"
[tool.poetry.scripts]
ssb-statstrukt = "statstrukt.__main__:main"
[tool.pytest.ini_options]
pythonpath = ["src"]
[tool.coverage.paths]
source = ["src", "*/site-packages"]
tests = ["tests", "*/tests"]
[tool.coverage.run]
branch = true
source = ["statstruk", "tests"]
relative_files = true
[tool.coverage.report]
show_missing = true
fail_under = 50
[tool.deptry.per_rule_ignores]
DEP001 = ["nox", "nox_poetry"] # packages available by default
[tool.mypy]
strict = true
warn_unreachable = true
pretty = true
show_column_numbers = true
show_error_context = true
[tool.pydoclint]
style = "google"
exclude = '\.git|\.nox'
arg-type-hints-in-docstring = false
check-return-types = false
check-yield-types = false
allow-init-docstring = true
quiet = true
[tool.ruff]
force-exclude = true # Apply excludes to pre-commit
show-fixes = true
src = ["src", "tests"]
target-version = "py311" # Minimum Python version supported
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
extend-exclude = [
"__pycache__",
"old",
"*/.ipynb_checkpoints/*",
"noxfile.py",
"docs/conf.py",
"src/run_testing.py",
"src/regressionmodel.py",
"tests/*",
]
# Ruff rules may be customized as desired: https://docs.astral.sh/ruff/rules/
[tool.ruff.lint]
select = [
"A", # prevent using keywords that clobber python builtins
"ANN", # check type annotations
"B", # bugbear: security warnings
"D", # documentation
"E", # pycodestyle
"F", # pyflakes
"ISC", # implicit string concatenation
"I", # sort imports
"UP", # alert you when better syntax is available in your python version
"RUF", # the ruff developer's own rules
"NPY201" # New with numpy 2.0.0
]
ignore = [
"ANN202", # Don't require return type annotation for private functions.
"ANN401", # Allow type annotation with type Any.
"D100", # Supress undocumented-public-module. Only doc of public api required.
"FBT001", # Allow boolean positional arguments in a function.
"FBT002", # Allow boolean default positional arguments in a function.
"E402", # Supress module-import-not-at-top-of-file, needed in jupyter notebooks.
"E501", # Supress line-too-long warnings: trust black's judgement on this one.
"PLR2004", # Allow to compare with unnamed numerical constants.
]
external = ["DOC"] # Avoiding removing any codes starting with `DOC` from any `# noqa` directives.
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.lint.pydocstyle]
convention = "google" # You can also use "numpy".
[tool.ruff.lint.pylint]
max-args = 8
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["classmethod", "validator", "root_validator", "pydantic.validator"]
[tool.ruff.lint.per-file-ignores]
"*/__init__.py" = ["F401"]
"**/tests/*" = [
"ANN001", # type annotations don't add value for test functions
"ANN002", # type annotations don't add value for test functions
"ANN003", # type annotations don't add value for test functions
"ANN201", # type annotations don't add value for test functions
"ANN204", # type annotations don't add value for test functions
"ANN205", # type annotations don't add value for test functions
"ANN206", # type annotations don't add value for test functions
"D100", # docstrings are overkill for test functions
"D101",
"D102",
"D103",
"S101", # asserts are encouraged in pytest
]
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"