Skip to content

Commit 8050665

Browse files
committed
ci: check dist uploads with twine
problem: if twine fails we do not have any record/reason. solution: add verbose and check during pr. Signed-off-by: vsoch <vsoch@users.noreply.github.com>
1 parent 20953f2 commit 8050665

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

‎.github/workflows/build-release.yaml‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ jobs:
8282
8383
- name: Build Python Wheels
8484
env:
85-
build_number: ${{ inputs.rc }}
85+
build_number: ${{ inputs.rc || '0' }}
8686
python_version: ${{ matrix.python }}
8787
MANYLINUX_GLIBC: ${{ inputs.glibc || '2_17' }}
8888
run: |
89-
/bin/bash ./docker/build-wheels.sh ${build_number} ${python_version}
89+
/bin/bash ./docker/build-wheels.sh "${build_number}" "${python_version}"
9090
ls ./dist
9191
9292
- name: Test Install
@@ -107,7 +107,6 @@ jobs:
107107
upload:
108108
runs-on: ubuntu-latest
109109
needs: [build]
110-
if: (github.event_name == 'workflow_dispatch')
111110
steps:
112111
- name: Download Artifacts
113112
uses: actions/download-artifact@v8
@@ -125,13 +124,21 @@ jobs:
125124
echo "Files to distribute:"
126125
ls ./dist
127126
127+
- name: Check distributions
128+
run: |
129+
python3 -m pip install setuptools wheel twine
130+
twine check --strict dist/*
131+
132+
- name: Test upload
133+
if: (github.event_name != 'workflow_dispatch')
134+
env:
135+
TWINE_USERNAME: __token__
136+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
137+
run: twine upload --verbose --repository testpypi --skip-existing dist/flux_python*
138+
128139
- name: Build and publish
140+
if: (github.event_name == 'workflow_dispatch')
129141
env:
130142
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
131143
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
132-
run: |
133-
ls dist/
134-
python3 -m pip install setuptools wheel
135-
python3 -m pip install twine==6.0.1
136-
python3 -m pip install --upgrade pkginfo
137-
twine upload --skip-existing dist/flux_python*
144+
run: twine upload --verbose --skip-existing dist/flux_python*

‎README.md‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
> 🐍️ You called me?
44
5-
Hello! You've found the flux Python bindings, an experiment to build and deploy
6-
Flux to Pypi without needing to store code alongside Flux. The goal of
7-
this experiment is to test them separately. This was originally developed
5+
Hello! You've found the flux Python bindings to build and deploy
6+
Flux to Pypi without needing to store code alongside Flux. This was originally developed
87
at [vsoch/flux-python](https://github.com/vsoch/flux-python) and has
9-
been ported here to automate more officially. The following guides might be useful
10-
to you:
8+
been ported here to automate more officially. The following guides might be useful to you:
119

1210
- ⭐️ [Flux Framework Documentation](https://flux-framework.readthedocs.io)
1311
- ⭐️ [Flux Projects](https://flux-framework.org)
@@ -17,7 +15,7 @@ to you:
1715

1816
## Helper Install
1917

20-
If you don't want to figure out your flux version and install with pip directory (per instructions in [manual install](#manual-install))
18+
If you need to install on a system without Flux, please [target a wheel](https://pypi.org/project/flux-python/#files) (`.whl`) file directly that matches the version of Flux you intend to use it with. A vanilla `pip install` will try to compile from source, which requires Flux. If you don't want to figure out your flux version and install with pip directory (per instructions in [manual install](#manual-install))
2119
we provide a helper script [install-flux-python.sh](script/install-flux-python.sh) that will:
2220

2321
1. Determine that Flux and Python are installed with pip

‎docker/build-wheels.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ glibc=${MANYLINUX_GLIBC:-2_17}
77

88
# This is intended to run in the container
99
echo "Building Python version ${version}"
10+
echo "Build number ${build_number}"
1011

1112
export PATH=/opt/conda/envs/build/bin:$PATH
1213
export PYTHONPATH=/opt/conda/envs/build/lib/python${version}/site-packages

0 commit comments

Comments
 (0)