rm python3-dev (#51)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,6 +2,7 @@
|
|||||||
repo/
|
repo/
|
||||||
.venv/
|
.venv/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
uv.lock
|
||||||
|
|
||||||
# agents
|
# agents
|
||||||
.claude/
|
.claude/
|
||||||
|
|||||||
2
build.sh
2
build.sh
@@ -56,7 +56,7 @@ START_SECS=$SECONDS
|
|||||||
|
|
||||||
mkdir -p dist/
|
mkdir -p dist/
|
||||||
rm -rf 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
|
if [[ -n "${BUILD_SH_IN_MANYLINUX:-}" ]]; then
|
||||||
VENV_DIR="$ROOT_DIR/.venv-manylinux"
|
VENV_DIR="$ROOT_DIR/.venv-manylinux"
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ members = [
|
|||||||
"libyuv",
|
"libyuv",
|
||||||
"nanosvg",
|
"nanosvg",
|
||||||
"ncurses",
|
"ncurses",
|
||||||
"python3-dev",
|
|
||||||
"raylib",
|
"raylib",
|
||||||
"zeromq",
|
"zeromq",
|
||||||
"zstd",
|
"zstd",
|
||||||
|
|||||||
@@ -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"
|
|
||||||
@@ -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/**/*"]
|
|
||||||
@@ -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"
|
|
||||||
@@ -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()
|
|
||||||
Reference in New Issue
Block a user