-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernizing the infrastructure (#135)
* Fixed incorrect calls to label_kwargs and title_kwargs and added labelpad keyword argument * added separate titles keyword * added description of titles kwarg * Support passing an empty Figure as the `fig` kwarg. Small helper to support passing a new, empty Figure as the `fig` kwarg (useful e.g. when embedding Matplotlib in a GUI -- the empty Figure object may be created as part of the GUI setup). Also document the supported values for `fig` -- in particular that if it is unset, a *new* figure will be created, rather than overplotting the current figure (which is a quite common behavior for libraries built over Matplotlib, even though it doesn't really make sense here). Matplotlib minimum version was bumped to 2.1 (2017) as that's what added `Figure.subplots`. * starting to modernize * updating test infrastructe and baseline images * adding github action for unit tests * running isort * don't capture warnings * fixing warnings on gh actions? * upload the images on failure * experimenting with freetype * removing travis build * update matplotlib for better baseline images * skip windows tests * adding sdist build to tests * cleaning up manifest and testing build * run action on releases Co-authored-by: Daniela Huppenkothen <dhuppenk@uw.edu> Co-authored-by: Dominic Pesce <dom.pesce@gmail.com> Co-authored-by: Antony Lee <anntzer.lee@gmail.com>
- Loading branch information
1 parent
07fe09c
commit 6c70eb6
Showing
82 changed files
with
838 additions
and
461 deletions.
There are no files selected for viewing
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,93 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
tests: | ||
name: "py${{ matrix.python-version }} on ${{ matrix.os }}" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8] | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
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 ".[test]" | ||
- name: Check the style | ||
run: | | ||
isort -c src/corner | ||
isort -c tests | ||
black --check src/corner | ||
black --check tests | ||
- name: Run the unit tests | ||
run: python -m pytest -v tests | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} | ||
with: | ||
path: ./result_images | ||
|
||
build: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- 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 | ||
run: | | ||
python -m venv venv-sdist | ||
venv-sdist/bin/python -m pip install dist/corner*.tar.gz | ||
venv-sdist/bin/python -c "import corner;print(corner.__version__)" | ||
- name: Test the wheel | ||
run: | | ||
python -m venv venv-wheel | ||
venv-wheel/bin/python -m pip install dist/corner*.whl | ||
venv-wheel/bin/python -c "import corner;print(corner.__version__)" | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: dist/* | ||
|
||
upload_pypi: | ||
needs: [tests, build] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@master | ||
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 |
---|---|---|
|
@@ -9,3 +9,4 @@ test_figures | |
.coverage | ||
!corner/tests/baseline_images/*/*.png | ||
.pytest_cache | ||
corner_version.py |
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 +1,6 @@ | ||
include README.rst LICENSE | ||
|
||
exclude corner.png demo.py *.yml | ||
recursive-exclude docs * | ||
recursive-exclude tests * | ||
recursive-exclude paper * |
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 was deleted.
Oops, something went wrong.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.