Skip to content

fix docstring

fix docstring #97

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
#TODO: move lint to separate job
#TODO: coverage tests in separate job
name: Python package
on:
push:
branches: [ "main","feature/**","development"]
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
branches: [ "main","development"]
types: [opened, reopened]
jobs:
test-and-lint:
name: Test and lint package
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test,tox_gh,tox,mypy,flake8]
# Linting step only runs for Python 3.8
- name: mypy
if: matrix.python-version == '3.8'
run: mypy -p corbado_python_sdk --exclude generated --strict --disable-error-code attr-defined
- name: lint with flake8
if: matrix.python-version == '3.8'
run: flake8 .
- name: Test with tox
run: |
tox run
env:
CORBADO_BACKEND_API: ${{ secrets.CORBADO_BACKEND_API }}
CORBADO_API_SECRET: ${{ secrets.CORBADO_API_SECRET }}
CORBADO_PROJECT_ID: ${{ secrets.CORBADO_PROJECT_ID }}
build:
if: startsWith(github.ref, 'refs/tags/v') # only make separate build and upload for tag pushes
name: Build and upload distribution package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: >-
Publish Python distribution package to PyPI
if: startsWith(github.ref, 'refs/tags/v') # only publish to PyPI on tag pushes
needs: [build,test-and-lint] # Ensure that package was built and tested for all python versions before publishing
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/passkeys
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1