Skip to content

Commit 337667f

Browse files
committed
lets go
1 parent 32ecd35 commit 337667f

File tree

4 files changed

+73
-17
lines changed

4 files changed

+73
-17
lines changed

.github/workflows/_build_linux.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
description: 'Python versions to build for'
88
required: false
99
type: string
10-
default: '["3.9", "3.10", "3.11", "3.12"]'
10+
default: '["3.10", "3.11", "3.12"]'
1111

1212
jobs:
1313
build-linux:
@@ -43,7 +43,7 @@ jobs:
4343
uses: pypa/cibuildwheel@v2.22.0
4444
env:
4545
# Build for specified Python versions
46-
CIBW_BUILD: cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64
46+
CIBW_BUILD: cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64
4747
# Vendor build happens inside manylinux container via before-build (from pyproject.toml)
4848

4949
# Save vendor cache after build
@@ -54,6 +54,15 @@ jobs:
5454
path: vendor
5555
key: vendor-linux-manylinux-${{ hashFiles('scripts/linux/setup_vendors.sh') }}-v9
5656

57+
# Setup Python versions for testing
58+
- name: Setup Python versions
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: |
62+
3.10
63+
3.11
64+
3.12
65+
5766
# Test the built wheels
5867
- name: Test wheels
5968
run: |
@@ -69,12 +78,27 @@ jobs:
6978
7079
echo "Setting up Python $python_version..."
7180
72-
# Use the appropriate Python version
73-
python_cmd="python${python_version}"
74-
if ! command -v "$python_cmd" &> /dev/null; then
81+
# Try to find the matching Python version
82+
python_cmd=""
83+
for cmd in "python${python_version}" "python3.${python_version#*.}" "python3"; do
84+
if command -v "$cmd" &> /dev/null; then
85+
# Verify this is the right version
86+
version_check=$($cmd --version 2>&1 | grep -oE '[0-9]+\.[0-9]+' | head -1)
87+
if [ "$version_check" = "$python_version" ]; then
88+
python_cmd="$cmd"
89+
break
90+
fi
91+
fi
92+
done
93+
94+
# Fall back to python3 if we couldn't find exact match
95+
if [ -z "$python_cmd" ]; then
96+
echo "WARNING: Python $python_version not found, using python3"
7597
python_cmd="python3"
7698
fi
7799
100+
echo "Using Python: $($python_cmd --version)"
101+
78102
# Install the wheel in a fresh environment
79103
"$python_cmd" -m pip install --force-reinstall "$wheel"
80104

.github/workflows/_build_macos.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
description: 'Python versions to build for'
88
required: false
99
type: string
10-
default: '["3.9", "3.10", "3.11", "3.12"]'
10+
default: '["3.10", "3.11", "3.12"]'
1111

1212
jobs:
1313
build-macos:
@@ -86,10 +86,19 @@ jobs:
8686
# Skip before-build since we already built vendors
8787
CIBW_BEFORE_BUILD: ""
8888
# Build for specified Python versions (universal2 for both Intel and Apple Silicon)
89-
CIBW_BUILD: cp39-macosx_* cp310-macosx_* cp311-macosx_* cp312-macosx_*
89+
CIBW_BUILD: cp310-macosx_* cp311-macosx_* cp312-macosx_*
9090
# Use delocate to bundle dependencies
9191
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel} --ignore-missing-dependencies"
9292

93+
# Setup Python versions for testing
94+
- name: Setup Python versions
95+
uses: actions/setup-python@v5
96+
with:
97+
python-version: |
98+
3.10
99+
3.11
100+
3.12
101+
93102
# Test the built wheels
94103
- name: Test wheels
95104
run: |

.github/workflows/_build_windows.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
description: 'Python versions to build for'
88
required: false
99
type: string
10-
default: '["3.9", "3.10", "3.11", "3.12"]'
10+
default: '["3.10", "3.11", "3.12"]'
1111

1212
jobs:
1313
build-windows:
@@ -96,7 +96,16 @@ jobs:
9696
# Skip before-build since we already built vendors
9797
CIBW_BEFORE_BUILD: ""
9898
# Build for specified Python versions
99-
CIBW_BUILD: cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64
99+
CIBW_BUILD: cp310-win_amd64 cp311-win_amd64 cp312-win_amd64
100+
101+
# Setup Python versions for testing
102+
- name: Setup Python versions
103+
uses: actions/setup-python@v5
104+
with:
105+
python-version: |
106+
3.10
107+
3.11
108+
3.12
100109
101110
# Test the built wheels
102111
- name: Test wheels
@@ -113,13 +122,29 @@ jobs:
113122
114123
echo "Setting up Python $python_version..."
115124
125+
# On Windows, use py launcher with minor version only
126+
# Extract minor version (e.g., "3.10" -> "10")
127+
minor_version="${python_version#*.}"
128+
129+
# Try py launcher first, then fall back to python
130+
if py -3.$minor_version --version &> /dev/null; then
131+
python_cmd="py -3.$minor_version"
132+
elif python --version 2>&1 | grep -q "Python $python_version"; then
133+
python_cmd="python"
134+
else
135+
echo "WARNING: Python $python_version not found, using default python"
136+
python_cmd="python"
137+
fi
138+
139+
echo "Using Python: $($python_cmd --version)"
140+
116141
# Install the wheel in a fresh environment
117-
python -m pip install --force-reinstall "$wheel"
142+
$python_cmd -m pip install --force-reinstall "$wheel"
118143
119144
# Run the test script
120145
echo ""
121146
echo "Running tests..."
122-
python scripts/test_local_build.py
147+
$python_cmd scripts/test_local_build.py
123148
124149
# Check exit code
125150
if [ $? -eq 0 ]; then

pyproject.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "httpmorph"
77
version = "0.1.0"
88
description = "Morph into any browser - High-performance HTTP client with dynamic fingerprinting using C, io_uring, and BoringSSL"
99
readme = "README.md"
10-
requires-python = ">=3.8"
10+
requires-python = ">=3.10"
1111
license = {text = "MIT"}
1212
authors = [
1313
{name = "Arman", email = "arman@bytetunnels.com"}
@@ -18,8 +18,6 @@ classifiers = [
1818
"Intended Audience :: Developers",
1919
"License :: OSI Approved :: MIT License",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.8",
22-
"Programming Language :: Python :: 3.9",
2321
"Programming Language :: Python :: 3.10",
2422
"Programming Language :: Python :: 3.11",
2523
"Programming Language :: Python :: 3.12",
@@ -71,7 +69,7 @@ httpmorph = ["*.pyx", "*.pxd", "*.c", "*.h"]
7169

7270
[tool.ruff]
7371
line-length = 100
74-
target-version = "py38"
72+
target-version = "py310"
7573
fix = true
7674

7775
[tool.ruff.lint]
@@ -97,7 +95,7 @@ skip-magic-trailing-comma = false
9795
line-ending = "auto"
9896

9997
[tool.mypy]
100-
python_version = "3.8"
98+
python_version = "3.10"
10199
warn_return_any = true
102100
warn_unused_configs = true
103101
disallow_untyped_defs = true
@@ -117,7 +115,7 @@ markers = [
117115
]
118116

119117
[tool.cibuildwheel]
120-
build = "cp39-* cp310-* cp311-* cp312-*"
118+
build = "cp310-* cp311-* cp312-*"
121119
skip = "*-musllinux_* *-win32"
122120
build-verbosity = 1
123121

0 commit comments

Comments
 (0)