Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ members = [
]

[workspace.package]
version = "2.1.20"
version = "2.1.21"
edition = "2021"
rust-version = "1.75"
license = "MIT OR Apache-2.0"
Expand Down
34 changes: 27 additions & 7 deletions ci/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,23 @@ def run_capture(cmd: list[str]) -> str:
return result.stdout.strip()


def read_project_meta() -> tuple[str, str, str, str]:
"""Return (name, version, summary, requires_python) from pyproject.toml."""
def read_project_meta() -> tuple[str, str, str, str, str]:
"""Return (name, version, summary, requires_python, readme) from pyproject.toml."""
with open(ROOT / "pyproject.toml", "rb") as f:
data = tomllib.load(f)
proj = data["project"]
readme = ""
readme_field = proj.get("readme")
if readme_field:
readme_path = ROOT / (readme_field if isinstance(readme_field, str) else readme_field.get("file", ""))
if readme_path.exists():
readme = readme_path.read_text(encoding="utf-8")
return (
proj["name"],
proj["version"],
proj.get("description", ""),
proj.get("requires-python", ">=3.10"),
readme,
)


Expand Down Expand Up @@ -377,6 +384,7 @@ def build_wheel(
version: str,
summary: str,
requires_python: str,
readme: str,
platform_subdir: str,
plat_tags: list[str],
) -> Path | None:
Expand Down Expand Up @@ -417,6 +425,10 @@ def build_wheel(
f"Summary: {summary}\n"
f"Requires-Python: {requires_python}\n"
)
if readme:
# Per PEP 566: blank line separates headers from the description body,
# and Description-Content-Type declares the rendering format PyPI uses.
metadata += f"Description-Content-Type: text/markdown\n\n{readme}\n"

wheel_meta = (
f"Wheel-Version: 1.0\n"
Expand All @@ -426,8 +438,16 @@ def build_wheel(
for pt in plat_tags:
wheel_meta += f"Tag: {tag_prefix}-{pt}\n"

# S_IFREG is required — pip's wheel installer calls S_ISREG() on the
# upper 16 bits of external_attr and falls back to the umask default
# (0o644) if the file-type bit is missing, regardless of the mode
# bits set. That's how 2.1.20 shipped with mode=0o755 but still
# `/bin/fbuild: Permission denied` on every Linux/macOS install.
# Reference: uv/ruff wheels have external_attr 0x81ed0000
# (S_IFREG | 0o755); 2.1.20 had 0x01ed0000.
exec_perms = (
stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
stat.S_IFREG
| stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
| stat.S_IRGRP | stat.S_IXGRP
| stat.S_IROTH | stat.S_IXOTH
)
Expand Down Expand Up @@ -493,7 +513,7 @@ def add_file(whl: zipfile.ZipFile, arcname: str, data: bytes, executable: bool =
return wheel_path


def build_all_wheels(name: str, version: str, summary: str, requires_python: str) -> list[Path]:
def build_all_wheels(name: str, version: str, summary: str, requires_python: str, readme: str) -> list[Path]:
log(f"\n=== Step 4: Build wheels ({name} {version}) ===")

if WHEEL_DIR.exists():
Expand All @@ -502,7 +522,7 @@ def build_all_wheels(name: str, version: str, summary: str, requires_python: str
wheels: list[Path] = []
missing: list[str] = []
for subdir, plat_tags in PLATFORMS.items():
whl = build_wheel(name, version, summary, requires_python, subdir, plat_tags)
whl = build_wheel(name, version, summary, requires_python, readme, subdir, plat_tags)
if whl:
wheels.append(whl)
else:
Expand Down Expand Up @@ -615,7 +635,7 @@ def main() -> None:
)
args = parser.parse_args()

name, version, summary, requires_python = read_project_meta()
name, version, summary, requires_python, readme = read_project_meta()

if args.upload_only:
log(f"Publishing {name} {version} (upload-only, reusing dist/wheels/)")
Expand Down Expand Up @@ -655,7 +675,7 @@ def main() -> None:
download_artifacts(repo, run_id)

# Step 4: Build platform wheels
wheels = build_all_wheels(name, version, summary, requires_python)
wheels = build_all_wheels(name, version, summary, requires_python, readme)

# Step 5: Upload
if args.dry_run:
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[project]
name = "fbuild"
version = "2.1.20"
version = "2.1.21"
description = "PlatformIO-compatible embedded build tool (Rust implementation)"
readme = "README.md"
requires-python = ">=3.10"
dependencies = ["zccache>=1.2.12"]
dependencies = ["zccache>=1.2.13"]

[dependency-groups]
dev = ["fbuild-dev-tools"]
Expand Down
18 changes: 9 additions & 9 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading