-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
101 lines (90 loc) · 4.67 KB
/
Copy pathpyproject.toml
File metadata and controls
101 lines (90 loc) · 4.67 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
[project]
name = "fbuild"
version = "2.5.3"
description = "PlatformIO-compatible embedded build tool (Rust implementation)"
readme = "README.md"
requires-python = ">=3.10"
# FastLED/fbuild#800: fbuild's daemon hosts an in-process zccache
# service (see `crates/fbuild-build/src/zccache_embedded.rs`). The
# library dep is pinned in `crates/fbuild-build/Cargo.toml`, NOT here
# — fbuild does not declare zccache as a Python distribution dep, and
# the legacy "pinned managed binary download" path was deleted along
# with `MANAGED_ZCCACHE_VERSION`.
dependencies = []
# `fbuild` on PATH is the native cargo-built binary itself, shipped as a
# raw wheel script (setuptools' `scripts=` mechanism in setup.py). No
# Python wrapper sits in front of it — `cmd → fbuild → stdout`. See
# setup.py and #746 for why we don't use `[project.scripts]` (PEP 621
# only supports Python entry points, which on Windows go through an
# `os.execv` emulation that races the next shell prompt ahead of stdout).
[dependency-groups]
# setuptools is in dev (not project deps) because fbuild uses
# no-build-isolation: the build runs in the project venv, so setuptools
# must already be installed when uv tries to (re)build the wheel.
# default-groups below makes uv install dev (and hence setuptools and soldr)
# before attempting to build, breaking the chicken-and-egg.
dev = ["fbuild-dev-tools", "setuptools>=64", "soldr>=0.8.19"]
[tool.uv.sources]
fbuild-dev-tools = { path = "ci/dev-tools", editable = true }
# Skip PEP 517 build isolation for fbuild. Default isolation copies the
# source tree to a temp dir before invoking setup.py, which (a) breaks
# setup.py's mtime-skip cache because the staged binary in `ci/bin/`
# isn't visible from the temp copy, and (b) makes cargo's incremental
# fingerprint cache useless because cwd changes between invocations.
# `extra-build-dependencies` is currently a uv preview feature; it
# triggers an "experimental and may change without warning" notice on
# every invocation, but it works and injects setuptools just for the
# build (no chicken-and-egg with dev dep install order, no runtime
# taint). Suppress the warning by exporting `UV_PREVIEW=1` if desired.
[tool.uv]
no-build-isolation-package = ["fbuild"]
default-groups = ["dev"]
# `no-build-isolation-package` uses the project environment for fbuild's
# setup.py. Inject soldr there as well as declaring it in build-system.requires
# so `uv sync` has the delegated backend available before rebuilding fbuild.
# Tell uv to re-sync the editable install when these change. Without
# this, `uv run` after a .rs edit silently uses a stale _native.pyd
# because uv's default cache-keys only watch pyproject.toml.
cache-keys = [
{ file = "pyproject.toml" },
{ file = "Cargo.toml" },
{ file = "Cargo.lock" },
{ file = "crates/**/*.rs" },
{ file = "crates/**/Cargo.toml" },
]
[tool.uv.extra-build-dependencies]
fbuild = ["setuptools>=64", "soldr>=0.8.19"]
[build-system]
# 0.8.19 is the first soldr release containing delegated PEP 517 hooks.
requires = ["soldr>=0.8.19", "setuptools>=64"]
build-backend = "soldr"
# soldr owns the PEP 517 environment/profile/cache policy, while setuptools
# retains fbuild's native CLI/daemon/PyO3 staging implementation in setup.py.
[tool.soldr.pep517]
delegate-backend = "setuptools.build_meta"
# Local/source installs use soldr's fast dev profile by default. To request a
# release-profile source build through PEP 517, use:
# pip install . --config-settings profile=release
[tool.setuptools]
packages = ["fbuild", "fbuild.api"]
include-package-data = true
# Tell setuptools the package root is `python/` — `python/fbuild/`,
# `python/fbuild/api/`, and any future submodule are discovered relative
# to it. The previous per-package map (`fbuild = "python/fbuild"`,
# `"fbuild.api" = "python/fbuild/api"`) worked for the wheel build but
# confused setuptools' editable install: it emitted a PEP 660 meta-path
# finder whose MAPPING only registered the top-level `fbuild` package,
# so static analyzers (ty, pyright, mypy) saw `Cannot resolve imported
# module 'fbuild.api'` in downstream consumers even though runtime
# imports worked via the finder's PathFinder fallback. With this
# src-layout mapping, setuptools instead emits a plain `.pth` pointing
# at `python/`, which every static analyzer handles.
[tool.setuptools.package-dir]
"" = "python"
# Ship `_native.pyd`/.so that `python/fbuild/__init__.py` imports from.
# The cargo-built `fbuild[.exe]` CLI binary is NOT package data — it is
# declared as a raw wheel script via setup.py's `scripts=` argument so
# pip drops it straight into Scripts/bin as a native exe (no Python
# wrapper). See #746.
[tool.setuptools.package-data]
fbuild = ["_native.pyd", "_native.so"]