-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
195 lines (173 loc) · 5.03 KB
/
pyproject.toml
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
[tool.poetry]
name = "ssb-datadoc"
version = "1.0.8"
description = "Document dataset metadata. For use in Statistics Norway's metadata system."
authors = ["Statistics Norway <[email protected]>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/statisticsnorway/datadoc-editor"
repository = "https://github.com/statisticsnorway/datadoc-editor"
documentation = "https://statisticsnorway.github.io/datadoc-editor"
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Dash",
"Typing :: Typed",
]
packages = [{ include = "datadoc", from = "src" }]
[tool.poetry.scripts]
datadoc = 'datadoc.app:main'
[tool.poetry.urls]
Changelog = "https://github.com/statisticsnorway/datadoc-editor/releases"
[tool.poetry.dependencies]
python = ">=3.10,<4.0"
dash = ">=2.15.0"
pydantic = ">=2.5.2"
dash-bootstrap-components = ">=1.1.0"
flask-healthz = ">=0.0.3"
arrow = ">=1.3.0"
python-dotenv = ">=1.0.1"
ssb-dash-components = ">=0.9.1"
dapla-toolbelt-metadata = ">=0.2.6"
gunicorn = ">=23.0.0"
[tool.poetry.group.dev.dependencies]
mypy = ">=0.950"
black = ">=22.3.0"
pytest = ">=7.1.2"
pytest-cov = ">=3.0.0"
nbstripout = ">=0.5.0"
python-kacl = "*"
pre-commit = "*"
pytest-mock = "*"
ruff = ">=0.0.284"
deptry = ">=0.12.0"
pygments = ">=2.10.0"
coverage = { extras = ["toml"], version = ">=6.2" }
furo = ">=2021.11.12"
sphinx = ">=6.2.1"
sphinx-autobuild = ">=2021.3.14"
sphinx-autodoc-typehints = ">=1.24.0"
sphinx-click = ">=3.0.2"
typeguard = ">=2.13.3"
xdoctest = { extras = ["colors"], version = ">=0.15.10" }
myst-parser = { version = ">=0.16.1" }
pandas-stubs = "*"
types-Pygments = "*"
types-colorama = "*"
types-setuptools = "*"
types-beautifulsoup4 = "*"
requests-mock = "*"
faker = "*"
pyarrow-stubs = ">=10.0.1.9"
[tool.pytest.ini_options]
pythonpath = ["src/datadoc"]
[tool.coverage.paths]
source = ["src", "*/site-packages"]
tests = ["tests", "*/tests"]
[tool.coverage.run]
branch = true
source = ["datadoc"]
omit = [
"datadoc/tests/*",
"datadoc/__init__.py",
"datadoc/frontend/callbacks/register.py",
]
relative_files = true
[tool.coverage.report]
show_missing = true
fail_under = 80
[tool.mypy]
plugins = ["pydantic.mypy"]
strict = false
warn_unreachable = true
pretty = true
show_column_numbers = true
show_error_context = true
exclude = ["docs/conf.py", "noxfile.py", "gunicorn.conf.py"]
[[tool.mypy.overrides]]
# Allow missing type hints in third-party libraries without type information.
module = [
"dash.*",
"dash_bootstrap_components",
"ssb_dash_components",
"flask_healthz",
"dapla",
"gcsfs",
"pyarrow",
"pyarrow.parquet",
"dash.development.base_component",
"pytest_mock",
"dash_extensions",
]
ignore_missing_imports = true
# Disable specific error codes in the 'tests' package
# Also don't require type annotations
[[tool.mypy.overrides]]
module = ["tests.*"]
disable_error_code = [
"var-annotated",
"has-type",
"no-any-return",
"no-untyped-def",
]
[tool.ruff]
force-exclude = true # Apply excludes to pre-commit
show-fixes = true
src = ["src", "tests"]
target-version = "py39" # Minimum Python version supported
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
extend-exclude = [
"__pycache__",
"old",
".ipynb_checkpoints",
"noxfile.py",
"docs/conf.py",
]
[tool.ruff.lint]
# Ruff rules may be customized as desired: https://docs.astral.sh/ruff/rules/
select = ["ALL"]
ignore = [
"A003",
"ANN101", # Suppress missing-type-self.
"ANN102", # Suppress missing-type-cls.
"B008",
"D100", # Suppress undocumented-public-module. Only doc of public api required.
"E501", # Let black handle line length
"TRY003",
"FIX002", # It's OK to use TODOs if they meet the requirements
"PLC2401", # Allow non-ASCII character because of norwegian letters
]
[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.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"classmethod",
"validator",
"root_validator",
"pydantic.validator",
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"S101", # asserts are encouraged in pytest
"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
"D103", # docstrings are overkill for test functions
"D100",
]
"*/__init__.py" = ["F401"]
"src/datadoc/frontend/callbacks/register_callbacks.py" = ["C901"]
# This filename is a convention for Gunicorn
"src/datadoc/gunicorn.conf.py" = ["N999"]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"