-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
716 additions
and
2 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,73 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
# PyPI package | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
python -m twine upload dist/* | ||
# Docuemntation | ||
- name: Install doc dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r docs/requirements.txt | ||
- name: Build documentation | ||
run: | | ||
python -m sphinx docs/ docs/_build/ -b html | ||
- name: Deploy documentation to Github pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/_build | ||
|
||
# Github release | ||
- name: Read CHANGELOG | ||
id: changelog | ||
run: | | ||
# Get bullet points from last CHANGELOG entry | ||
CHANGELOG=$(git diff -U0 HEAD^ HEAD | grep '^[+][\* ]' | sed 's/\+//') | ||
# Support for multiline, see | ||
# https://github.com/actions/create-release/pull/11#issuecomment-640071918 | ||
CHANGELOG="${CHANGELOG//'%'/'%25'}" | ||
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" | ||
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" | ||
echo "Got changelog: $CHANGELOG" | ||
echo "::set-output name=body::$CHANGELOG" | ||
- name: Create release on Github | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: ${{ steps.changelog.outputs.body }} |
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,54 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-18.04, macOS-latest, windows-latest ] | ||
python-version: [3.6] | ||
include: | ||
- os: ubuntu-latest | ||
python-version: 3.7 | ||
- os: ubuntu-latest | ||
python-version: 3.8 | ||
|
||
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 -V | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -r docs/requirements.txt | ||
pip install -r tests/requirements.txt | ||
- name: Test with pytest | ||
run: | | ||
python -m pytest | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml | ||
if: matrix.os == 'ubuntu-18.04' | ||
|
||
- name: Test building documentation | ||
run: | | ||
python -m sphinx docs/ docs/_build/ -b html -W | ||
# python -m sphinx docs/ build/sphinx/html -b linkcheck | ||
if: matrix.os == 'ubuntu-18.04' |
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,10 @@ | ||
__pycache__ | ||
*.egg-info/ | ||
.eggs/ | ||
build/ | ||
dist/ | ||
.idea/ | ||
venv/ | ||
.coverage* | ||
__init__.pyc | ||
coverage.xml |
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,19 @@ | ||
Changelog | ||
========= | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on `Keep a Changelog`_, | ||
and this project adheres to `Semantic Versioning`_. | ||
|
||
|
||
Version 0.1.0 (2020-XX-XX) | ||
-------------------------- | ||
|
||
* Added: initial release | ||
|
||
|
||
.. _Keep a Changelog: | ||
https://keepachangelog.com/en/1.0.0/ | ||
.. _Semantic Versioning: | ||
https://semver.org/spec/v2.0.0.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
Contributing | ||
============ | ||
|
||
If you would like to add new functionality fell free to create a `merge | ||
request`_ . If you find errors, omissions, inconsistencies or other things | ||
that need improvement, please create an issue_. | ||
Contributions are always welcome! | ||
|
||
.. _issue: | ||
https://gitlab.audeering.com/tools/audplot/issues/new?issue%5BD= | ||
.. _merge request: | ||
https://gitlab.audeering.com/tools/audplot/merge_requests/new | ||
|
||
Development Installation | ||
------------------------ | ||
|
||
Instead of pip-installing the latest release from PyPI, you should get the | ||
newest development version from Gitlab_:: | ||
|
||
git clone git@srv-app-01.audeering.local:tools/audplot.git | ||
cd audplot | ||
# Use virtual environment | ||
pip install -r requirements.txt | ||
|
||
.. _Gitlab: https://gitlab.audeering.com/tools/audplot | ||
|
||
This way, your installation always stays up-to-date, even if you pull new | ||
changes from the Gitlab repository. | ||
|
||
Building the Documentation | ||
-------------------------- | ||
|
||
If you make changes to the documentation, you can re-create the HTML pages | ||
using Sphinx_. | ||
You can install it and a few other necessary packages with:: | ||
|
||
pip install -r requirements.txt | ||
pip install -r docs/requirements.txt | ||
|
||
To create the HTML pages, use:: | ||
|
||
python -m sphinx docs/ build/sphinx/html -b html | ||
|
||
The generated files will be available in the directory ``build/sphinx/html/``. | ||
|
||
.. Note:: | ||
|
||
During the default building of the documentation | ||
Jupyter notebooks are not executed to save time. | ||
|
||
To execute the notebooks as well, copy and paste | ||
the following into your terminal and press the enter key:: | ||
|
||
python -m sphinx -W docs/ \ | ||
-D nbsphinx_execute='always' \ | ||
-d build/sphinx/doctrees \ | ||
build/sphinx/html \ | ||
-b html | ||
|
||
It is also possible to automatically check if all links are still valid:: | ||
|
||
python -m sphinx docs/ build/sphinx/linkcheck -b linkcheck | ||
|
||
.. _Sphinx: http://sphinx-doc.org/ | ||
|
||
Running the Tests | ||
----------------- | ||
|
||
You'll need pytest_ for that. | ||
It can be installed with:: | ||
|
||
pip install -r tests/requirements.txt | ||
|
||
To execute the tests, simply run:: | ||
|
||
python -m pytest | ||
|
||
To run the tests on the Gitlab CI server, | ||
contributors have to make sure | ||
they have an existing ``artifactory-tokenizer`` repository | ||
with the content described in the `Artifactory tokenizer example`_. | ||
|
||
.. _pytest: | ||
https://pytest.org/ | ||
.. _Artifactory tokenizer example: | ||
http://devops.pp.audeering.com/focustalks/2019-focustalk-artifactory-security/#tokenizer-example | ||
|
||
Creating a New Release | ||
---------------------- | ||
|
||
New releases are made using the following steps: | ||
|
||
#. Update ``CHANGELOG.rst`` | ||
#. Commit those changes as "Release X.Y.Z" | ||
#. Create an (annotated) tag with ``git tag -a vX.Y.Z`` | ||
#. Make sure you have an ``artifactory-tokenizer`` with ``deployers`` group | ||
permissions | ||
#. Push the commit and the tag to Gitlab | ||
|
||
.. _PyPI: https://artifactory.audeering.com/artifactory/api/pypi/pypi-local/simple/ | ||
.. _twine: https://twine.readthedocs.io/ |
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,20 @@ | ||
from audplot.core.api import ( | ||
confusion_matrix, | ||
distribution, | ||
scatter, | ||
series, | ||
) | ||
|
||
|
||
# Disencourage from audfoo import * | ||
__all__ = [] | ||
|
||
|
||
# Dynamically get the version of the installed module | ||
try: | ||
import pkg_resources | ||
__version__ = pkg_resources.get_distribution(__name__).version | ||
except Exception: # pragma: no cover | ||
pkg_resources = None # pragma: no cover | ||
finally: | ||
del pkg_resources |
Empty file.
Oops, something went wrong.