Skip to content

Commit

Permalink
Merge pull request #8 from oberbichler/feature/pypi
Browse files Browse the repository at this point in the history
Feature/pypi
  • Loading branch information
oberbichler authored Oct 27, 2019
2 parents 00f5c2d + 5f52b12 commit 07b822e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build PyPI

on:
push:
tags:
- 'v*'

jobs:
test:
name: Build package on python ${{ matrix.python-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
os: [windows-latest, macOS-latest]
python-version: [3.5, 3.6, 3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Build wheel
run: |
pip install setuptools wheel
python setup.py sdist bdist_wheel
- name: Upload to PyPi
run: |
pip install twine
python -m twine upload -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_KEY }} dist/*.whl
build_manylinux:
name: python ${{ matrix.python }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python: [cp35-cp35m, cp36-cp36m, cp37-cp37m, cp38-cp38]

steps:
- uses: actions/checkout@v1
- name: Build
run: |
docker run -v ${PWD}:/data -w /data --env PYTHON_VERSION=${{ matrix.python }} quay.io/pypa/manylinux2010_x86_64 bash tools/repair-wheel.sh
- name: Upload to PyPi
run: |
pip install twine
python -m twine upload -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_KEY }} wheelhouse/*.whl
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ def build_extension(self, ext):
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)

setup(
name='HyperJet',
name='hyperjet',
description='Automatic differentiation with dual numbers',
version=HYPERJET_VERSION,
url='https://github.com/oberbichler/HyperJet',
author='Thomas Oberbichler',
author_email='thomas.oberbichler@gmail.com',
ext_modules=[CMakeExtension('HyperJet')],
ext_modules=[CMakeExtension('hyperjet')],
cmdclass=dict(build_ext=CMakeBuild),
install_requires=['cmake', 'numpy'],
test_suite='nose.collector',
Expand Down
6 changes: 6 additions & 0 deletions tools/repair-wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set -e
yum -y remove cmake
/opt/python/${PYTHON_VERSION}/bin/pip install cmake
export PATH=$PATH:/opt/python/${PYTHON_VERSION}/bin/
/opt/python/${PYTHON_VERSION}/bin/pip wheel .
auditwheel repair hyperjet-*-${PYTHON_VERSION}-*.whl

0 comments on commit 07b822e

Please sign in to comment.