|
1 | 1 | [build-system] |
2 | | -requires = ["setuptools >= 65.0.0","wheel"] |
3 | | -build-backend = "setuptools.build_meta" |
| 2 | +requires = ["hatchling"] |
| 3 | +build-backend = "hatchling.build" |
4 | 4 |
|
5 | 5 | [project] |
6 | 6 | name = "firebird-driver" |
7 | 7 | description = "Firebird driver for Python" |
8 | | -readme = "README.rst" |
| 8 | +dynamic = ["version"] |
| 9 | +readme = "README.md" |
9 | 10 | requires-python = ">=3.8" |
10 | 11 | license = { file = "LICENSE" } |
11 | | -authors = [{ name = "Pavel Cisar", email = "pcisar@users.sourceforge.net"}] |
| 12 | +authors = [ |
| 13 | + { name = "Pavel Cisar", email = "pcisar@users.sourceforge.net"}, |
| 14 | +] |
12 | 15 | keywords = ["Firebird", "RDBMS", "driver"] |
13 | 16 | classifiers = [ |
14 | | - "Development Status :: 5 - Production/Stable", |
15 | | - "Intended Audience :: Developers", |
16 | | - "License :: OSI Approved :: MIT License", |
17 | | - "Programming Language :: Python :: 3 :: Only", |
18 | | - "Programming Language :: Python :: 3.8", |
19 | | - "Programming Language :: Python :: 3.9", |
20 | | - "Programming Language :: Python :: 3.10", |
21 | | - "Programming Language :: Python :: 3.11", |
22 | | - "Operating System :: POSIX :: Linux", |
23 | | - "Operating System :: Microsoft :: Windows", |
24 | | - "Operating System :: MacOS", |
25 | | - "Topic :: Software Development", |
26 | | - "Topic :: Database", |
27 | | - ] |
| 17 | + "Development Status :: 5 - Production/Stable", |
| 18 | + "Intended Audience :: Developers", |
| 19 | + "License :: OSI Approved :: MIT License", |
| 20 | + "Programming Language :: Python :: 3 :: Only", |
| 21 | + "Programming Language :: Python :: 3.8", |
| 22 | + "Programming Language :: Python :: 3.9", |
| 23 | + "Programming Language :: Python :: 3.10", |
| 24 | + "Programming Language :: Python :: 3.11", |
| 25 | + "Operating System :: POSIX :: Linux", |
| 26 | + "Operating System :: Microsoft :: Windows", |
| 27 | + "Operating System :: MacOS", |
| 28 | + "Topic :: Software Development", |
| 29 | + "Topic :: Database", |
| 30 | +] |
28 | 31 | dependencies = [ |
29 | | - "firebird-base>=1.5.0", |
30 | | - "python-dateutil>=2.8", |
31 | | - ] |
32 | | -dynamic = ["version"] |
| 32 | + "firebird-base>=1.6.1", |
| 33 | + "python-dateutil>=2.8", |
| 34 | +] |
33 | 35 |
|
34 | 36 | [project.urls] |
35 | 37 | Home = "https://github.com/FirebirdSQL/python3-driver" |
36 | 38 | Documentation = "https://firebird-driver.rtfd.io" |
37 | | -"Bug Reports" = "https://github.com/FirebirdSQL/python3-driver/issues" |
38 | | -Funding = "https://www.firebirdsql.org/en/donate/" |
| 39 | +Issues = "https://github.com/FirebirdSQL/python3-driver/issues" |
| 40 | +Funding = "https://github.com/sponsors/pcisar" |
39 | 41 | Source = "https://github.com/FirebirdSQL/python3-driver" |
40 | 42 |
|
41 | | -[tool.setuptools] |
42 | | -zip-safe = true |
| 43 | +[tool.hatch.version] |
| 44 | +path = "src/firebird/driver/__init__.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-driver.readthedocs.io/en/latest/ -f -i ./_static/fb-favicon.png -n firebird-driver ./_build/html/", |
| 87 | + "cd docs; VERSION=`hatch version` ; tar --exclude='.DS_Store' -cvzf ../dist/firebird-driver-$VERSION-docset.tgz firebird-driver.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/driver 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.driver"] |
| 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.driver", "tests"] |
| 175 | +branch = true |
| 176 | +parallel = true |
| 177 | +omit = [ |
| 178 | + "src/firebird/driver/__about__.py", |
| 179 | +] |
| 180 | + |
| 181 | +[tool.coverage.paths] |
| 182 | +firebird_driver = ["src/python", "*/python/src/firebird/driver"] |
| 183 | +tests = ["tests", "*/python/tests"] |
43 | 184 |
|
44 | | -[tool.setuptools.dynamic] |
45 | | -version = {attr = "firebird.driver.__VERSION__"} |
| 185 | +[tool.coverage.report] |
| 186 | +exclude_lines = [ |
| 187 | + "no cov", |
| 188 | + "if __name__ == .__main__.:", |
| 189 | + "if TYPE_CHECKING:", |
| 190 | +] |
0 commit comments