-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
120 lines (109 loc) · 4.07 KB
/
pyproject.toml
File metadata and controls
120 lines (109 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
[project]
name = "mpremote-path"
description = "Pathlib compatible interface to files on a MicroPython device"
readme = "README.md"
authors = [{name = "glenn20", email = "6965319+glenn20@users.noreply.github.com"}]
urls = {Homepage = "https://github.com/glenn20/mpremote-path"}
license = {text = "MIT"}
classifiers = [
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Embedded Systems",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
]
requires-python = ">=3.9"
dynamic = ["version"]
dependencies = [
"mpremote >= 1.20, != 1.24.0",
]
[project.scripts]
mpfs = "mpremote_path.util.mpfs:main"
[dependency-groups]
typing = ["mypy>=0.910", "types-pyserial>=3.5", "types-pyyaml>=6.0"]
test = [
{include-group = "typing"},
"ruff>=0.6", "pytest>=8.3", "pytest-cov>=3.0",
"pyyaml>=6.0", "tox>=4.22", "tox-uv>=1.13", "tox_gh>=1.5"
]
dev = [
{include-group = "test"},
"pre-commit>=2.9.2", "pre-commit-uv>=4.0", "pip>=23.0.1", # pre-commit hooks
"hatch>=1.12.0", "hatch-vcs>=0.3.0", # For updating _version.py in post-commit
"git-cliff>=2.0", # For updating changelog
]
[build-system]
requires = ["hatchling>=1.24", "hatch-vcs>=0.3"]
build-backend = "hatchling.build"
[tool.hatch]
build.hooks.vcs.version-file = "src/mpremote_path/_version.py"
version.source = "vcs" # Get the version from git, eg: 0.0.6.dev0+g1234567
# Drop the local version part (eg: +g1234567) or pypi will reject package
version.raw-options.local_scheme = "no-local-version"
# A manually triggered github release workflow may generate a new tag
# with .devN suffix. We need to tell setuptools_scm to ignore past tags with
# this suffix when calculating the version number else it refuses to
# bump the version number.
version.raw-options.git_describe_command = [
"git", "describe", "--dirty", "--tags", "--long",
"--match", "v*.[0-9]",
"--match", "v*.[0-9][0-9]",
"--match", "v*.[0-9][0-9][0-9]",
]
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = ["src", "tests"]
exclude = "(^tests/_data.*$|^tests/unix-micropython/.*$)"
mypy_path = "typings"
python_version = "3.9"
disallow_untyped_defs = true
warn_return_any = true
warn_unused_ignores = false
# https://docs.astral.sh/ruff/configuration/
[tool.ruff]
exclude = ["_version.py", "tests/_data", "tests/unix-micropython"]
lint.extend-select = ["I"] # Enable ruffs isort rules (for compat with vscode ruff)
[tool.coverage]
run.source = ["src", "tests"]
run.omit = ["_version.py"]
report.skip_covered = false
append = true
# For Github Actions workflow - see https://github.com/tox-dev/tox-gh
[tool.tox.gh.python]
"3.13" = ["clean", "typing", "lint", "format", "3.13"]
"3.12" = ["3.12"]
"3.11" = ["3.11"]
"3.10" = ["3.10"]
"3.9" = ["3.9"]
"3.8" = ["3.8"]
# https://tox.wiki/en/latest/config.html#pyproject-toml-native
[tool.tox]
env_list = [
"clean", "typing", "lint", "format",
"3.9", "3.10", "3.11", "3.12", "3.13"
]
labels.static = ["clean", "typing", "lint", "format"]
env.clean.commands = [["coverage", "erase"]] # Cleanup coverage data
env.clean.skip_install = true
env.typing.commands = [["mypy"]]
env.lint.commands = [["ruff", "check"]]
env.format.commands = [["ruff", "format", "--check"]]
# Configure the pytest runs
[tool.tox.env_run_base]
commands = [["pytest", {replace = "posargs", extend = true}]]
dependency_groups = ["test"] # Everything we need to run the tox tests
labels = ["test"]
package = "editable" # "editable" runs a bit faster then "wheel"
runner = "uv-venv-runner" # We love uv
[tool.tox.env.3.13]
# Run coverage tests only on the latest python version
commands = [["pytest", "--cov", {replace = "posargs", extend = true}]]
labels = ["test", "coverage", "latest"]