-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
169 lines (143 loc) · 4.86 KB
/
pyproject.toml
File metadata and controls
169 lines (143 loc) · 4.86 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
[project]
name = "dapla-statbank-client"
description = "Handles data transfer Statbank <-> Dapla for Statistics Norway"
license = "MIT"
version = "1.4.1"
readme = "README.md"
authors = [{name = "Carl F. Corneil", email = "cfc@ssb.no"}, {name = "Statistics Norway"}]
requires-python = ">=3.10"
dependencies = [
"pandas >=2.2.0",
"pyarrow >=10.0.1",
"requests >=2.28.2",
"ipywidgets >=8.0.4",
"IPython >=8.11.0",
"toml >=0.10.2",
"python-dotenv >=1.0.1",
"colorama >=0.4.6",
"dapla-auth-client >=1.0.1; python_version >= '3.10' and python_version < '4.0'",
"furl >=2.1.4",
"pathlib-abc >=0.5.2",
]
[project.urls]
homepage = "https://github.com/statisticsnorway/dapla-statbank-client"
repository = "https://github.com/statisticsnorway/dapla-statbank-client"
documentation = "https://statisticsnorway.github.io/dapla-statbank-client"
Changelog = "https://github.com/statisticsnorway/dapla-statbank-client/releases"
[tool.poetry]
packages = [{ include = "statbank", from = "src" }]
classifiers = ["Development Status :: 5 - Production/Stable"]
requires-poetry = ">=2.0"
[tool.poetry.group.dev.dependencies]
pygments = ">=2.10.0"
black = { extras = ["jupyter"], version = ">=24.3.0" }
coverage = { extras = ["toml"], version = ">=6.2" }
darglint = {version = ">=1.8.1", python = ">=3.12,<4.0"}
mypy = ">=0.930"
pre-commit = ">=2.16.0"
pre-commit-hooks = ">=4.1.0"
ruff = ">=0.0.284"
pytest = ">=6.2.5"
typeguard = ">=2.13.3"
xdoctest = { extras = ["colors"], version = ">=0.15.10" }
ipykernel = ">=6.0.0"
pytest-cov = ">=7.0.0"
[tool.poetry.group.docs.dependencies]
sphinx = ">=6.2.1"
sphinx-autobuild = ">=2021.3.14"
sphinx-autodoc-typehints = ">=1.24.0"
sphinx-click = ">=3.0.2"
furo = ">=2021.11.12"
myst-parser = { version = ">=0.16.1" }
# Stubs for Pylance og Mypy
[tool.poetry.group.typing.dependencies]
pandas-stubs = ">=2.2.0"
types-requests = ">=2.28.2"
types-colorama = ">=0.4.6"
types-toml = ">=0.10.2"
pyarrow-stubs = {version = ">=10.0.1", python = ">=3.8,<4.0"}
[tool.pytest.ini_options]
pythonpath = ["src"]
markers = ["integration_dapla: actually runs against the real statbank API, therefore needs username and password"]
[tool.coverage.paths]
source = ["src", "*/site-packages"]
tests = ["tests", "*/tests"]
[tool.coverage.run]
branch = true
source = ["statbank", "tests"]
omit = ["*api_types.py"]
relative_files = true
[tool.coverage.report]
show_missing = true
fail_under = 80
omit = ["*api_types.py"]
[tool.mypy]
strict = true
warn_unreachable = true
pretty = true
show_column_numbers = true
show_error_context = true
exclude = ["tests", "docs", "noxfile.py"]
[[tool.mypy.overrides]]
module = [
"ipywidgets.*",
"furl.*",
"pathlib_abc.*",
]
ignore_missing_imports = true
[tool.ruff]
force-exclude = true # Apply excludes to pre-commit
show-fixes = true
src = ["src", "tests"]
# Ruff rules may be customized as desired: https://docs.astral.sh/ruff/rules/
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
extend-exclude = [
"__pycache__",
"old",
".ipynb_checkpoints",
"noxfile.py",
"docs/conf.py",
"*.ipynb", # Custom ignore for klass-package, notebooks are only for "demo", waiting for a B018 ignore on notebooks in ruff
"demo/",
]
[tool.ruff.lint]
select = ["ALL"]
exclude = ["demo"]
ignore = [
"ANN202", # Don't requiere 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", # Suppress module-import-not-at-top-of-file, needed in jupyter notebooks.
"E501", # Suppress line-too-long warnings: trust black's judgement on this one.
"TRY003", # Carl: Ruff wants me to subclass basic exceptions, I don´t agree
"FBT001", # Carl: Users will not want to create Enums just to run the function
"FBT002", # Carl: Users will not want to create Enums just to run the function
"PLR2004", # Allow to compare with unnamed numerical constants.
"SIM118", # Allow "for key in dict.keys()" instead of "for key in dict" (more explicit)
]
[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/*" = [
# asserts are encouraged in pytest
"S101",
# return annotations don't add value for test functions
"ANN201",
# docstrings are overkill for test functions
"D103",
"D100",
]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"