π Add docstrings to simpler-syntax
(#40)
#221
Workflow file for this run
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 workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python library with poetry | |
on: | |
push: | |
paths: | |
- 'cliffy/**' | |
- 'tests/**' | |
- 'examples/**' | |
- '!examples/generated/**' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
matrix: | |
extras: [true, false] | |
python-version: [ "3.12", "3.11", "3.10", "3.9" ] | |
os: [ubuntu-latest, windows-latest] # macos-latest | |
defaults: | |
run: | |
shell: bash | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1.3.3 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.extras }} | |
- name: Set poetry python version | |
run: poetry env use ${pythonLocation}/bin/python | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
- name: Set poetry python version | |
run: poetry env use ${pythonLocation}\\python.exe | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-root | |
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.extras == false }} | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-root --all-extras | |
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.extras }} | |
- name: Install library | |
run: poetry install --no-interaction | |
if: ${{ matrix.extras == false }} | |
- name: Install library | |
run: poetry install --no-interaction --all-extras | |
if: ${{ matrix.extras }} | |
- name: Code quality | |
run: | | |
source $VENV | |
poetry run make lint | |
- name: Test with pytest | |
run: | | |
source $VENV | |
poetry run make test |