Skip to content

Add support for Python 3.11 #358

Add support for Python 3.11

Add support for Python 3.11 #358

Workflow file for this run

name: CI
on:
push:
branches:
- 'master'
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches:
- 'master'
- '[0-9].[0-9]+.[0-9]+'
jobs:
test:
name: Test ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
fail-fast: true
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python ${{ matrix.pyver }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# cache: 'pipenv'
- name: Download dependencies
run: |
python -c "import sys; print(f'Python version: {sys.version}')"
python -m pip install -U setuptools pip pipenv codecov wheel
pipenv lock --python ${{ matrix.python-version }}
pipenv sync --dev
pipenv check || true
pipenv graph
- name: Run flake
if: matrix.python-version != '3.7'
run: |
make flake
- name: Run unittests
env:
COLOR: 'yes'
run: |
make mototest
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./coverage.xml
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
path_to_write_report: ./codecov_report.txt
verbose: true # optional (default = false)
pre-deploy:
name: Pre-Deploy
runs-on: ubuntu-latest
needs: test
# Run only on pushing a tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Dummy
run: |
echo "Predeploy step"
build-tarball:
name: Tarball
runs-on: ubuntu-latest
needs: pre-deploy
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Make distributions (sdist and wheel)
run: |
python -c "import sys; print(f'Python version: {sys.version}')"
python -m pip install -U setuptools pip wheel
python setup.py sdist bdist_wheel
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
deploy:
name: Deploy
needs: [build-tarball]
runs-on: ubuntu-latest
steps:
- name: Setup Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install twine
run: |
python -m pip install twine
- name: Download dists
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: PyPI upload
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*