-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpyproject.toml
154 lines (135 loc) · 4.99 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
[project]
name = "iceaddr"
version = "0.5.8"
description = "Look up information about Icelandic street addresses, postcodes, landmarks, locations and placenames"
authors = [
{ name = "Sveinbjorn Thordarson", email = "sveinbjorn@sveinbjorn.org" },
]
readme = { file = "README.md", content-type = "text/markdown" }
license = { file = "LICENSE.txt" }
# For classifier list see: https://pypi.org/pypi?%3Aaction=list_classifiers
classifiers = [
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: Icelandic",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Topic :: Text Processing :: Linguistic",
]
requires-python = ">=3.8"
dependencies = []
[project.urls]
Repository = "https://github.com/sveinbjornt/iceaddr"
[project.optional-dependencies]
# Dev dependencies
dev = [
# Building database
"fiona>=1.9.4", # for processing GIS data
"humanize>=0.5.1", # for progress bar
"reynir>=3.1.0", # for parsing and declining placenames
# Linting, testing
"pytest>=7.2.1",
"pre-commit>=3.3.3",
"black>=23.7.0",
"mypy>=1.5.1",
"types-setuptools>=68.2.0",
"ruff>=0.0.285",
"coverage[toml]>=7.3.1",
"requests>=2.26.0",
]
# *** Configuration of tools ***
[tool.pytest.ini_options]
filterwarnings = [
# Ignore deprecation warnings in libraries, their problem not ours
"ignore::DeprecationWarning",
]
[tool.coverage.run]
branch = true # Enable branch coverage
source = ["src/iceaddr"] # Only test coverage of `iceaddr`
command_line = "-m pytest" # Run all tests when calculating coverage
[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:", "raise NotImplementedError"]
skip_covered = true # Skip showing fully covered files
skip_empty = true # Skip empty files
sort = "-Cover" # Sort by coverage percentage
precision = 2 # Precision of output percentage
fail_under = 65 # Fail if total covered under threshold
[tool.mypy]
overrides = []
[tool.pyright]
typeCheckingMode = "strict"
# The following settings are off by default, even in strict mode
reportCallInDefaultInitializer = "information"
reportImplicitOverride = "information"
reportImplicitStringConcatenation = "information"
reportImportCycles = "warning"
reportMissingSuperCall = "none"
reportPropertyTypeMismatch = "warning"
reportShadowedImports = "warning"
reportUninitializedInstanceVariable = "information"
reportUnnecessaryTypeIgnoreComment = "warning"
reportUnusedCallResult = "none"
[tool.ruff]
# See https://beta.ruff.rs/docs/rules/ for list of rules
# Enable all rules
select = ["ALL"]
# Ignore specific rules
# (we should aim to have these as few as possible)
ignore = [
"D", # Docstring style rules
"ANN", # Missing type annotations
"TD", # Pedantic TODO comment rules
"FIX002", # Line contains TODO rule
"SLOT000", # str subclass should define __slots__
"SIM105", # contextlib.suppress rule
"BLE", # Blind `except:`
"A", # Shadowing of builtins
"ERA", # Commented out code
"FBT", # Forbids boolean positional arguments
"COM", # Commas (sometimes takes issue with black formatting)
"S101", # Disallow assert statements rule
"PLR0912", # "Too many statements" rule
"C90", # Function complexity rules
"UP", # Deprecation rules
"TRY", # Pedantic exception rules
"EM", # Pedantic exception message rules
"TID", # No relative parent imports rule
"TCH", # Move into type checking block - too risky, causes issues
"RSE102", # Bug: https://github.com/astral-sh/ruff/issues/5416
"FA100", #
]
# Silence complaints when black doesn't format
# lines that are slightly over 88 characters long
line-length = 100
[tool.ruff.per-file-ignores]
"./run.py" = ["T201"]
"cli_client/run.py" = ["INP001", "T201", "PLR0915"]
[tool.ruff.isort]
section-order = [
"future",
"typehints",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
[tool.ruff.isort.sections]
# Have typing libraries above other imports
typehints = ["typing", "typing_extensions", "types", "types-setuptools"]
# *** Build system configuration ***
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
iceaddr = ["*.db"]
[build-system]
requires = ["setuptools>=45", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta"