Skip to content

Commit b4910f0

Browse files
authored
rewrite R2 publishing in Python (#1051)
This rips out the mirror uploading logic from the `pythonbuild` rust CLI and moves it to Python, mainly because the rust aws sdk is clearly not mature enough to support our use case, as evidenced by #1047 I've also had to start using `--no-dev` on some existing `uv run` invocations because `moto` wouldn't cleanly install in some build jobs (like when building CPython for Windows). ## Test plan Apart from unit tests, there's now an integration test with a local, mocked S3 provider (using `moto`). Dry run release on this branch: https://github.com/astral-sh/python-build-standalone/actions/runs/23550742376
1 parent 77c46f1 commit b4910f0

File tree

15 files changed

+2051
-1433
lines changed

15 files changed

+2051
-1433
lines changed

.github/workflows/check.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ jobs:
3030
- name: "Run checks"
3131
run: |
3232
./check.py
33+
34+
- name: "Run unit tests"
35+
run: |
36+
uv run python -m unittest tests/test_mirror.py
37+
38+
- name: "Run mirror integration test"
39+
run: |
40+
uv run python -m unittest tests/test_mirror_integration.py

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
repo: casey/just
4646
version: 1.42.4
4747

48+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
49+
4850
# Perform a release in dry-run mode.
4951
- run: just release-dry-run ${GH_TOKEN} ${GITHUB_EVENT_INPUTS_SHA} ${GITHUB_EVENT_INPUTS_TAG}
5052
if: ${{ github.event.inputs.dry-run == 'true' }}

.github/workflows/windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
# don't get compiled properly.
151151
- name: Bootstrap Python environment
152152
run: |
153-
uv run build.py --help
153+
uv run --no-dev build.py --help
154154
155155
- name: Build
156156
if: ${{ ! matrix.dry-run }}
@@ -161,7 +161,7 @@ jobs:
161161
) ELSE (
162162
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\%MATRIX_VCVARS%"
163163
)
164-
uv run build.py --python cpython-%MATRIX_PYTHON% --sh c:\cygwin\bin\sh.exe --options %MATRIX_BUILD_OPTIONS% --vs %MATRIX_VS_VERSION%
164+
uv run --no-dev build.py --python cpython-%MATRIX_PYTHON% --sh c:\cygwin\bin\sh.exe --options %MATRIX_BUILD_OPTIONS% --vs %MATRIX_VS_VERSION%
165165
env:
166166
MATRIX_VCVARS: ${{ matrix.vcvars }}
167167
MATRIX_PYTHON: ${{ matrix.python }}

0 commit comments

Comments
 (0)