-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
While the purity of building from sdist was appealing, it is difficult for cibuildwheel to cleanly run an external test suite as it containerizes the Linux build (to deal with ManyLinux requirements). We are still testing the sdist (on Windows) so just have to trust in cibuildwheel's own efforts to separate the testing and source from the installation. (Which it does seem to work quite hard at.)
- Loading branch information
Showing
1 changed file
with
23 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,29 +6,7 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
build-sdist: | ||
name: Build sdist | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Ensure tags are fetched for versioning | ||
|
||
- name: Create source distribution | ||
shell: bash -l {0} | ||
run: | | ||
pipx run build --sdist . | ||
- name: Upload source dist as build artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-source-distribution | ||
path: dist/ | ||
if-no-files-found: error | ||
|
||
build-wheels: | ||
needs: build-sdist | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-13, macos-latest, ubuntu-latest] | ||
|
@@ -57,23 +35,6 @@ jobs: | |
steps: | ||
- name: Checkout project (for test files) | ||
uses: actions/checkout@v4 | ||
with: | ||
path: euphonic_from_git | ||
|
||
- name: Delete source (to ensure we are using sdist only) | ||
shell: bash -l {0} | ||
run: rm -rf euphonic_from_git/euphonic | ||
|
||
- name: Download sdist | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-source-distribution | ||
path: dist/ | ||
|
||
- name: Get sdist filename | ||
shell: bash -l {0} | ||
run: | | ||
echo EUPHONIC_SDIST="$(find dist/ -name 'euphonic*.tar.gz')" >> $GITHUB_ENV | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
|
@@ -115,7 +76,7 @@ jobs: | |
run: | | ||
python -m pip install --upgrade pip build wheel twine | ||
- name: Build wheels from sdist | ||
- name: Build wheels from git checkout | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD_FRONTEND: build | ||
|
@@ -126,11 +87,10 @@ jobs: | |
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" | ||
|
||
CIBW_TEST_EXTRAS: "test,brille,phonopy_reader,matplotlib" | ||
CIBW_TEST_COMMAND: "python {package}../../euphonic_from_git/tests_and_analysis/test/run_tests.py" | ||
CIBW_TEST_COMMAND: "python {package}/tests_and_analysis/test/run_tests.py" | ||
|
||
with: | ||
output-dir: wheelhouse | ||
package-dir: ${{ env.EUPHONIC_SDIST }} | ||
|
||
- name: Upload wheels as build artifacts | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -139,6 +99,27 @@ jobs: | |
path: wheelhouse/*-${{ matrix.wheelname }}*_${{ matrix.cibw_archs }}.whl | ||
if-no-files-found: error | ||
|
||
build-sdist: | ||
name: Build sdist | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Ensure tags are fetched for versioning | ||
|
||
- name: Create source distribution | ||
shell: bash -l {0} | ||
run: | | ||
pipx run build --sdist . | ||
- name: Upload source dist as build artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-source-distribution | ||
path: dist/ | ||
if-no-files-found: error | ||
|
||
test-sdist: | ||
needs: build-sdist | ||
name: Test build from sdist on Windows | ||
|
@@ -196,7 +177,6 @@ jobs: | |
shell: bash -l {0} | ||
run: python tests_and_analysis/test/run_tests.py --report | ||
|
||
|
||
publish: | ||
if: github.event_name == 'release' | ||
needs: [build-wheels,test-sdist] | ||
|