-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernizing: Restoring CI, Moving to pytest (#136)
- Loading branch information
Showing
18 changed files
with
570 additions
and
557 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
SUFFIX=$1 | ||
if [ -z ${SUFFIX} ]; then | ||
echo "Supply valid python package extension such as whl or tar.gz. Exiting." | ||
exit 3 | ||
fi | ||
|
||
script=`pwd`/${BASH_SOURCE[0]} | ||
HERE=`dirname ${script}` | ||
ROOT=`realpath ${HERE}/../..` | ||
|
||
cd ${ROOT} | ||
DESTENV=${ROOT}/.venvforinstall | ||
if [ -d ${DESTENV} ]; then | ||
rm -rf ${DESTENV} | ||
fi | ||
python -m venv ${DESTENV} | ||
source ${DESTENV}/bin/activate | ||
pip install --upgrade --quiet pip | ||
pip install --quiet -r dev_requirements.txt | ||
python setup.py sdist bdist_wheel | ||
|
||
PKG=`ls ${ROOT}/dist/*.${SUFFIX}` | ||
ls -l ${PKG} | ||
|
||
# install, run tests | ||
pip install ${PKG} |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**/*.rst' | ||
- '**/*.md' | ||
branches: | ||
- master | ||
- '[0-9].[0-9]' | ||
pull_request: | ||
branches: | ||
- master | ||
- '[0-9].[0-9]' | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
|
||
run-tests: | ||
runs-on: ${{matrix.os}} | ||
timeout-minutes: 30 | ||
strategy: | ||
max-parallel: 15 | ||
matrix: | ||
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.7', 'pypy-3.8'] | ||
os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] | ||
fail-fast: false | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
name: Python ${{ matrix.python-version }} ${{matrix.os}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: dev_requirements.txt | ||
- name: run tests | ||
run: | | ||
pip install -U pip setuptools wheel | ||
pip install -r dev_requirements.txt | ||
python setup.py build_ext --inplace | ||
pytest | ||
- name: build and install the wheel | ||
run: | | ||
python setup.py bdist_wheel |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Publish tag to Pypi | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macos-10.15] | ||
env: | ||
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" | ||
MACOSX_DEPLOYMENT_TARGET: "10.12" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
# configure cibuildwheel to build native archs ('auto'), and some | ||
# emulated ones | ||
CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{matrix.os}}-wheels | ||
path: ./wheelhouse/*.whl | ||
|
||
publish: | ||
name: Pypi publish | ||
needs: ['build_wheels'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install tools | ||
run: | | ||
pip install twine wheel | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: ubuntu-20.04-wheels | ||
path: artifacts/linux | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: windows-2019-wheels | ||
path: artifacts/windows | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: macos-10.15-wheels | ||
path: artifacts/macos | ||
- name: unify wheel structure | ||
run: | | ||
mkdir dist | ||
cp -R artifacts/windows/* dist | ||
cp -R artifacts/linux/* dist | ||
cp -R artifacts/macos/* dist | ||
- name: Publish to Pypi | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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
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 |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
/build | ||
/dist | ||
MANIFEST | ||
.venv | ||
**/*.so |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.