-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for Python 3.10 and updating test infrastructure (#63)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f39e848
commit de61a55
Showing
21 changed files
with
260 additions
and
223 deletions.
There are no files selected for viewing
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,114 +1,74 @@ | ||
name: Python | ||
on: | ||
push: | ||
branches: [main] | ||
branches: | ||
- main | ||
tags: | ||
- "*" | ||
paths-ignore: | ||
- "docs/**" | ||
pull_request: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9"] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ["3.9"] | ||
extras: ["core", "jax", "pymc3"] | ||
include: | ||
- python-version: "3.10" | ||
extras: "core" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
submodules: true | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -e ".[test]" | ||
env: | ||
DISTUTILS_USE_SDK: 1 | ||
MSSdk: 1 | ||
- name: Run the unit tests | ||
run: python -m pytest --cov celerite2 python/test | ||
- name: Coveralls | ||
if: startsWith(matrix.os, 'ubuntu') | ||
uses: AndreMiras/coveralls-python-action@v20201129 | ||
with: | ||
parallel: true | ||
flag-name: Unit Tests | ||
|
||
theano: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: 3.8 | ||
auto-update-conda: true | ||
- name: Install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
conda install -q numpy scipy theano mkl-service | ||
python -m pip install -U pip | ||
python -m pip install --use-feature=2020-resolver -e ".[test,theano]" | ||
- name: Get theano compiledir | ||
id: compiledir | ||
shell: bash -l {0} | ||
run: | | ||
python -c "import theano; print('::set-output name=compiledir::' + theano.config.compiledir.split('/')[-1])" | ||
- name: "Cache ~/.theano" | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.theano | ||
key: theano-${{ steps.compiledir.outputs.compiledir }}-${{ hashFiles('python/test/theano/*.py') }} | ||
restore-keys: | | ||
theano-${{ steps.compiledir.outputs.compiledir }}- | ||
theano- | ||
- name: Run the unit tests | ||
shell: bash -l {0} | ||
run: python -m pytest --cov celerite2 python/test/theano | ||
- name: Coveralls | ||
uses: AndreMiras/coveralls-python-action@v20201129 | ||
with: | ||
parallel: true | ||
flag-name: Unit Tests | ||
python -m pip install -U coveralls coverage[toml] tox tox-gh-actions pybind11 | ||
jax: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: 3.8 | ||
auto-update-conda: true | ||
- name: Install dependencies | ||
shell: bash -l {0} | ||
- name: Run tests | ||
run: python -m tox | ||
env: | ||
EXTRAS: ${{ matrix.extras }} | ||
|
||
- name: Combine and upload coverage | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install --use-feature=2020-resolver -e ".[test,jax]" | ||
- name: Run the unit tests | ||
shell: bash -l {0} | ||
run: python -m pytest --cov celerite2 python/test/jax | ||
- name: Coveralls | ||
uses: AndreMiras/coveralls-python-action@v20201129 | ||
with: | ||
parallel: true | ||
flag-name: Unit Tests | ||
python -m coverage combine | ||
python -m coverage xml -i | ||
python -m coveralls --service=github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_PARALLEL: true | ||
COVERALLS_FLAG_NAME: py${{ matrix.python-version }}-${{ matrix.extras }} | ||
|
||
coverage: | ||
needs: [build, theano, jax] | ||
needs: tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: AndreMiras/coveralls-python-action@v20201129 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
parallel-finished: true | ||
python-version: "3.9" | ||
- name: Finish coverage collection | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -U coveralls | ||
python -m coveralls --finish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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 |
---|---|---|
|
@@ -35,3 +35,6 @@ dist | |
.envrc | ||
.coverage | ||
*.ipynb | ||
.coverage* | ||
.eggs | ||
.tox |
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
Oops, something went wrong.