-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
244 lines (220 loc) · 6.39 KB
/
Copy pathpyproject.toml
File metadata and controls
244 lines (220 loc) · 6.39 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=77", "setuptools-scm>=8"]
[project]
name = "civic-data-boundaries-us-cd118" # PyPI name
dynamic = ["version"] # Using setuptools_scm
description = "US Congressional District 118 boundary layers"
readme = "README.md"
requires-python = ">=3.12"
license = "MIT"
authors = [
{ name="Civic Interconnect", email="info@civic-interconnect.org" }
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: GIS",
"Typing :: Typed",
]
keywords = [
"civic", "gis", "geojson", "boundaries", "congressional districts", "US", "CD118"
]
dependencies = [
"civic-lib-core",
"civic-lib-geo",
"geopandas",
"pandas",
"PyYAML",
"requests",
"typer",
]
[project.optional-dependencies]
dev = [ # Add all to deptry ignores
"pre-commit",
"pytest",
"pytest-cov",
"pytest-env",
"twine",
"validate-pyproject",
]
docs = [ # Add all to deptry ignores
"mike",
"mkdocs",
"mkdocs-gen-files",
"mkdocs-git-revision-date-localized-plugin",
"mkdocs-include-markdown-plugin",
"mkdocs-literate-nav",
"mkdocs-material",
"mkdocs-static-i18n",
"mkdocstrings[python]>=0.18",
"ruff", # required for mkdocstrings
]
[project.urls]
"Data (index.json)" = "https://raw.githubusercontent.com/civic-interconnect/civic-data-boundaries-us-cd118/refs/heads/main/data-out/index.json"
"Data (manifest.json)" = "https://raw.githubusercontent.com/civic-interconnect/civic-data-boundaries-us-cd118/refs/heads/main/data-out/manifest.json"
"Documentation" = "https://civic-interconnect.github.io/civic-data-boundaries-us-cd118/latest"
"Homepage" = "https://github.com/civic-interconnect/civic-data-boundaries-us-cd118"
"Issues" = "https://github.com/civic-interconnect/civic-data-boundaries-us-cd118/issues"
"Source" = "https://github.com/civic-interconnect/civic-data-boundaries-us-cd118"
[project.scripts]
civic-us-cd118 = "civic_data_boundaries_us_cd118.cli.cli:main"
[tool.bandit]
exclude_dirs = ["tests", ".venv"]
skips = ["B101"] # B101: assert statements
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.paths]
source = [
"src/",
"*/site-packages/",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
"# pragma: no cover",
]
fail_under = 25
precision = 1
show_missing = true
skip_covered = false
[tool.coverage.run]
branch = true
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
]
source = ["src"]
[tool.coverage.xml]
output = "coverage.xml"
[tool.deptry]
known_first_party = ["civic_data_boundaries_us_cd118"]
package_module_name_map = {PyYAML = "yaml" }
[tool.deptry.per_rule_ignores]
DEP002 = [
# Dev dependencies
"pre-commit",
"pytest",
"pytest-cov",
"pytest-env",
"twine",
"validate-pyproject",
# Docs dependencies
"mike",
"mkdocs",
"mkdocs-gen-files",
"mkdocs-git-revision-date-localized-plugin",
"mkdocs-include-markdown-plugin",
"mkdocs-literate-nav",
"mkdocs-material",
"mkdocs-static-i18n",
"mkdocstrings",
"ruff",
]
[tool.pyright]
executionEnvironments = [
{root = "src", extraPaths = ["src"]},
{root = "tests", extraPaths = ["src"]},
]
ignore = ["**/__pycache__", "build", "dist", ".venv"]
include = ["src", "tests"]
pythonVersion = "3.12"
reportMissingTypeStubs = "warning"
typeCheckingMode = "basic" # or "strict"
venv = ".venv"
venvPath = "."
[tool.pytest.env]
PYTEST_CURRENT_TEST = "true"
[tool.pytest.ini_options]
addopts = [
"-ra", # show extra test summary info for skipped, failed, etc.
"--strict-markers", # enforce marker usage such as "unit", "integration", etc.
"--cov=src", # measure coverage for files in src
"--cov-report=term-missing", # term-missing:skip-covered is typical
"--cov-report=xml:coverage.xml", # output coverage in XML format
"--cov-report=html:htmlcov", # output coverage in HTML format
"--cov-fail-under=25", # reasonable for types package
"-v", # verbose output
"--tb=short", # short traceback format
]
minversion = "7.0"
python_files = "test_*.py"
pythonpath = ["src"]
testpaths = ["tests"]
[tool.ruff]
exclude = [".venv", ".ruff_cache", "build", "dist", "*.egg-info", ".eggs", "__pycache__", "tests"]
fix = true
line-length = 100
preview = false
target-version = "py312"
unsafe-fixes = false
[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
quote-style = "preserve"
[tool.ruff.lint]
extend-select = [
"F", # Pyflakes rules
"W", # PyCodeStyle warnings
"E", # PyCodeStyle errors
"I", # Sort imports properly
"UP", # Newer Python features
"C4", # Catch incorrect use of comprehensions, dict, list, etc
"C408", # unnecessary comprehension
"D", # Docstring conventions
"Q", # flake8-quotes
"S", # Security issues
"C90", # McCabe complexity
"N", # Naming conventions
"B", # Bugbear
"A", # flake8-annotations
"PTH", # Use pathlib instead of os.path
"RET", # Good return practices
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports for project conventions
"TCH", # flake8-type-checking for type checking imports
]
ignore = [
"E501", # line length handled by formatter
"D203", # 1 blank line before class docstring (conflicts with D211)
"D213", # Multi-line docstring summary should start at the second line
"D413", # Missing blank line after last section
"S101", # assert statements (handled by bandit)
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
[tool.ruff.lint.per-file-ignores]
"src/**/__init__.py" = ["D104"]
"tests/**/*.py" = ["TID251", "TID252", "S101", "D"]
"src/**/_version.py" = ["ALL"]
[tool.setuptools]
include-package-data = true
package-dir = {"" = "src"}
[tool.setuptools.package-data]
"civic_data_boundaries_us_cd118" = ["py.typed"]
[tool.setuptools.packages.find]
namespaces = true
where = ["src"]
[tool.setuptools_scm]
fallback_version = "0.0.1"
local_scheme = "no-local-version"
version_file = "src/civic_data_boundaries_us_cd118/_version.py"
version_scheme = "guess-next-dev"