Skip to content

Added escape for Sphinx characters to default value #46

Added escape for Sphinx characters to default value

Added escape for Sphinx characters to default value #46

Workflow file for this run

name: Test
on:
push:
branches: [ main ]
tags:
- '**'
pull_request:
branches: [ main ]
env:
PRE_COMMIT_COLOR: always
jobs:
# We only need to lint once, not for _each_ python version
lint:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
os: [ubuntu-latest]
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install pre-commit
run: pipx install pre-commit
- name: Cache pre-commitdeps
uses: actions/cache@v3
with:
path: |
~/.cache/pre-commit/
key: precommit-py${{ matrix.python-version }}-precommit-${{ hashFiles('poetry.lock', '.pre-commit-config.yaml') }}
restore-keys: precommit-py${{ matrix.python-version }}-
- name: Install dependencies
run: poetry install --no-root
- name: Lint
run: |
pre-commit run --all-files -v --show-diff-on-failure
pre-commit gc
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest]
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install dependencies
run: poetry install
- name: Test with pytest
run: |
make test args="--color=yes"
poetry run coverage run -m pytest --dead-fixtures --dup-fixtures --color=yes
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.5.0
with:
flags: unittests
env_vars: PYTHON
check:
if: always()
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
os: [ubuntu-latest]
name: build
# only run on push to main and on release, or with tag
if: "success() && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build'))"
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- run: poetry build
- run: ls -altrh dist/
shell: bash
- uses: actions/upload-artifact@v3
with:
name: pypi_files
path: dist
inspect-pypi-assets:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: get dist artifacts
uses: actions/download-artifact@v3
with:
name: pypi_files
path: dist
- name: list dist files
run: |
ls -lh dist/
echo "`ls dist | wc -l` files"
- name: extract and list sdist file
run: |
mkdir sdist-files
tar -xvf dist/*.tar.gz -C sdist-files
tree -a sdist-files
- name: extract and list wheel file
run: |
ls dist/*.whl | head -n 1
python -m zipfile --list `ls dist/*.whl | head -n 1`
release:
needs: [build, check]
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'poetry'
- id: check-version
name: check package version
run: .github/check-version.py
- name: get dist artifacts
uses: actions/download-artifact@v3
with:
name: pypi_files
path: dist
- name: upload to pypi
run: poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.pypi_token }}
- name: upload to github release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*
generate_release_notes: true
prerelease: ${{ steps.check-version.output.is_prerelease }}