mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
parent
99fa9ba5ef
commit
f415f6c4d7
10 changed files with 13 additions and 14 deletions
4
.github/workflows/languages.yaml
vendored
4
.github/workflows/languages.yaml
vendored
|
|
@ -21,7 +21,7 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: '3.10'
|
||||||
- name: install deps
|
- name: install deps
|
||||||
run: python -mpip install -e . -r requirements-dev.txt
|
run: python -mpip install -e . -r requirements-dev.txt
|
||||||
- name: vars
|
- name: vars
|
||||||
|
|
@ -39,7 +39,7 @@ jobs:
|
||||||
- uses: asottile/workflows/.github/actions/fast-checkout@v1.8.1
|
- uses: asottile/workflows/.github/actions/fast-checkout@v1.8.1
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: '3.10'
|
||||||
|
|
||||||
- run: echo "$CONDA\Scripts" >> "$GITHUB_PATH"
|
- run: echo "$CONDA\Scripts" >> "$GITHUB_PATH"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
|
|
@ -14,10 +14,10 @@ jobs:
|
||||||
main-windows:
|
main-windows:
|
||||||
uses: asottile/workflows/.github/workflows/tox.yml@v1.8.1
|
uses: asottile/workflows/.github/workflows/tox.yml@v1.8.1
|
||||||
with:
|
with:
|
||||||
env: '["py39"]'
|
env: '["py310"]'
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
main-linux:
|
main-linux:
|
||||||
uses: asottile/workflows/.github/workflows/tox.yml@v1.8.1
|
uses: asottile/workflows/.github/workflows/tox.yml@v1.8.1
|
||||||
with:
|
with:
|
||||||
env: '["py39", "py310", "py311", "py312"]'
|
env: '["py310", "py311", "py312", "py313"]'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: reorder-python-imports
|
- id: reorder-python-imports
|
||||||
exclude: ^(pre_commit/resources/|testing/resources/python3_hooks_repo/)
|
exclude: ^(pre_commit/resources/|testing/resources/python3_hooks_repo/)
|
||||||
args: [--py39-plus, --add-import, 'from __future__ import annotations']
|
args: [--py310-plus, --add-import, 'from __future__ import annotations']
|
||||||
- repo: https://github.com/asottile/add-trailing-comma
|
- repo: https://github.com/asottile/add-trailing-comma
|
||||||
rev: v3.2.0
|
rev: v3.2.0
|
||||||
hooks:
|
hooks:
|
||||||
|
|
@ -27,7 +27,7 @@ repos:
|
||||||
rev: v3.20.0
|
rev: v3.20.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py39-plus]
|
args: [--py310-plus]
|
||||||
- repo: https://github.com/hhatto/autopep8
|
- repo: https://github.com/hhatto/autopep8
|
||||||
rev: v2.3.2
|
rev: v2.3.2
|
||||||
hooks:
|
hooks:
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
import functools
|
import functools
|
||||||
import itertools
|
import itertools
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Callable
|
from collections.abc import Callable
|
||||||
|
|
||||||
import cfgv
|
import cfgv
|
||||||
import yaml
|
import yaml
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
||||||
import contextlib
|
import contextlib
|
||||||
import errno
|
import errno
|
||||||
import sys
|
import sys
|
||||||
|
from collections.abc import Callable
|
||||||
from collections.abc import Generator
|
from collections.abc import Generator
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
|
|
||||||
if sys.platform == 'win32': # pragma: no cover (windows)
|
if sys.platform == 'win32': # pragma: no cover (windows)
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,7 @@ def _infer_go_version(version: str) -> str:
|
||||||
if version != C.DEFAULT:
|
if version != C.DEFAULT:
|
||||||
return version
|
return version
|
||||||
resp = urllib.request.urlopen('https://go.dev/dl/?mode=json')
|
resp = urllib.request.urlopen('https://go.dev/dl/?mode=json')
|
||||||
# TODO: 3.9+ .removeprefix('go')
|
return json.load(resp)[0]['version'].removeprefix('go')
|
||||||
return json.load(resp)[0]['version'][2:]
|
|
||||||
|
|
||||||
|
|
||||||
def _get_url(version: str) -> str:
|
def _get_url(version: str) -> str:
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ import logging
|
||||||
import os.path
|
import os.path
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import tempfile
|
import tempfile
|
||||||
|
from collections.abc import Callable
|
||||||
from collections.abc import Generator
|
from collections.abc import Generator
|
||||||
from collections.abc import Sequence
|
from collections.abc import Sequence
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
import pre_commit.constants as C
|
import pre_commit.constants as C
|
||||||
from pre_commit import clientlib
|
from pre_commit import clientlib
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ import shutil
|
||||||
import stat
|
import stat
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from collections.abc import Callable
|
||||||
from collections.abc import Generator
|
from collections.abc import Generator
|
||||||
from types import TracebackType
|
from types import TracebackType
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from pre_commit import parse_shebang
|
from pre_commit import parse_shebang
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,12 @@ import multiprocessing
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from collections.abc import Callable
|
||||||
from collections.abc import Generator
|
from collections.abc import Generator
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from collections.abc import MutableMapping
|
from collections.abc import MutableMapping
|
||||||
from collections.abc import Sequence
|
from collections.abc import Sequence
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Callable
|
|
||||||
from typing import TypeVar
|
from typing import TypeVar
|
||||||
|
|
||||||
from pre_commit import parse_shebang
|
from pre_commit import parse_shebang
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ install_requires =
|
||||||
nodeenv>=0.11.1
|
nodeenv>=0.11.1
|
||||||
pyyaml>=5.1
|
pyyaml>=5.1
|
||||||
virtualenv>=20.10.0
|
virtualenv>=20.10.0
|
||||||
python_requires = >=3.9
|
python_requires = >=3.10
|
||||||
|
|
||||||
[options.packages.find]
|
[options.packages.find]
|
||||||
exclude =
|
exclude =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue