Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: python38 support and tox without errors #26

Merged
merged 9 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/action-options.json

This file was deleted.

59 changes: 39 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,44 @@ on:
repository_dispatch:
types: [release-made]
jobs:
deploy:
runs-on: ubuntu-20.04
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-11]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
python-version: 3.9
- name: Install build meta-dependencies
run: |
pip install poetry tox
- name: Test with tox
run: |
tox -v
- name: Build sdists and wheels with Poetry
run: |
poetry build
poetry install
- name: Publish to PyPi
run: |
poetry publish -vv --username __token__ --password ${{ secrets.PYPI_TOKEN }}
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
21 changes: 5 additions & 16 deletions .github/workflows/pull-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,10 @@ on:
jobs:
build:
strategy:
max-parallel: 1
matrix:
os: [ubuntu-20.04]
python-version: ["3.9"]
runs-on: "${{ matrix.os }}"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Install build meta-dependencies
run: |
pip install tox poetry
- name: Test with tox
run: |
tox -v
python-version: ["3.8", "3.9", "3.10", "3.11"]
uses: ./.github/workflows/test.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
38 changes: 8 additions & 30 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,20 @@ on:
push:
branches: [main, master]
jobs:
build:
strategy:
max-parallel: 1
matrix:
os: [ubuntu-20.04]
python-version: ["3.9"]
runs-on: "${{ matrix.os }}"
coverage:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: read action options
id: read_options
run: |
json=`cat .github/action-options.json`
USE_SLACK=`echo $(jq -r '.use_slack' <<< "$json")`
- name: "Set up Python ${{ matrix.python-version }}"
- name: "Set up Python 3.11"
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
python-version: "3.11"
- name: Install build meta-dependencies
run: |
pip install poetry tox
pip install poetry tox-gh>=1.2
- name: Test with tox
run: |
tox -v
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update codecov
run: |
pip install 'codecov>=2.1,<3.0'
codecov || true
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,action,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
if: always() && steps.read_options.outputs.USE_SLACK=='true'
tox -e coverage
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Runs tests via tox
name: test
on:
workflow_call:
inputs:
python-version:
description: "The python version to use"
default: "3.9"
required: false
type: string
os:
description: "The OS to use"
default: "ubuntu-20.04"
required: false
type: string
jobs:
build:
runs-on: "${{ inputs.os }}"
steps:
- name: Free up space
uses: jlumbroso/[email protected]
with:
tool-cache: false
- name: Checkout
uses: actions/checkout@v4
- name: "Set up Python ${{ inputs.python-version }} "
uses: actions/setup-python@v4
with:
python-version: "${{ inputs.python-version }} "
- name: Install build meta-dependencies
run: |
pip install poetry tox-gh>=1.2
- name: Setup test suite
run: |
tox -vv --notest
- name: Test with tox
run: |
tox --skip-pkg-install
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Uses several extensions to get API docs and sourcecode.
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""
# mypy: ignore-errors

from pathlib import Path
from typing import Optional, Type, TypeVar
Expand Down
Loading
Loading