Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
147 lines (135 loc) · 6.48 KB
/
Copy pathpyproject.toml
File metadata and controls
147 lines (135 loc) · 6.48 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
[build-system]
requires = ["scikit-build-core>=0.11", "pybind11>=3.0,<4", "setuptools-scm>=8"]
build-backend = "scikit_build_core.build"
[project]
name = "espp"
dynamic = ["version"]
description = "Python bindings for the cross-platform components of espp (ESP-CPP): tasks, timers, sockets, RTSP, RTPS, CDR, COBS, serialization, math, and more"
readme = "lib/README_PYPI.md"
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "William Emfinger", email = "waemfinger@gmail.com" }]
requires-python = ">=3.10"
keywords = ["espp", "esp-cpp", "embedded", "rtsp", "rtps", "cdr", "cobs", "sockets", "odrive"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: C++",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Embedded Systems",
"Topic :: Software Development :: Libraries",
]
[project.urls]
Homepage = "https://github.com/esp-cpp/espp"
Documentation = "https://esp-cpp.github.io/espp/"
Repository = "https://github.com/esp-cpp/espp"
Issues = "https://github.com/esp-cpp/espp/issues"
[project.optional-dependencies]
# espp_odrive's serial transport imports pyserial lazily; everything else in
# the shipped packages is stdlib-only. `pip install espp[serial]` enables the
# espp_odrive serial/UART transports.
serial = ["pyserial"]
# espp_ota's / espp_coredump's USB transport imports pyusb lazily; the frame
# codec + protocols are stdlib-only. `pip install espp[usb]` enables the
# OTA-over-USB and core-dump-over-USB host tools.
usb = ["pyusb"]
# `rich` is optional — it gives the nicer progress bar / colorized output (it also
# ships in the ESP-IDF Python env, so `idf.py ota-usb` already has it); the tool
# degrades to plain text without it. `pip install espp[usb-ui]` adds it.
usb-ui = ["pyusb", "rich"]
[project.scripts]
# Standalone CLI (also runnable as `python -m espp_ota`). The `ota` component's
# CMake integration wires `idf.py ota-usb` to the same tool for a build->OTA flow.
espp-ota = "espp_ota.cli:main"
# Core dump over USB (also `python -m espp_coredump`). The `coredump` component's
# CMake integration wires `idf.py coredump-usb` to it for a build->download->decode flow.
espp-coredump = "espp_coredump.cli:main"
[project.entry-points.idf_extension]
# idf.py (ESP-IDF >= 6.0; 5.x has no entry-point loading) loads `idf_extension`
# entry points from whatever is installed in its
# Python environment: with the espp wheel installed, both `idf.py coredump-usb`
# (with --gdb / --summary / --out / --vid ...) and `idf.py ota-usb` (with
# --no-verify / --status / --mark-valid / --rollback / --vid ...) exist in every
# project, without the trusted-source check that ESP-IDF 6.0.2+ applies to a
# component's own idf_ext.py.
espp_coredump_ext = "espp_coredump.idf_ext:action_extensions"
espp_ota_ext = "espp_ota.idf_ext:action_extensions"
[tool.scikit-build]
# The CMake project for the host (PC) build lives in lib/; the repo root is the
# project root so the sdist can include the components/ sources it references.
cmake.source-dir = "lib"
# Pure-python part of the package (espp/__init__.py, __init__.pyi, py.typed);
# the compiled espp._espp extension is installed into it by CMake. The wheel
# ALSO ships `espp_odrive`, the pure-python ODrive legacy-native protocol
# client whose single source of truth lives in the odrive_native component --
# stdlib-only except a lazily-imported pyserial (see the `serial` extra).
wheel.packages = [
"lib/python_bindings/espp",
"components/odrive_native/python/espp_odrive",
# espp_ota: pure-python OTA-over-USB host tool (stdlib-only except a
# lazily-imported pyusb; see the `usb` extra). Single source of truth lives in
# the ota component.
"components/ota/python/espp_ota",
# espp_coredump: pure-python core-dump-over-USB host tool (same framing +
# transport as espp_ota; stdlib-only except a lazily-imported pyusb, and the
# optional esp-coredump decoder). Single source of truth lives in the coredump
# component.
"components/coredump/python/espp_coredump",
]
wheel.exclude = ["**/.mypy_cache", "**/__pycache__"]
# Persistent CMake build dir (gitignored) so repeated local builds - notably
# re-running `pip install -e .` after a C++ change - are incremental.
build-dir = "build/{wheel_tag}"
sdist.exclude = [
".github/",
"doc/",
"docs/",
"pc/",
# anchored to the repo root: components/odrive_native/python/ (the shipped
# espp_odrive package) must stay IN the sdist
"/python/",
# local build helpers / outputs (install/, build/, _build/ already gitignored)
"*.sh",
"*.ps1",
# embedded-only submodules and components not referenced by lib/espp.cmake
"components/littlefs/",
"components/lvgl/",
"components/esp-dsp/",
"components/esp-nimble-cpp/",
"components/binary-log/",
"components/gfps_service/",
# examples are not needed to build the bindings
"components/*/example/",
# trim the bulk of the vendored fmt repo (only include/ is used)
"components/format/detail/fmt/doc/",
"components/format/detail/fmt/test/",
]
# Derive the version from git tags of the form vX.Y.Z (e.g. v1.1.4) via
# setuptools-scm.
[[tool.dynamic-metadata]]
provider = "scikit_build_core.metadata.setuptools_scm"
[tool.setuptools_scm]
[tool.cibuildwheel]
build = ["cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
skip = ["*-musllinux_*", "*_i686", "*-win32"]
# Smoke-test the wheel: import + assert the RTPS RMI/AMI binding surface is
# exposed (a functional in-process round-trip needs multicast, so it lives in the
# dockerised interop harness / python/rtps_rpc_demo.py, not here), and run the
# self-contained stream_frame / Dispatcher binding test.
test-command = "python \"{project}/python/rtps_bindings_smoke.py\" && python \"{project}/python/dispatcher_test.py\""
[tool.cibuildwheel.linux]
# The repo is mounted at /project inside the manylinux container; git must
# trust it for setuptools-scm to read the version from the repo.
before-all = "git config --global --add safe.directory /project"
[tool.cibuildwheel.macos]
# Build fat wheels covering both apple silicon and intel from the single
# arm64 runner (GitHub retired the intel macos-13 runners). The arm64 slice
# is tested natively; the x86_64 slice runs under Rosetta where available.
archs = ["universal2"]
[tool.cibuildwheel.macos.environment]
# espp uses std::filesystem (and other C++20 features) which require a newer
# deployment target than cibuildwheel's default (10.13)
MACOSX_DEPLOYMENT_TARGET = "11.0"