Skip to content

Upload Python Package #23

Upload Python Package

Upload Python Package #23

Workflow file for this run

# This workflow will upload a Python Package using the PyPi action workflow
name: Upload Python Package
on:
release:
types: [published]
env:
VERMOUTH_TEST_DSSP: mkdssp
SKIP_GENERATE_AUTHORS: 1
SKIP_WRITE_GIT_CHANGELOG: 1
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
py_version: ["3.8", "3.9", "3.10", "3.11"]
include:
- py_version: "3.8"
WITH_CODECOV: true
- py_version: "3.9"
WITH_CODECOV: true
- py_version: "3.10"
WITH_CODECOV: true
- py_version: "3.11"
WITH_CODECOV: true
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_version }}
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies part I
run: |
sudo apt-get install dssp
pip install --upgrade setuptools pip
- name: Install package and requirements
run: |
pip install --upgrade .
pip install -r requirements-tests.txt
- name: Run pytest with codecoverage
run: |
coverage run --source=vermouth $(which pytest) -vv vermouth --hypothesis-show-statistics
coverage report --omit='*/bin/pytest'
- if: ${{ matrix.WITH_CODECOV }}
name: Report code coverage
run: |
codecov
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
pip install -r requirements-tests.txt
- name: Run pylint
run: |
pylint --disable=fixme --fail-under=8.0 vermouth
pylint --disable=fixme --fail-under=9.0 bin/martinize2
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
pip install -r requirements-docs.txt
- name: Run docs
run: |
mkdir -p doc/source/_static
sphinx-build -EW -b html doc/source/ doc/build/html
deploy:
needs: [build, lint, docs]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
pip install pbr
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}