-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refactor-api' into fixplot
- Loading branch information
Showing
31 changed files
with
478 additions
and
307 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,36 @@ | ||
# Based on: | ||
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,80 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Tests | ||
# This workflow will install Python dependencies and run tests with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ master, refactor-api ] | ||
pull_request: | ||
branches: [ master, refactor-api ] | ||
schedule: # At 00:00 on day-of-month 1 | ||
- cron: '0 0 1 * *' | ||
|
||
jobs: | ||
build: | ||
test: | ||
name: ${{ matrix.os}} / py${{ matrix.python_version }} | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: [3.7] | ||
include: | ||
- platform: ubuntu-latest | ||
python-version: 3.8 | ||
runs-on: ${{ matrix.platform }} | ||
os: [Ubuntu] | ||
python_version: ['3.10', '3.11', '3.12'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
name: Install Python ${{ matrix.python_version }} | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
architecture: x64 | ||
|
||
- name: Install (testing) requirements | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
pip install pytest | ||
- name: Install psignifit to be tested | ||
run: | | ||
pip install . | ||
- name: Run tests for ${{ matrix.python_version }} through nox | ||
run: | | ||
pytest -vv | ||
lint: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install package with dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[tests] | ||
# Uncomment if sphinx docs are available in the repository | ||
# pip install -e .[tests,docs] | ||
- name: Lint with flake8 | ||
run: | | ||
python-version: "3.12" | ||
- name: flake8 Lint Errors | ||
uses: py-actions/flake8@v2 | ||
with: | ||
args: --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# stop the build if there are Python syntax errors or undefined names | ||
# E9: Runtime errors (syntax, indentation, io) | ||
# F63: Wrong use of operators and always-true assertion tests | ||
# F7: Wrong position of statements (break, continue, return, ...) | ||
# F82: Undefined (variable) name | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# | ||
- name: flake8 Lint Warnings | ||
uses: py-actions/flake8@v2 | ||
with: | ||
args: --count --exit-zero --statistics --show-source | ||
# print warnings if other style errors are found. | ||
# see .flake8 config file for selected/ignored rules. | ||
# warnings can be found in the action logs https://github.com/wichmann-lab/python-psignifit/actions | ||
flake8 . --count --exit-zero --statistics --show-source | ||
- name: Test with pytest and measure coverage | ||
run: | | ||
pytest --cov --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
# warnings can be found in the action logs | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
# Uncomment if sphinx docs are available in the repository | ||
# - name: Build the documentation | ||
# run: | | ||
# python setup.py build_sphinx | ||
python-version: "3.12" | ||
cache: pip | ||
cache-dependency-path: setup.cfg | ||
- name: Install package with docs | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip install -e .[docs] | ||
- name: Build the documentation | ||
run: | | ||
cd docs && make html |
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
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 @@ | ||
sg_execution_times.rst |
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 @@ | ||
This is just a file to assure git creates this directory still if empty |
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,5 @@ | ||
.. _how-to-get-standard-parameters: | ||
|
||
How to: Get Standard Parameters | ||
=============================== | ||
|
||
|
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,5 @@ | ||
.. _how-tos: | ||
|
||
How-To | ||
====== | ||
|
||
|
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.