Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit d167b2d

Browse files
authored
Merge pull request #815 from staticdev/feature/python-3.11
Python 3.11 improvements
2 parents 5b8a313 + a03e2ae commit d167b2d

25 files changed

+335
-396
lines changed

.flake8

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
[flake8]
2-
select = B,B9,C,D,E,F,N,RST,W
2+
select = B,B9,C,D,E,F,N,W
33
ignore = E203,E501,W503
44
max-line-length = 80
55
max-complexity = 10
66
docstring-convention = google
7-
rst-roles = class,const,func,meth,mod,ref
8-
rst-directives = deprecated
97
; darglint
108
strictness = long

.github/workflows/tests.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
include:
15-
- { python: "3.10", os: "ubuntu-latest", session: "pre-commit" }
16-
- { python: "3.10", os: "ubuntu-latest", session: "safety" }
15+
- { python: "3.11", os: "ubuntu-latest", session: "pre-commit" }
16+
- { python: "3.11", os: "ubuntu-latest", session: "safety" }
17+
- { python: "3.11", os: "ubuntu-latest", session: "mypy" }
1718
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
1819
- { python: "3.9", os: "ubuntu-latest", session: "mypy" }
20+
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
1921
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
2022
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
21-
- { python: "3.10", os: "windows-latest", session: "tests" }
22-
- { python: "3.10", os: "macos-latest", session: "tests" }
23-
# - { python: "3.10", os: "ubuntu-latest", session: "typeguard" }
24-
- { python: "3.10", os: "ubuntu-latest", session: "xdoctest" }
23+
- { python: "3.11", os: "windows-latest", session: "tests" }
24+
- { python: "3.11", os: "macos-latest", session: "tests" }
25+
# - { python: "3.11", os: "ubuntu-latest", session: "typeguard" }
26+
- { python: "3.11", os: "ubuntu-latest", session: "xdoctest" }
2527

2628
env:
2729
NOXSESSION: ${{ matrix.session }}

.pre-commit-config.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,20 @@ repos:
4040
language: system
4141
types: [python]
4242
require_serial: true
43+
- id: isort
44+
name: isort
45+
entry: isort
46+
require_serial: true
47+
language: system
48+
types_or: [cython, pyi, python]
49+
args: ["--filter-files"]
4350
- id: pyupgrade
4451
name: pyupgrade
4552
description: Automatically upgrade syntax for newer versions.
4653
entry: pyupgrade
4754
language: system
4855
types: [python]
49-
args: [--py37-plus]
50-
- id: reorder-python-imports
51-
name: Reorder python imports
52-
entry: reorder-python-imports
53-
language: system
54-
types: [python]
55-
args: [--application-directories=src]
56+
args: [--py38-plus]
5657
- id: trailing-whitespace
5758
name: Trim Trailing Whitespace
5859
entry: trailing-whitespace-fixer

mypy.ini

Lines changed: 0 additions & 16 deletions
This file was deleted.

noxfile.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import nox
1010

11+
1112
try:
1213
from nox_poetry import Session
1314
from nox_poetry import session
@@ -20,7 +21,7 @@
2021

2122

2223
package = "git_portfolio"
23-
python_versions = ["3.10", "3.9"]
24+
python_versions = ["3.11", "3.10", "3.9"]
2425
nox.options.sessions = (
2526
"pre-commit",
2627
"safety",
@@ -101,7 +102,7 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None:
101102
break
102103

103104

104-
@session(name="pre-commit", python="3.10")
105+
@session(name="pre-commit", python=python_versions[0])
105106
def precommit(session: Session) -> None:
106107
"""Lint using pre-commit."""
107108
args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"]
@@ -112,19 +113,18 @@ def precommit(session: Session) -> None:
112113
"flake8",
113114
"flake8-bugbear",
114115
"flake8-docstrings",
115-
"flake8-rst-docstrings",
116+
"isort",
116117
"pep8-naming",
117118
"pre-commit",
118119
"pre-commit-hooks",
119120
"pyupgrade",
120-
"reorder-python-imports",
121121
)
122122
session.run("pre-commit", *args)
123123
if args and args[0] == "install":
124124
activate_virtualenv_in_precommit_hooks(session)
125125

126126

127-
@session(python="3.10")
127+
@session(python=python_versions[0])
128128
def safety(session: Session) -> None:
129129
"""Scan dependencies for insecure packages."""
130130
requirements = session.poetry.export_requirements()
@@ -188,7 +188,7 @@ def xdoctest(session: Session) -> None:
188188
session.run("python", "-m", "xdoctest", package, *args)
189189

190190

191-
@session(name="docs-build", python="3.10")
191+
@session(name="docs-build", python=python_versions[0])
192192
def docs_build(session: Session) -> None:
193193
"""Build the documentation with linkcheck."""
194194
args = session.posargs or [
@@ -212,7 +212,7 @@ def docs_build(session: Session) -> None:
212212
session.run("sphinx-build", *args)
213213

214214

215-
@session(python="3.10")
215+
@session(python=python_versions[0])
216216
def docs(session: Session) -> None:
217217
"""Build and serve the documentation with live reloading on file changes."""
218218
args = session.posargs or ["--open-browser", "docs", "docs/_build"]

0 commit comments

Comments
 (0)