11[build-system ]
2- requires = [" flit_core >=3.2,<4 " ]
3- build-backend = " flit_core.buildapi "
2+ requires = [" hatchling " ]
3+ build-backend = " hatchling.build "
44
55[project ]
66name = " sqlparse"
@@ -16,8 +16,6 @@ classifiers = [
1616 " Programming Language :: Python" ,
1717 " Programming Language :: Python :: 3" ,
1818 " Programming Language :: Python :: 3 :: Only" ,
19- " Programming Language :: Python :: 3.6" ,
20- " Programming Language :: Python :: 3.7" ,
2119 " Programming Language :: Python :: 3.8" ,
2220 " Programming Language :: Python :: 3.9" ,
2321 " Programming Language :: Python :: 3.10" ,
@@ -28,7 +26,7 @@ classifiers = [
2826 " Topic :: Database" ,
2927 " Topic :: Software Development" ,
3028]
31- requires-python = " >=3.6 "
29+ requires-python = " >=3.8 "
3230
3331[project .urls ]
3432Home = " https://github.com/andialbrecht/sqlparse"
@@ -42,35 +40,63 @@ sqlformat = "sqlparse.__main__:main"
4240
4341[project .optional-dependencies ]
4442dev = [
45- " importlib_metadata<5; python_version <= '3.7'" ,
46- " flake8" ,
43+ " hatch" ,
4744 " build" ,
4845]
49- test = [
50- " pytest" ,
51- " pytest-cov" ,
52- ]
5346doc = [
5447 " sphinx" ,
5548]
56- tox = [
57- " virtualenv<20.22.0" , # 20.22.0 dropped Python 3.6 support
58- " tox<4.5.0" , # >=4.5.0 requires virtualenv>=20.22
49+
50+ [tool .hatch .version ]
51+ path = " sqlparse/__init__.py"
52+
53+ [tool .hatch .envs .default ]
54+ dependencies = [
55+ " coverage[toml]>=6.5" ,
56+ " pytest" ,
57+ # switch to ruff, but fix problems first
58+ # but check defaults!
59+ # https://hatch.pypa.io/1.9/config/static-analysis/#default-settings
60+ " flake8" ,
61+ ]
62+ [tool .hatch .envs .default .scripts ]
63+ test = " pytest {args:tests}"
64+ test-cov = " coverage run -m pytest {args:tests}"
65+ cov-report = [
66+ " - coverage combine" ,
67+ " coverage report" ,
68+ ]
69+ cov = [
70+ " test-cov" ,
71+ " cov-report" ,
5972]
73+ check = " flake8 sqlparse/"
6074
61- [tool .flit .sdist ]
62- include = [
63- " docs/source/" ,
64- " docs/sqlformat.1" ,
65- " docs/Makefile" ,
66- " tests/*.py" , " tests/files/*.sql" ,
67- " LICENSE" ,
68- " TODO" ,
69- " AUTHORS" ,
70- " CHANGELOG" ,
71- " Makefile" ,
72- " tox.ini" ,
75+ [[tool .hatch .envs .all .matrix ]]
76+ python = [" 3.8" , " 3.9" , " 3.10" , " 3.11" , " 3.12" ]
77+
78+ [tool .hatch .envs .types ]
79+ dependencies = [
80+ " mypy>=1.0.0" ,
7381]
82+ [tool .hatch .envs .types .scripts ]
83+ check = " mypy --install-types --non-interactive {args:sqlparse tests}"
7484
7585[tool .coverage .run ]
76- omit = [" sqlparse/__main__.py" ]
86+ source_pkgs = [" sqlparse" , " tests" ]
87+ branch = true
88+ parallel = true
89+ omit = [
90+ " sqlparse/__main__.py" ,
91+ ]
92+
93+ [tool .coverage .paths ]
94+ sqlparse = [" sqlparse" ]
95+ tests = [" tests" ]
96+
97+ [tool .coverage .report ]
98+ exclude_lines = [
99+ " no cov" ,
100+ " if __name__ == .__main__.:" ,
101+ " if TYPE_CHECKING:" ,
102+ ]
0 commit comments