Skip to content

Commit

Permalink
switch to cibuildwheel for universal2 build
Browse files Browse the repository at this point in the history
  • Loading branch information
jooste committed Sep 18, 2022
1 parent f97fadd commit 25a07b6
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 21 deletions.
53 changes: 38 additions & 15 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
types:
- published

env:
CIBW_ARCHS_MACOS: auto universal2
CIBW_TEST_SKIP: "*universal2:arm64"

jobs:
buildsrc:
name: Build source package
Expand All @@ -31,40 +35,59 @@ jobs:
python -m pip install --upgrade pip
pip install numpy
- name: Build source package with setuptools
run: |
echo "prune bluesky/resources/graphics\nprune bluesky/resources/html\nprune bluesky/resources/navdata\nprune bluesky/resources/performance" >> MANIFEST.in
python setup.py sdist
run: python setup.py sdist
- name: Store the source package
uses: actions/upload-artifact@v2
with:
name: python-package-distributions
path: dist

buildbin:
name: Build binary package for ${{ matrix.os }}
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy wheel
- name: Build wheel with setuptools for ${{matrix.os}}
run: python setup.py bdist_wheel
- name: Store the binary wheel
uses: actions/upload-artifact@v2
- uses: pypa/[email protected]

- uses: actions/upload-artifact@v2
with:
name: python-package-distributions
path: dist
path: ./wheelhouse/*.whl

# buildbin:
# name: Build binary package for ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# python-version: ["3.8", "3.9", "3.10"]
# os: [ubuntu-latest, macos-latest, windows-latest]

# steps:
# - uses: actions/checkout@v1
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install numpy wheel
# - name: Build wheel with setuptools for ${{matrix.os}}
# run: python setup.py bdist_wheel
# - name: Store the binary wheel
# uses: actions/upload-artifact@v2
# with:
# name: python-package-distributions
# path: dist

upload_pypi:
needs: [buildsrc, buildbin]
Expand Down
10 changes: 9 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ recursive-exclude bluesky .DS_Store
include LICENSE
include README.md
include setup.py
include BlueSky*.py
include check.py
include requirements.txt
include Makefile
prune docs
prune extra
prune plugins
prune scenario
prune utils
prune bluesky/resources/graphics
prune bluesky/resources/html
prune bluesky/resources/navdata
prune bluesky/resources/performance
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
5 changes: 3 additions & 2 deletions setup_guidata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import setup
from setuptools import setup, findall
from os import path


Expand Down Expand Up @@ -40,7 +40,8 @@
# This field adds keywords for your project which will appear on the
keywords='atm transport simulation aviation aircraft',
packages=['bluesky.resources.graphics', 'bluesky.resources.html'], # Required
include_package_data=True,
package_data={'bluesky.resources.graphics': [f.replace('bluesky/resources/graphics/', '', 1) for f in findall('bluesky/resources/graphics')],
'bluesky.resources.html': [f.replace('bluesky/resources/html/', '', 1) for f in findall('bluesky/resources/html')]},
exclude_package_data={'bluesky.resources.graphics': ['world.jpg']},
project_urls={
'Source': 'https://github.com/TUDelft-CNS-ATM/bluesky',
Expand Down
6 changes: 3 additions & 3 deletions setup_simdata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from setuptools import setup
from setuptools import setup, findall
from os import path
import glob


# Get the long description from the README file
Expand Down Expand Up @@ -41,7 +40,8 @@
# This field adds keywords for your project which will appear on the
keywords='atm transport simulation aviation aircraft',
packages=['bluesky.resources.performance', 'bluesky.resources.navdata'], # Required
include_package_data=True,
package_data={'bluesky.resources.performance': [f.replace('bluesky/resources/performance/', '', 1) for f in findall('bluesky/resources/performance')],
'bluesky.resources.navdata': [f.replace('bluesky/resources/navdata/', '', 1) for f in findall('bluesky/resources/navdata')]},
project_urls={
'Source': 'https://github.com/TUDelft-CNS-ATM/bluesky',
},
Expand Down

0 comments on commit 25a07b6

Please sign in to comment.