Skip to content

Commit

Permalink
Simplify distribution infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromekelleher committed Aug 30, 2023
1 parent e1a6d56 commit 0fe27c4
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 70 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/docker/buildwheel.sh

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/docker/shared.env

This file was deleted.

45 changes: 37 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ jobs:
with:
python-version: '3.10'
- uses: pre-commit/[email protected]

test:
name: Python
name: Suite
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -39,17 +40,45 @@ jobs:
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install pytest
pip install pytest-cov
pip install pytest-xdist
pip install -r requirements/CI-tests-pip/requirements.txt
python3 -m pip install -r requirements/CI-tests-pip/requirements.txt
- name: Test with pytest
run: |
pytest --cov=tstrait --cov-report=xml --cov-branch -n 0 tests
python3 -m pytest --cov=tstrait --cov-report=xml --cov-branch -n 0 tests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Delete coverage
run: |
rm .coverage
rm .coverage
dist-tests:
name: Distribution
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install twine build
- name: Build sdist and wheel
run: |
python -m build
- name: Check distribution artefacts
run: |
python3 -m twine check dist/*
- name: Install wheel
run: |
python3 -m pip install dist/*.whl
- name: Import package
# Don't import from current dir
run: |
cd /
python3 -c "import tstrait"
64 changes: 26 additions & 38 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,39 @@ on:
types: [published]

jobs:
manylinux:
distbuild:
name: Build Distribution
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
submodules: true

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Build sdist
shell: bash
python-version: '3.10'
- name: Install dependencies
run: |
python setup.py sdist
- name: Upload sdist
uses: actions/upload-artifact@v2
with:
name: sdist
path: dist

- name: Build wheels in docker
shell: bash
python3 -m pip install --upgrade pip
python3 -m pip install twine build
- name: Build sdist and wheel
run: |
docker run --rm -v `pwd`:/project -w /project quay.io/pypa/manylinux2010_x86_64 bash .github/workflows/docker/buildwheel.sh
- name: Upload Wheels
uses: actions/upload-artifact@v2
python -m build
- name: Check distribution artefacts
run: |
python3 -m twine check dist/*
- name: Upload wheel and sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

OSX-test:
needs: ['manylinux']
needs: ['distbuild']
runs-on: macos-latest
strategy:
matrix:
python: [3.7, 3.8, 3.9]
python: [3.8, 3.9, "3.10", "3.11"]
steps:
- name: Download wheels
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: wheels
- name: Set up Python ${{ matrix.python }}
Expand All @@ -69,15 +58,15 @@ jobs:
python -c "import tstrait"
windows-test:
needs: ['manylinux']
needs: ['distbuild']
runs-on: windows-latest
strategy:
matrix:
python: [3.7, 3.8, 3.9]
python: [3.8, 3.9, "3.10", "3.11"]
wordsize: [64]
steps:
- name: Download wheels
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: wheels
- name: Set up Python ${{ matrix.python }}
Expand All @@ -92,15 +81,15 @@ jobs:
pip install tstrait --only-binary tstrait -f .
python -c "import tstrait"
manylinux-test:
linux-test:
runs-on: ubuntu-latest
needs: ['manylinux']
needs: ['distbuild']
strategy:
matrix:
python: [3.8, 3.9, "3.10", "3.11"]
steps:
- name: Download wheels
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: wheels
- name: Set up Python
Expand All @@ -114,13 +103,12 @@ jobs:
pip install tstrait --only-binary tstrait -f .
python -c "import tstrait"
PyPI_Upload:
runs-on: ubuntu-latest
needs: ['windows-test', 'OSX-test', 'manylinux-test']
needs: ['windows-test', 'OSX-test', 'linux-test']
steps:
- name: Download all
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Move to dist
run: |
mkdir dist
Expand Down
5 changes: 4 additions & 1 deletion requirements/CI-tests-pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ numba
numpy
pandas
scipy
tskit>=0.5.5
tskit>=0.5.5
pytest
pytest-cov
pytest-xdist

0 comments on commit 0fe27c4

Please sign in to comment.