1
- [build-system ]
2
- requires = [" hatchling" , " hatch-vcs" ]
3
- build-backend = " hatchling.build"
4
-
5
1
[project ]
6
2
name = " mp-image-tool-esp32"
7
3
description = " Tool for manipulating micropython ESP32 firmware files"
@@ -18,7 +14,6 @@ classifiers = [
18
14
requires-python = " >=3.8"
19
15
dependencies = [
20
16
" esptool>=4.6.2" ,
21
- " littlefs-python>=0.12.0" ,
22
17
" rich>=10.12.0" ,
23
18
" more-itertools>=8.8.0" ,
24
19
" typing-extensions>=4.12" ,
@@ -28,10 +23,34 @@ dynamic = ["version"]
28
23
[project .scripts ] # The entry points for the command line tools
29
24
mp-image-tool-esp32 = " mp_image_tool_esp32.main:main"
30
25
26
+ [project .optional-dependencies ]
27
+ littlefs = [" littlefs-python>=0.12.0" ]
28
+
29
+ [dependency-groups ]
30
+ typing = [" mypy>=0.910" , " types-requests>=2.32.0.20240914" , " types-pyserial>=3.5" ]
31
+ test = [
32
+ {include-group = " typing" },
33
+ " ruff>=0.6.7" , " pytest>=8.3.2" , " pytest-cov>=3.0.0" , " requests>=2.32.3" ,
34
+ " pyyaml>=6.0.2" , " tox>=4.22.0" , " tox-uv>=0.3.0" ,
35
+ ]
36
+ dev = [
37
+ {include-group = " test" },
38
+ " keyring>=25" , # For uv publish --keyring-provider=subprocess
39
+ # Used by .git/hooks/post-{commit,checkout} to update _version.py:
40
+ # uv run --frozen hatch build --hooks-only
41
+ " hatch>=1.12.0" ,
42
+ " hatch-vcs>=0.3.0" , # For building and updating _version.py
43
+ ]
44
+
45
+ [build-system ]
46
+ requires = [" hatchling" , " hatch-vcs" ]
47
+ build-backend = " hatchling.build"
48
+
49
+ # Build python packages and update version number
31
50
[tool .hatch ]
32
- build.hooks.vcs.version-file = " src/mp_image_tool_esp32/_version.py"
33
51
build.targets.wheel.packages = [" src/mp_image_tool_esp32" ]
34
52
version.source = " vcs" # Get the version from git, eg: 0.0.6.dev0+g1234567
53
+ build.hooks.vcs.version-file = " src/mp_image_tool_esp32/_version.py"
35
54
# Drop the local version part (eg: +g1234567) or pypi will reject package
36
55
version.raw-options.local_scheme = " no-local-version"
37
56
# A manually triggered github release workflow may generate a new tag
@@ -45,45 +64,25 @@ version.raw-options.git_describe_command = [
45
64
" --match" , " v*.[0-9][0-9][0-9]" ,
46
65
]
47
66
48
- [tool .uv ]
49
- dev-dependencies = [
50
- # For running tests: pytest, pyyaml, requests, tox, mypy, ruff
51
- " pytest>=8.3.2" ,
52
- " pyyaml>=6.0.2" ,
53
- " requests>=2.32.3" ,
54
- " tox>=4.0.0" ,
55
- " tox-uv>=0.3.0" , # uv support for tox
56
- " pytest-cov>=3.0.0" ,
57
- " mypy>=0.910" , # For code type checks: uv run mypy --no-sources mypy src
58
- " types-requests>=2.32.0.20240914" ,
59
- " types-pyserial>=3.5" ,
60
- " ruff>=0.6.7" , # For linting: uv run --no-sources ruff format --check src
61
- " keyring>=25" , # For uv publish --keyring-provider=subprocess
62
- # Used by .git/hooks/post-{commit,checkout} to update _version.py:
63
- # uv run --frozen hatch build --hooks-only
64
- " hatch>=1.12.0" ,
65
- " hatch-vcs>=0.3.0" , # For building and updating _version.py
66
- ]
67
-
68
67
# https://tox.wiki/en/latest/config.html#pyproject-toml-native
69
- [tool .tox ] #
68
+ [tool .tox ]
69
+ requires = [" tox>=4.22" , " tox-uv>=1.13" ]
70
70
env_list = [
71
- " clean" , " mypy " , " lint" , " format" ,
71
+ " clean" , " typing " , " lint" , " format" ,
72
72
" 3.8" , " 3.9" , " 3.10" , " 3.11" , " 3.12" , " 3.13"
73
73
]
74
- requires = [" tox>=4.19" , " tox-uv>=1.13" ]
75
74
env.clean.commands = [[" coverage" , " erase" ]] # Cleanup coverage data
76
- env.clean.deps = [" coverage" ]
77
75
env.clean.skip_install = true
78
- env.mypy.commands = [[" mypy" ]]
79
- env.mypy.deps = [" mypy" , " pytest" , " types-requests" , " types-pyserial" ]
76
+ env.typing.commands = [[" mypy" ]]
80
77
env.lint.commands = [[" ruff" , " check" ]]
81
- env.lint.deps = [" ruff" ]
82
78
env.format.commands = [[" ruff" , " format" , " --check" ]]
83
- env.format.deps = [" ruff" ]
79
+ env.3.8.commands = [[" pytest" , " --cov=mp_image_tool_esp32" ]]
80
+ env.3.13.commands = [[" pytest" , " --cov=mp_image_tool_esp32" ]]
84
81
env_run_base.commands = [[" pytest" ]]
85
- env_run_base.deps = [" pytest" , " pytest-cov" , " requests" , " pyyaml" ]
86
- env_run_base.package = " editable"
82
+ env_run_base.dependency_groups = [" test" ]
83
+ env_run_base.extras = [" littlefs" ] # Include optional dependencies
84
+ env_run_base.package = " wheel" # Build package wheel and install into environments
85
+ env_run_base.wheel_build_env = " .pkg" # Re-use one wheel for each environment
87
86
88
87
[tool .mypy ]
89
88
files = [" src" ]
@@ -98,12 +97,7 @@ include = ["src/**/*.py"]
98
97
exclude = [" _version.py" ]
99
98
lint.extend-select = [" I" ] # Enable ruffs isort rules (for compat with vscode ruff)
100
99
101
- [tool .pytest .ini_options ]
102
- minversion = " 6.0"
103
- addopts = [" --cov" ]
104
-
105
100
[tool .coverage ]
106
- run.source = [" src" ]
107
101
run.omit = [" _version.py" ]
108
102
report.skip_covered = true
109
103
append = true
0 commit comments