11[build-system ]
2- requires = [" setuptools>=42" , " wheel" ]
3- build-backend = " setuptools.build_meta"
2+ requires = [" hatchling" ]
3+ build-backend = " hatchling.build"
4+
5+ [project ]
6+ name = " test-a-ble"
7+ version = " 0.1.0"
8+ description = " Framework for testing BLE IoT devices"
9+ authors = [
10+ {
name =
" Nick Brook" ,
email =
" [email protected] " }
11+ ]
12+ readme = " README.md"
13+ requires-python = " >=3.12"
14+ classifiers = [
15+ " Development Status :: 3 - Alpha" ,
16+ " Intended Audience :: Developers" ,
17+ " License :: OSI Approved :: MIT License" ,
18+ " Programming Language :: Python :: 3" ,
19+ " Programming Language :: Python :: 3.12" ,
20+ " Programming Language :: Python :: 3.13" ,
21+ " Topic :: Software Development :: Testing" ,
22+ " Topic :: System :: Hardware" ,
23+ ]
24+ keywords = [" bluetooth" , " ble" , " iot" , " testing" , " automation" ]
25+ dependencies = [
26+ " bleak>=0.22.3" ,
27+ " rich>=13.9.4" ,
28+ " packaging" ,
29+ " prompt_toolkit>=3.0.0" ,
30+ ]
31+
32+ [project .scripts ]
33+ test-a-ble = " test_a_ble.cli:main"
34+
35+ [dependency-groups ]
36+ test = [
37+ " pytest>=8.3.5" ,
38+ " pytest-cov>=6.0.0" ,
39+ " pytest-asyncio>=0.22.0" ,
40+ " tox>=4.24.2" ,
41+ " tox-uv>=1.25.0" ,
42+ ]
43+ lint = [
44+ " black>=25.1.0" ,
45+ " isort>=6.0.1" ,
46+ " flake8>=7.1.2" ,
47+ " flake8-docstrings>=1.7.0" ,
48+ " flake8-pyproject>=1.2.3" ,
49+ ]
50+ type = [
51+ " mypy>=1.15.0" ,
52+ ]
53+ check = [
54+ {include-group = " test" },
55+ {include-group = " lint" },
56+ {include-group = " type" },
57+ ]
58+ security = [
59+ " bandit>=1.8.3" ,
60+ " safety>=3.3.1" ,
61+ ]
62+ docs = [
63+ " sphinx>=8.2.3" ,
64+ " sphinx-rtd-theme>=3.0.2" ,
65+ " myst-parser>=4.0.1" ,
66+ ]
67+ dev = [
68+ " pre-commit>=4.1.0" ,
69+ {include-group = " check" },
70+ {include-group = " security" },
71+ {include-group = " docs" },
72+ ]
73+
74+ # Formatting and linting
475
576[tool .black ]
677line-length = 120
@@ -16,7 +87,10 @@ exclude = [
1687 # No need to traverse our git directory
1788 " .git" ,
1889 # There's no value in checking cache directories
19- " __pycache__"
90+ " __pycache__" ,
91+ " *.pyc" ,
92+ " .venv" ,
93+ " .tox" ,
2094]
2195# Use extend-ignore to add to already ignored checks which are anti-patterns like W503.
2296extend-ignore = [
@@ -30,6 +104,9 @@ extend-ignore = [
30104 " D202"
31105]
32106
107+ [tool .mypy ]
108+ files = [" test_a_ble" , " docs" , " tests" ]
109+
33110[tool .pytest .ini_options ]
34111testpaths = [" tests" ]
35112python_files = " test_*.py"
@@ -40,42 +117,44 @@ python_classes = "Test[A-Z][a-zA-Z0-9]*(?<!Context|Status|Exception|Failure|Skip
40117norecursedirs = [" examples" ," test_discovery_test_package" ]
41118
42119[tool .bandit ]
43- exclude_dirs = [" .tox" ]
120+ exclude_dirs = [" .tox" , " .venv " ]
44121skips = [" B101" , " B404" , " B607" ]
45122
123+ # Tox
124+
46125[tool .tox ]
47126min_version = " 4.0"
48- env_list = [" py312" , " py313" ]
127+ env_list = [" py312" , " py313" , " lint " , " type " ]
49128isolated_build = true
50129skip_missing_interpreters = false
51- requires = [" virtualenv>=20.0.0" ]
52130
53- [tool .tox .env .default ]
54- deps = [" .[lint,test]" ]
55- commands = [
56- " black --check ." ,
57- " isort --check ." ,
58- " flake8 ." ,
59- " pytest {posargs:tests}" ,
60- ]
131+ [tool .tox .env_run_base ]
132+ runner = " uv-venv-lock-runner"
133+ description = " Run test under {base_python}"
134+ dependency_groups = [" test" ]
135+ commands = [[" pytest" ]]
61136
62137[tool .tox .env .lint ]
63- deps = [" .[lint]" ]
138+ runner = " uv-venv-lock-runner"
139+ description = " format code"
140+ dependency_groups = [" lint" ]
64141commands = [
65- " black --check . " ,
66- " isort --check . " ,
67- " flake8 . " ,
142+ [ " black" , " --check" , " . " ] ,
143+ [ " isort" , " --check" , " . " ] ,
144+ [ " flake8" , " . " ] ,
68145]
69146
70147[tool .tox .env .format ]
71- deps = [" .[lint]" ]
148+ runner = " uv-venv-lock-runner"
149+ description = " format code"
150+ dependency_groups = [" lint" ]
72151commands = [
73- " black . " ,
74- " isort . " ,
152+ [ " black" , " . " ] ,
153+ [ " isort" , " . " ] ,
75154]
76155
77- [tool .tox .env .py312 ]
78- base_python = [ " python3.12 " ]
79-
80- [ tool . tox . env . py313 ]
81- base_python = [" python3.13 " ]
156+ [tool .tox .env .type ]
157+ runner = " uv-venv-lock-runner "
158+ description = " type check code "
159+ dependency_groups = [ " type " ]
160+ commands = [[ " mypy " ] ]
0 commit comments