Skip to content

Commit

Permalink
- require cython for install
Browse files Browse the repository at this point in the history
- handle memory error
- remove now invalid comment
  • Loading branch information
Dobatymo committed Oct 21, 2020
1 parent 44d70e2 commit 88f3b79
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 6,929 deletions.
110 changes: 110 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Python package

on:
push:
pull_request:
release:
types:
- published

jobs:
test:

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
exclude:
- os: windows-latest
python-version: 2.7
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install setuptools wheel cython
- name: Build
run: |
python setup.py build_ext --inplace
- name: Run tests
run: |
python test.py
build-wheels:
#if: github.event_name == 'release' && github.event.action == 'published'
needs: test

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install setuptools wheel cython cibuildwheel
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: cp27-win*
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

build-sdist:
#if: github.event_name == 'release' && github.event.action == 'published'
needs: test

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install setuptools cython
- name: Build dists
run: |
python setup.py sdist
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz

upload-pypi:
# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest

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 }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ __pycache__/
build/
dist/
*.egg-info/

# cythonized files
*.cpp
Loading

0 comments on commit 88f3b79

Please sign in to comment.