-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring code up to modern standards (#142)
* Reorganize code into subdirectories * Remove old disused CI stuff * Add Github Actions integration * Add pyproject.toml * With pyproject, pep 517/8 simplifies the setup file dramatically
- Loading branch information
Showing
22 changed files
with
181 additions
and
171 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-18.04, windows-latest, macos-latest] | ||
|
||
env: | ||
CIBW_SKIP: cp27-* cp35-* pp27-* pp36-* | ||
CIBW_BEFORE_BUILD: python -c "print(('#'*140+'\n')*10)" && pip install "numpy>=1.13" | ||
CIBW_TEST_REQUIRES: pytest pytest-cov | ||
CIBW_TEST_COMMAND: "pytest {project}/test" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
name: Install Python | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: Install cibuildwheel | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install cibuildwheel | ||
- name: Install Visual C++ for Python 2.7 | ||
if: runner.os == 'Windows' | ||
run: | | ||
choco install vcpython27 -f -y | ||
- name: Build wheels | ||
run: | | ||
python -m cibuildwheel --output-dir wheelhouse | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
name: Install Python | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: Build sdist | ||
run: | | ||
python -m pip install numpy>=1.13 # Can't rely on pep 517 to get it from pyproject.toml | ||
python setup.py sdist | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
|
||
upload_pypi: | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
if: "github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[no release]')" | ||
# # upload to PyPI on every tag starting with 'v' | ||
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||
# # publish when a GitHub Release is created | ||
# if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
# To test: repository_url: https://test.pypi.org/legacy/ |
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
version: 2 | ||
|
||
python: | ||
version: 3.7 | ||
version: 3.8 | ||
system_packages: true | ||
install: | ||
- method: pip | ||
path: . | ||
- requirements: requirements-doc.txt | ||
extra_requirements: | ||
- docs | ||
|
||
# The only extra format to build is PDF | ||
formats: [pdf] |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
include README.txt LICENSE | ||
include numpy_quaternion.c quaternion.c quaternion.h math_msvc_compatibility.h | ||
include README.md LICENSE | ||
include src/numpy_quaternion.c src/quaternion.c src.quaternion.h src/math_msvc_compatibility.h |
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
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 |
---|---|---|
@@ -1,2 +1,9 @@ | ||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
norecursedirs = ".* build dist *.egg-info install ENV" | ||
junit_family="xunit2" | ||
addopts = "-v --tb=short --doctest-glob='' --cov=quaternion --cov-branch --cov-report xml" | ||
|
||
[build-system] | ||
requires = ["setuptools", "wheel", "numpy>=1.13"] | ||
build-backend = "setuptools.build_meta" |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.