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

chore: support Python 3.11 #155

Merged
merged 12 commits into from Feb 5, 2022
25 changes: 22 additions & 3 deletions .github/dependabot.yml
Expand Up @@ -5,13 +5,32 @@

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
interval: daily
time: "14:38"
timezone: "America/Mexico_City"
reviewers:
- "edgarrmondragon"
labels:
- "dependencies"
versioning-strategy: lockfile-only
allow:
- dependency-type: "all"
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: daily
time: "14:38"
timezone: "America/Mexico_City"
reviewers:
- "edgarrmondragon"
labels:
- "dependencies"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
reviewers:
- "edgarrmondragon"
5 changes: 5 additions & 0 deletions .github/workflows/constraints.txt
@@ -0,0 +1,5 @@
pip==21.3.1
nox==2022.1.7
nox-poetry==0.9.0
poetry==1.1.12
virtualenv==20.13.0
18 changes: 0 additions & 18 deletions .github/workflows/coverage.yml

This file was deleted.

57 changes: 32 additions & 25 deletions .github/workflows/release.yml
Expand Up @@ -10,28 +10,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: x64

- name: Install Dependencies
run: pip install poetry==1.1.11

- name: Check version
run: |
version=$(poetry version | awk '{print $2}')
tag=$(echo "${{ github.ref }}" | awk '{split($0,p,"/"); print p[3]}')
if [ $version != $tag ]; then echo "Release tag and package version do not match!"; exit 1; fi;
- name: Build
run: poetry build

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: Checkout code
uses: actions/checkout@v2.4.0

- name: Set up Python
uses: actions/setup-python@v2.3.1
with:
python-version: "3.10"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version

- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
poetry --version

- name: Check version
run: |
version=$(poetry version | awk '{print $2}')
tag=$(echo "${{ github.ref }}" | awk '{split($0,p,"/"); print p[3]}')
if [ $version != $tag ]; then echo "Release tag and package version do not match!"; exit 1; fi;

- name: Build
run: poetry build

- name: Publish
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
124 changes: 113 additions & 11 deletions .github/workflows/tests.yml
@@ -1,21 +1,123 @@
name: Tests
on: push
on:
- push
- pull_request
jobs:
tests:
name: ${{ matrix.session }} ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
env:
SETUPTOOLS_USE_DISTUTILS: stdlib
NOXSESSION: ${{ matrix.session }}
FORCE_COLOR: "1"
strategy:
fail-fast: true
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
name: Python ${{ matrix.python-version }}
include:
- { python-version: "3.10", os: "ubuntu-latest", session: "lint", experimental: false }
- { python-version: "3.10", os: "ubuntu-latest", session: "black-check", experimental: false }
- { python-version: "3.10", os: "ubuntu-latest", session: "safety", experimental: false }
- { python-version: "3.10", os: "ubuntu-latest", session: "mypy", experimental: false }
- { python-version: "3.9", os: "ubuntu-latest", session: "mypy", experimental: false }
- { python-version: "3.8", os: "ubuntu-latest", session: "mypy", experimental: false }
- { python-version: "3.7", os: "ubuntu-latest", session: "mypy", experimental: false }
- { python-version: "3.6", os: "ubuntu-latest", session: "mypy", experimental: false }
- { python-version: "3.11", os: "ubuntu-latest", session: "tests", experimental: true, pre-release: "3.11.0-alpha.5" }
- { python-version: "3.10", os: "ubuntu-latest", session: "tests", experimental: false }
- { python-version: "3.9", os: "ubuntu-latest", session: "tests", experimental: false }
- { python-version: "3.8", os: "ubuntu-latest", session: "tests", experimental: false }
- { python-version: "3.7", os: "ubuntu-latest", session: "tests", experimental: false }
- { python-version: "3.6", os: "ubuntu-latest", session: "tests", experimental: false }
- { python-version: "3.10", os: "windows-latest", session: "tests", experimental: false }
- { python-version: "3.10", os: "macos-latest", session: "tests", experimental: false }
- { python-version: "3.10", os: "ubuntu-latest", session: "xdoctest", experimental: false }

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Check out the repository
uses: actions/checkout@v2.4.0

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.3.1
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.pre-release || matrix.python-version }}
architecture: x64
- run: pip install nox==2021.10.1
- run: pip install poetry==1.1.11
- run: nox --python=${{ matrix.python-version }} --sessions tests lint mypy pytype safety

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version

- name: Upgrade pip in virtual environments
shell: python
run: |
import os
import pip

with open(os.environ["GITHUB_ENV"], mode="a") as io:
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)

- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
poetry --version

- name: Install Nox
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry
nox --version

- name: Run Nox
run: |
nox --python=${{ matrix.python-version }}

- name: Upload coverage data
if: always() && matrix.session == 'tests'
uses: actions/upload-artifact@v2
with:
name: coverage-data
path: ".coverage.*"

coverage:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Check out the repository
uses: actions/checkout@v2.4.0

- name: Set up Python
uses: actions/setup-python@v2.3.1
with:
python-version: "3.10"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version

- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
poetry --version

- name: Install Nox
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry
nox --version

- name: Download coverage data
uses: actions/download-artifact@v2.1.0
with:
name: coverage-data

- name: Combine coverage data and display human readable report
run: |
nox --session=coverage

- name: Create coverage report
run: |
nox --session=coverage -- xml

- name: Upload coverage report
uses: codecov/codecov-action@v2.1.0
8 changes: 8 additions & 0 deletions codecov.yml
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
target: "100"
patch:
default:
target: "100"