From 10e5c4905849671cd7f1642319e0481056a9b656 Mon Sep 17 00:00:00 2001 From: Rory Barnes Date: Thu, 5 Sep 2024 15:06:55 -0700 Subject: [PATCH] Updated pip-install to build executables for macOS 11-14, Ubuntu 20-24, and Python versions 3.6-3.11. --- .github/workflows/pip-install.yml | 56 +++++++++++++++++++++---------- MANIFEST.in | 3 ++ setup.py | 5 +-- 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml index f5745cb78..74cf7b5be 100644 --- a/.github/workflows/pip-install.yml +++ b/.github/workflows/pip-install.yml @@ -5,8 +5,19 @@ 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 @@ -14,35 +25,44 @@ jobs: 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: @@ -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 diff --git a/MANIFEST.in b/MANIFEST.in index ceeea233f..df413d6f6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,4 @@ include VERSION +include src/*.c +include src/*.h +include bin/vplanet \ No newline at end of file diff --git a/setup.py b/setup.py index 3c2dab6d9..8e338aa7b 100644 --- a/setup.py +++ b/setup.py @@ -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() @@ -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"]}, )