Skip to content

Commit

Permalink
Updated pip-install to build executables for macOS 11-14, Ubuntu 20-2…
Browse files Browse the repository at this point in the history
…4, and Python versions 3.6-3.11.
  • Loading branch information
Rory Barnes committed Sep 5, 2024
1 parent 503135b commit 10e5c49
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 20 deletions.
56 changes: 38 additions & 18 deletions .github/workflows/pip-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,64 @@ on:

jobs:
build_wheels:
name: Build wheel
runs-on: ubuntu-latest
name: Building wheel for ${{ matrix.os }}:Python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, macos-14]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10, 3.11]
exclude:
- os: ubuntu-22.04
python-version: '3.6'
- os: macos-14
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Set up Python
id: setup_python
uses: actions/setup-python@v5
with:
python-version: 3.9

- uses: ilammy/msvc-dev-cmd@v1
python-version: ${{ matrix.python-version }}

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.12.1
python -m pip install cibuildwheel==2.20.0
- name: Build wheel
- name: Build wheel on Linux
if: runner.os == 'Linux'
run: |
if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "macOS" ]]; then
python -m cibuildwheel --output-dir wheelhouse
else
echo "$RUNNER_OS not supported"
exit 1
fi
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp3?-*'
CIBW_SKIP: '*-manylinux_i686'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
shell: bash

- uses: actions/upload-artifact@v3
- name: Build wheel on macOS
if: runner.os == 'macOS'
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
name: Building source for ${{ matrix.os }}:Python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, macos-14]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10, 3.11]
exclude:
- os: ubuntu-22.04
python-version: '3.6'
- os: macos-14
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -52,7 +72,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: 3.9
python-version: ${{ matrix.python-version }}

- name: Build sdist
run: python setup.py sdist
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
include VERSION
include src/*.c
include src/*.h
include bin/vplanet
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

# Read current code version
VersionPath = os.path.join(os.path.abspath(os.path.dirname(__file__)), "VERSION")
print(VersionPath)
VERSION = open(VersionPath, "r").read().split("\n")[0].strip()


Expand Down Expand Up @@ -93,7 +92,9 @@ def run(self):
ext_modules=ext_modules,
cmdclass=cmdclass,
include_package_data=True,
data_files=[('', ['VERSION'])],
# package_data={'': ['VERSION']},
package_data={'': ['src/*.[ch]']},
data_files=[('', ['VERSION','bin/vplanet'])],
zip_safe=False,
entry_points={"console_scripts": ["vplanet=vplanet.wrapper:_entry_point"]},
)
Expand Down

0 comments on commit 10e5c49

Please sign in to comment.