-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating testing and docs infrastructure (#392)
* adding tox and updating some deps * removing 3.7 tests for numpy * notebooks * adding notebook output * adding binder config * adding tqdm to binder requirements * using binder conda env * conda env issue * conda binder install local
- Loading branch information
Showing
48 changed files
with
2,730 additions
and
2,870 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,133 +2,116 @@ name: Tests | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: | ||
- main | ||
tags: | ||
- "*" | ||
paths-ignore: | ||
- "joss/**" | ||
- "docs/**" | ||
pull_request: | ||
branches: [ main ] | ||
release: | ||
types: [ published ] | ||
|
||
|
||
jobs: | ||
tests: | ||
name: "py${{ matrix.python-version }} / ${{ matrix.os }} / extras: ${{ matrix.extras }}" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.6", "3.7", "3.8", "3.9"] | ||
extras: [true] | ||
python-version: ["3.7", "3.8", "3.9"] | ||
os: ["ubuntu-latest"] | ||
include: | ||
- python-version: "3.8" | ||
extras: false | ||
os: "ubuntu-latest" | ||
- python-version: "3.8" | ||
extras: true | ||
os: "macos-latest" | ||
- python-version: "3.8" | ||
extras: true | ||
os: "windows-latest" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
if: ${{ matrix.extras }} | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -e ".[extras,tests]" | ||
- name: Install dependencies without extras | ||
if: ${{ !matrix.extras }} | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -e ".[tests]" | ||
- name: Run tests | ||
run: | | ||
python -m pytest -v src/emcee/tests --cov emcee | ||
- name: Get unique id | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
id: unique-id | ||
env: | ||
STRATEGY_CONTEXT: ${{ toJson(strategy) }} | ||
run: | | ||
export JOB_ID=`echo $STRATEGY_CONTEXT | md5sum` | ||
echo "::set-output name=id::$JOB_ID" | ||
- uses: actions/upload-artifact@v2 | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
with: | ||
name: cov-${{ steps.unique-id.outputs.id }} | ||
path: .coverage | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -U coveralls coverage[toml] tox tox-gh-actions | ||
- name: Run tests | ||
run: python -m tox | ||
- name: Combine and upload coverage | ||
run: | | ||
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: ${{ matrix.python-version }}-${{ matrix.os }} | ||
|
||
coverage: | ||
name: "Merge and upload coverage" | ||
needs: tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
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 }} | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v2 | ||
- name: Merge and upload coverage | ||
python-version: "3.9" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install coveralls | ||
find . -name \.coverage -exec coverage combine --append {} \; | ||
coveralls | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.github_token }} | ||
python -m pip install -U pip | ||
python -m pip install tox | ||
- name: Lint the code | ||
run: python -m tox -e lint | ||
|
||
build: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- uses: actions/setup-python@v2 | ||
name: Install Python | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Build | ||
run: | | ||
python -m pip install -U pip pep517 twine setuptools_scm | ||
python -m pep517.build . | ||
- name: Test the sdist | ||
python-version: "3.9" | ||
- name: Build sdist and wheel | ||
run: | | ||
python -m venv venv-sdist | ||
venv-sdist/bin/python -m pip install dist/emcee*.tar.gz | ||
venv-sdist/bin/python -c "import emcee;print(emcee.__version__)" | ||
- name: Test the wheel | ||
run: | | ||
python -m venv venv-wheel | ||
venv-wheel/bin/python -m pip install dist/emcee*.whl | ||
venv-wheel/bin/python -c "import emcee;print(emcee.__version__)" | ||
python -m pip install -U pip | ||
python -m pip install -U build | ||
python -m build . | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist/* | ||
|
||
upload_pypi: | ||
needs: [tests, build] | ||
needs: [tests, lint, build] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: dist | ||
name: artifact | ||
path: dist | ||
- uses: pypa/gh-action-pypi-publish@master | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
# To test: repository_url: https://test.pypi.org/legacy/ |
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 |
---|---|---|
|
@@ -21,3 +21,4 @@ emcee_version.py | |
|
||
.tox | ||
env | ||
.eggs |
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,29 +1,26 @@ | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
rev: v4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: debug-statements | ||
|
||
- repo: https://github.com/asottile/seed-isort-config | ||
rev: v1.9.2 | ||
hooks: | ||
- id: seed-isort-config | ||
args: [--application-directories=src] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v4.3.20 | ||
- repo: https://github.com/PyCQA/isort | ||
rev: "5.9.1" | ||
hooks: | ||
- id: isort | ||
args: [] | ||
additional_dependencies: [toml] | ||
exclude: docs/tutorials | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 19.3b0 | ||
rev: "21.6b0" | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/dfm/black_nbconvert | ||
rev: master | ||
rev: v0.2.0 | ||
hooks: | ||
- id: black_nbconvert |
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 +1 @@ | ||
The list of contributors can be found `on GitHub <https://github.com/dfm/emcee/graphs/contributors>`_. | ||
The list of contributors can be found `on GitHub <https://github.com/dfm/emcee/graphs/contributors>`_. |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
- Easy to use gradient-free MCMC sampling of black box log probability functions | ||
- Few bells and whistles: no plotting, no modeling, no marginal likelihood calculation, etc. | ||
- Any sampling algorithm must have published proof of correctness | ||
|
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: emcee | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python | ||
- numpy | ||
- scipy | ||
- h5py | ||
- matplotlib | ||
- corner | ||
- tqdm | ||
- mpi4py | ||
- schwimmbad | ||
- pip | ||
- pip: | ||
- celerite | ||
- autograd | ||
- .. |
Oops, something went wrong.