Skip to content

Commit

Permalink
Support Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed May 2, 2022
1 parent f3853ee commit fd8e07a
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 19 deletions.
25 changes: 25 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
time: "03:00"
open-pull-requests-limit: 10
labels:
- "changelog: skip"
- "dependencies"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-minor"
- "version-update:semver-patch"
- package-ecosystem: pip
directory: "/"
schedule:
interval: monthly
time: "03:00"
open-pull-requests-limit: 10
labels:
- "changelog: skip"
- "dependencies"
8 changes: 7 additions & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Default GitHub labels.
# Default GitHub labels
- color: d73a4a
description: "Something isn't working"
name: bug
Expand Down Expand Up @@ -52,12 +52,18 @@
- color: 0366d6
description: "For dependencies and dependabot"
name: dependencies
- color: 0052cc
description: "Documentation"
name: docs
- color: f4660e
description: ""
name: Hacktoberfest
- color: f4660e
description: "To credit accepted Hacktoberfest PRs"
name: hacktoberfest-accepted
- color: d65e88
description: "Deploy and release"
name: release
- color: fbca04
description: "Unit tests, linting, CI, etc."
name: testing
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
deploy:
if: github.repository_owner == 'hugovk'
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
Expand All @@ -24,7 +24,7 @@ jobs:
with:
python-version: "3.10"
cache: pip
cache-dependency-path: "setup.cfg"
cache-dependency-path: setup.cfg

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch]

jobs:
lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
# Include new variables for Codecov
- { codecov-flag: GHA_Ubuntu, os: ubuntu-latest }
- { codecov-flag: GHA_macOS, os: macos-latest }
- { codecov-flag: GHA_Windows, os: windows-latest }
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
os: [windows-latest, macos-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v3
Expand All @@ -27,7 +22,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "setup.cfg"
cache-dependency-path: setup.cfg

- name: Install dependencies
run: |
Expand Down Expand Up @@ -55,9 +50,9 @@ jobs:
git diff --name-only --exit-code
- name: Upload coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.codecov-flag }}
flags: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

success:
Expand Down
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v2.32.0
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand Down Expand Up @@ -28,7 +28,7 @@ repos:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: check-json
- id: check-merge-conflict
Expand All @@ -43,6 +43,12 @@ repos:
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
args: [--max-py-version=3.11]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.3.3
hooks:
- id: pyproject-fmt

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 0.5.2
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=45",
"setuptools_scm[toml]>=6.2",
"wheel",
]

[tool.black]
target_version = ["py37"]
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
keywords =
CLI
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup


def local_scheme(version):
def local_scheme(version: str) -> str:
"""Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2)
to be able to upload to Test PyPI"""
return ""
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
envlist =
cli
lint
py{310, 39, 38, 37}
py{311, 310, 39, 38, 37}

[testenv]
extras =
Expand Down

0 comments on commit fd8e07a

Please sign in to comment.