From 53271a60fa3ff6e8ed49d3ad024318181a31db2d Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 13 Mar 2026 13:49:24 -0700 Subject: [PATCH] rm python3-dev (#51) --- .gitignore | 1 + build.sh | 2 +- pyproject.toml | 1 - python3-dev/build.sh | 34 ----------------- python3-dev/pyproject.toml | 15 -------- python3-dev/python3_dev/__init__.py | 9 ----- python3-dev/setup.py | 58 ----------------------------- 7 files changed, 2 insertions(+), 118 deletions(-) delete mode 100755 python3-dev/build.sh delete mode 100644 python3-dev/pyproject.toml delete mode 100644 python3-dev/python3_dev/__init__.py delete mode 100644 python3-dev/setup.py diff --git a/.gitignore b/.gitignore index b9dc743..d37dde1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ repo/ .venv/ __pycache__/ +uv.lock # agents .claude/ diff --git a/build.sh b/build.sh index 4d39807..a2825ed 100755 --- a/build.sh +++ b/build.sh @@ -56,7 +56,7 @@ START_SECS=$SECONDS mkdir -p dist/ rm -rf dist/* -uv build --all-packages --wheel --out-dir dist --no-create-gitignore --no-build-logs +uv build --all-packages --wheel --out-dir dist --no-create-gitignore if [[ -n "${BUILD_SH_IN_MANYLINUX:-}" ]]; then VENV_DIR="$ROOT_DIR/.venv-manylinux" diff --git a/pyproject.toml b/pyproject.toml index 21d3486..0738491 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ members = [ "libyuv", "nanosvg", "ncurses", - "python3-dev", "raylib", "zeromq", "zstd", diff --git a/python3-dev/build.sh b/python3-dev/build.sh deleted file mode 100755 index b14c824..0000000 --- a/python3-dev/build.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -set -e - -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" -cd "$DIR" - -VERSION="v3.12.8" -INSTALL_DIR="$DIR/python3_dev/install" - -# Clone/update source -if [ ! -d "python3-src/.git" ]; then - rm -rf python3-src - git clone --depth 1 https://github.com/python/cpython.git python3-src -fi -git -C python3-src fetch --depth 1 origin "$VERSION" -git -C python3-src checkout --force FETCH_HEAD - -cd python3-src - -# Run configure to generate pyconfig.h for this platform -echo "Running configure to generate pyconfig.h ..." -./configure --disable-shared --without-ensurepip > /dev/null 2>&1 - -cd "$DIR" - -# Copy headers -rm -rf "$INSTALL_DIR" -mkdir -p "$INSTALL_DIR/include" - -cp -r python3-src/Include/* "$INSTALL_DIR/include/" -cp python3-src/pyconfig.h "$INSTALL_DIR/include/" - -echo "Installed python3-dev headers to $INSTALL_DIR" -du -sh "$INSTALL_DIR" diff --git a/python3-dev/pyproject.toml b/python3-dev/pyproject.toml deleted file mode 100644 index 72b02ce..0000000 --- a/python3-dev/pyproject.toml +++ /dev/null @@ -1,15 +0,0 @@ -[build-system] -requires = ["setuptools>=64", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "python3-dev" -version = "3.12.8" -description = "CPython development headers" -requires-python = ">=3.8" - -[tool.setuptools.packages.find] -include = ["python3_dev*"] - -[tool.setuptools.package-data] -python3_dev = ["install/**/*"] diff --git a/python3-dev/python3_dev/__init__.py b/python3-dev/python3_dev/__init__.py deleted file mode 100644 index aba381f..0000000 --- a/python3-dev/python3_dev/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -import os - -DIR = os.path.join(os.path.dirname(__file__), "install") -INCLUDE_DIR = os.path.join(DIR, "include") - - -def smoketest(): - assert os.path.isfile(os.path.join(INCLUDE_DIR, "Python.h")), "Python.h not found" - assert os.path.isfile(os.path.join(INCLUDE_DIR, "pyconfig.h")), "pyconfig.h not found" diff --git a/python3-dev/setup.py b/python3-dev/setup.py deleted file mode 100644 index 5ab9da0..0000000 --- a/python3-dev/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -import os -import platform -import subprocess - -from setuptools.command.build_py import build_py - -try: - from wheel.bdist_wheel import bdist_wheel -except ImportError: - bdist_wheel = None - - -class BuildPython3Dev(build_py): - """Run build.sh to download CPython headers before collecting package data.""" - - def run(self): - pkg_dir = os.path.dirname(os.path.abspath(__file__)) - build_script = os.path.join(pkg_dir, "build.sh") - subprocess.check_call(["bash", build_script], cwd=pkg_dir) - - super().run() - - -cmdclass = {"build_py": BuildPython3Dev} - -if bdist_wheel is not None: - - class PlatformWheel(bdist_wheel): - """Produce a platform-specific, Python-version-agnostic wheel.""" - - def finalize_options(self): - super().finalize_options() - self.root_is_pure = False - - def get_tag(self): - system = platform.system() - machine = platform.machine() - - if system == "Linux": - plat = f"linux_{machine}" - elif system == "Darwin": - plat = "macosx_11_0_arm64" - else: - plat = f"{system.lower()}_{machine}" - - return "py3", "none", plat - - cmdclass["bdist_wheel"] = PlatformWheel - - -def setup(): - from setuptools import setup as _setup - - _setup(cmdclass=cmdclass) - - -if __name__ == "__main__": - setup()