Skip to content

Commit

Permalink
Implement build and publish CI (#1)
Browse files Browse the repository at this point in the history
* Update python build line for Windows

* Fix numpy int size for Windows

* Configure CI to build wheels

* Use PEP517's build mechanism

* Add upload to test PyPI

* Build manylinux wheels

* Correct to manylinux before push

* Fix CI

* Add publish for tagged versions

* Use versionneer

* Fix various build issues

* Fix build for python 3.5

* Change versioneer style
  • Loading branch information
cyrilpic authored Jan 22, 2020
1 parent ae2dacc commit 37b8c3b
Show file tree
Hide file tree
Showing 12 changed files with 2,444 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hvwfg/_version.py export-subst
50 changes: 47 additions & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ on: [push]

jobs:
build:
name: Test on Python ${{ matrix.python_version }} and ${{ matrix.os }}
name: Test and build on Python ${{ matrix.python_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
python-version: [3.5, 3.6, 3.7]
python-version: [3.5, 3.6, 3.7, 3.8]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Enable Developer Command Prompt
if: matrix.os == 'windows-latest'
uses: ilammy/[email protected]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -32,3 +34,45 @@ jobs:
run: |
pip install deap pytest
pytest
- name: Build wheel
run: |
pip install pep517 wheel
python -m pep517.build --source --binary --out-dir dist/ .
- name: Upload wheel
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
build-n-publish:
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
needs: build
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Download wheels
uses: actions/download-artifact@v1
with:
name: dist
- name: Correct to manylinux
run: |
sudo apt-get update
sudo apt-get install -y patchelf
pip install auditwheel
for whl in dist/hvwfg-*-linux_x86_64.whl; do
auditwheel repair "$whl" -w dist/
done
rm dist/hvwfg-*-linux_x86_64.whl
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include versioneer.py
include hvwfg/_version.py
global-include *.pyx *.pxd *.h
5 changes: 5 additions & 0 deletions hvwfg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
from ._version import get_versions
from .hv4dr import hv4dr
from .hv5dr import hv5dr
from .wfg import wfg


__version__ = get_versions()['version']
del get_versions


def hv(front, ref, force_wfg=False):
"""Computes the hypervolume of `front` with `ref` as reference
Expand Down
Loading

0 comments on commit 37b8c3b

Please sign in to comment.