Skip to content

Commit

Permalink
Migrate to CI buildwheel entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
oerc0122 committed Nov 15, 2024
1 parent ff71df2 commit 37c8f8d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/build_upload_pypi_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
- os: ubuntu-latest
wheelname: manylinux
- python-version: '3.10'
manylinux-version-tag: cp310
version-tag: cp310
- python-version: '3.11'
manylinux-version-tag: cp311
version-tag: cp311
- python-version: '3.12'
manylinux-version-tag: cp312
version-tag: cp312
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -38,6 +38,7 @@ jobs:
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channel-priority: true

- name: Install llvm on Macos
if: startsWith(matrix.os, 'macos')
shell: bash -l {0}
Expand All @@ -57,28 +58,20 @@ jobs:
run: |
echo "CC=${MSVC_BIN}\cl.exe" >> $GITHUB_ENV
echo "CC_LD=${MSVC_BIN}\link.exe" >> $GITHUB_ENV
- name: Update Python pip, build, wheel, and twine
shell: bash -l {0}
run: |
python -m pip install --upgrade pip build wheel twine
- name: Build Python wheel

if: matrix.os != 'ubuntu-latest'
shell: bash -l {0}
env:
NUMPY_VERSION: 2.0
run: |
# Build against lowest required Numpy version
python -m pip install numpy==${NUMPY_VERSION}
python -m build -o wheelhouse --wheel .
- name: Build manylinux Python wheel
if: matrix.os == 'ubuntu-latest'
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.manylinux-version-tag}}-manylinux*
CIBW_BEFORE_BUILD: python -m pip install numpy==2.0
CIBW_ARCHS: x86_64
CIBW_BUILD_FRONTEND: build
CIBW_BUILD: ${{matrix.version-tag}}-${{matrix.wheelname}}
# CIBW_BEFORE_BUILD: python -m pip install numpy==2.0
# CIBW_ARCHS: x86_64
CIBW_BUILD_VERBOSITY: 1
with:
output-dir: wheelhouse

Expand Down
4 changes: 2 additions & 2 deletions build_utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
version += f"+{dirty[0]}.{dirty[1]}{'.dirty' if len(dirty) > 2 else ''}"
break

except (OSError, subprocess.CalledProcessError):
continue
except (OSError, subprocess.CalledProcessError) as err:
print(f"Tried {gitcmd}, returned: {err}")
else: # Can't use git
version_file = Path(__file__).parent.parent / "euphonic" / "version.py"
version = version_file.read_text().split("=")[1].strip('"\n ')
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ requires = ["meson-python",
"packaging",
"numpy>=1.24.0"]

[tool.meson-python.args]
setup = ['--vsenv']

[project]
name = "Euphonic"
description = "Euphonic calculates phonon bandstructures and inelastic neutron scattering intensities from modelling code output (e.g. CASTEP)"
Expand Down

0 comments on commit 37c8f8d

Please sign in to comment.