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

Add support for Python 3.12, drop EOL 3.7, add pyupgrade pre-commit hook #139

Merged
merged 6 commits into from
Oct 28, 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
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"
Expand All @@ -21,12 +21,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
cache: pip

- run: pip install nox
- run: nox --session test-${{ matrix.python-version }}
30 changes: 15 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
repos:
- repo: https://github.com/psf/black
rev: 22.10.0
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.1
hooks:
- id: black
args:
- --target-version=py37
- --target-version=py38
- --target-version=py39
- --target-version=py310
- --target-version=py311

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
files: \.py$
args: ["--profile", "black"]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: check-builtin-literals
- id: check-added-large-files
Expand All @@ -35,14 +35,14 @@ repos:
- id: forbid-new-submodules
- id: trailing-whitespace

- repo: https://github.com/PyCQA/pydocstyle.git
rev: '6.1.1'
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
files: src/.*\.py$

- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==22.10.0]
additional_dependencies: [black==23.10.1]
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def lint(session):
session.run("pre-commit", "run", "--all-files", *session.posargs)


@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"])
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
def test(session):
_install_this_editable(session, extras=["test"])

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
]
license = {file = "LICENSE"}
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"sphinx",
"livereload",
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx_autobuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def show(*, context=None, command=None):
_log(context, colour=Fore.CYAN)
if command is not None:
assert isinstance(command, (list, tuple))
_log("> " + " ".join(shlex.quote(s) for s in command), colour=Fore.BLUE)
_log("> " + shlex.join(command), colour=Fore.BLUE)


def get_builder(watcher, sphinx_args, *, host, port, pre_build_commands):
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx_autobuild/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class RawTextArgumentDefaultsHelpFormatter(
help="additional command(s) to run prior to building the documentation",
)
parser.add_argument(
"--version", action="version", version="sphinx-autobuild {}".format(__version__)
"--version", action="version", version=f"sphinx-autobuild {__version__}"
)

sphinx_arguments = ", ".join(
Expand Down