11[build-system ]
2- requires = [" setuptools >= 65.0.0 " , " wheel " ]
3- build-backend = " setuptools.build_meta "
2+ requires = [" hatchling " ]
3+ build-backend = " hatchling.build "
44
55[project ]
66name = " firebird-lib"
7- version = " 1.4.0"
87description = " Firebird driver extension library"
9- readme = " README.rst"
8+ dynamic = [" version" ]
9+ readme = " README.md"
1010requires-python = " >=3.8"
1111license = { file = " LICENSE" }
12- authors = [{ name = " Pavel Cisar" , email = " pcisar@users.sourceforge.net" }]
12+ authors = [
13+ { name = " Pavel Cisar" , email = " pcisar@users.sourceforge.net" },
14+ ]
1315keywords = [" Firebird" , " RDBMS" , " driver" , " extension" , " library" ]
1416classifiers = [
1517 " Development Status :: 5 - Production/Stable" ,
@@ -34,9 +36,155 @@ dependencies = [
3436[project .urls ]
3537Home = " https://github.com/FirebirdSQL/python3-lib"
3638Documentation = " https://firebird-lib.rtfd.io"
37- "Bug Reports" = " https://github.com/FirebirdSQL/python3-lib/issues"
38- Funding = " https://www.firebirdsql.org/en/donate/ "
39+ Issues = " https://github.com/FirebirdSQL/python3-lib/issues"
40+ Funding = " https://github.com/sponsors/pcisar "
3941Source = " https://github.com/FirebirdSQL/python3-lib"
4042
41- [tool .setuptools ]
42- zip-safe = true
43+ [tool .hatch .version ]
44+ path = " src/firebird/lib/__about__.py"
45+
46+ [tool .hatch .build ]
47+ packages = [" src/firebird" ]
48+
49+ [tool .hatch .envs .default ]
50+ dependencies = [
51+ ]
52+
53+ [tool .hatch .envs .test ]
54+ dependencies = [
55+ " coverage[toml]>=6.5" ,
56+ " pytest" ,
57+ ]
58+ [tool .hatch .envs .test .scripts ]
59+ test = " pytest {args:tests}"
60+ test-cov = " coverage run -m pytest {args:tests}"
61+ cov-report = [
62+ " - coverage combine" ,
63+ " coverage report" ,
64+ ]
65+ cov = [
66+ " test-cov" ,
67+ " cov-report" ,
68+ ]
69+ version = " python --version"
70+
71+ [[tool .hatch .envs .test .matrix ]]
72+ python = [" 3.8" , " 3.9" , " 3.10" , " 3.11" ]
73+
74+ [tool .hatch .envs .doc ]
75+ detached = false
76+ platforms = [" linux" ]
77+ dependencies = [
78+ " Sphinx>=7.1" ,
79+ " sphinx-bootstrap-theme>=0.8.1" ,
80+ " sphinx-autodoc-typehints>=1.24.0" ,
81+ " doc2dash>=3.0.0"
82+ ]
83+ [tool .hatch .envs .doc .scripts ]
84+ build = " cd docs ; make html"
85+ docset = [
86+ " cd docs ; doc2dash -u https://firebird-lib.readthedocs.io/en/latest/ -f -i ./_static/fb-favicon.png -n firebird-lib ./_build/html/" ,
87+ " cd docs; VERSION=`hatch version` ; tar --exclude='.DS_Store' -cvzf ../dist/firebird-lib-$VERSION-docset.tgz firebird-lib.docset" ,
88+ ]
89+
90+ [tool .hatch .envs .lint ]
91+ detached = true
92+ dependencies = [
93+ " black>=23.1.0" ,
94+ " mypy>=1.0.0" ,
95+ " ruff>=0.0.243" ,
96+ ]
97+ [tool .hatch .envs .lint .scripts ]
98+ typing = " mypy --install-types --non-interactive {args:src/firebird/lib tests}"
99+ style = [
100+ " ruff {args:.}" ,
101+ " black --check --diff {args:.}" ,
102+ ]
103+ fmt = [
104+ " black {args:.}" ,
105+ " ruff --fix {args:.}" ,
106+ " style" ,
107+ ]
108+ all = [
109+ " style" ,
110+ " typing" ,
111+ ]
112+
113+ [tool .black ]
114+ target-version = [" py38" ]
115+ line-length = 120
116+ skip-string-normalization = true
117+
118+ [tool .ruff ]
119+ target-version = " py38"
120+ line-length = 120
121+ select = [
122+ " A" ,
123+ " ARG" ,
124+ " B" ,
125+ " C" ,
126+ " DTZ" ,
127+ " E" ,
128+ " EM" ,
129+ " F" ,
130+ " FBT" ,
131+ " I" ,
132+ " ICN" ,
133+ " ISC" ,
134+ " N" ,
135+ " PLC" ,
136+ " PLE" ,
137+ " PLR" ,
138+ " PLW" ,
139+ " Q" ,
140+ " RUF" ,
141+ " S" ,
142+ " T" ,
143+ " TID" ,
144+ " UP" ,
145+ " W" ,
146+ " YTT" ,
147+ ]
148+ ignore = [
149+ # Allow non-abstract empty methods in abstract base classes
150+ " B027" ,
151+ # Allow boolean positional values in function calls, like `dict.get(... True)`
152+ " FBT003" ,
153+ # Ignore checks for possible passwords
154+ " S105" , " S106" , " S107" ,
155+ # Ignore complexity
156+ " C901" , " PLR0911" , " PLR0912" , " PLR0913" , " PLR0915" ,
157+ ]
158+ unfixable = [
159+ # Don't touch unused imports
160+ " F401" ,
161+ ]
162+
163+ [tool .ruff .isort ]
164+ known-first-party = [" firebird.lib" ]
165+
166+ [tool .ruff .flake8-tidy-imports ]
167+ ban-relative-imports = " all"
168+
169+ [tool .ruff .per-file-ignores ]
170+ # Tests can use magic values, assertions, and relative imports
171+ "tests/**/*" = [" PLR2004" , " S101" , " TID252" ]
172+
173+ [tool .coverage .run ]
174+ source_pkgs = [" firebird.lib" , " tests" ]
175+ branch = true
176+ parallel = true
177+ omit = [
178+ " src/firebird/lib/__about__.py" ,
179+ ]
180+
181+ [tool .coverage .paths ]
182+ firebird_lib = [" src/python" , " */src/firebird/lib" ]
183+ tests = [" tests" , " */python/tests" ]
184+
185+ [tool .coverage .report ]
186+ exclude_lines = [
187+ " no cov" ,
188+ " if __name__ == .__main__.:" ,
189+ " if TYPE_CHECKING:" ,
190+ ]
0 commit comments