Skip to content

Commit c99d212

Browse files
committed
drop python3.6 support
python 3.6 reached end of life on 2021-12-23 Committed via https://github.com/asottile/all-repos
1 parent 9112a63 commit c99d212

File tree

12 files changed

+31
-20
lines changed

12 files changed

+31
-20
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ repos:
2121
rev: v2.6.0
2222
hooks:
2323
- id: reorder-python-imports
24-
args: [--py3-plus]
24+
args: [--py37-plus, --add-import, 'from __future__ import annotations']
2525
- repo: https://github.com/asottile/pyupgrade
2626
rev: v2.31.0
2727
hooks:
2828
- id: pyupgrade
29-
args: [--py3-plus]
29+
args: [--py37-plus]
3030
- repo: https://github.com/asottile/add-trailing-comma
3131
rev: v2.2.1
3232
hooks:

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ resources:
1010
type: github
1111
endpoint: github
1212
name: asottile/azure-pipeline-templates
13-
ref: refs/tags/v2.1.0
13+
ref: refs/tags/v2.4.0
1414

1515
jobs:
1616
- template: job--python-tox.yml@asottile
1717
parameters:
18-
toxenvs: [pypy3, py36, py37, py38]
18+
toxenvs: [py37, py38]
1919
os: linux

pre_commit_mirror_maker/languages.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,45 @@
1+
from __future__ import annotations
2+
13
import json
24
import subprocess
35
import urllib.request
4-
from typing import List
56

67
from packaging import version
78

89

9-
def ruby_get_package_versions(package_name: str) -> List[str]:
10+
def ruby_get_package_versions(package_name: str) -> list[str]:
1011
url = f'https://rubygems.org/api/v1/versions/{package_name}.json'
1112
resp = json.load(urllib.request.urlopen(url))
1213
return list(reversed([version['number'] for version in resp]))
1314

1415

15-
def node_get_package_versions(package_name: str) -> List[str]:
16+
def node_get_package_versions(package_name: str) -> list[str]:
1617
cmd = ('npm', 'view', package_name, '--json')
1718
output = json.loads(subprocess.check_output(cmd))
1819
return output['versions']
1920

2021

21-
def python_get_package_versions(package_name: str) -> List[str]:
22+
def python_get_package_versions(package_name: str) -> list[str]:
2223
url = f'https://pypi.org/pypi/{package_name}/json'
2324
resp = json.load(urllib.request.urlopen(url))
2425
return sorted(resp['releases'], key=lambda k: version.parse(k))
2526

2627

27-
def rust_get_package_versions(package_name: str) -> List[str]:
28+
def rust_get_package_versions(package_name: str) -> list[str]:
2829
url = f'https://crates.io/api/v1/crates/{package_name}'
2930
resp = json.load(urllib.request.urlopen(url))
3031
return list(reversed([version['num'] for version in resp['versions']]))
3132

3233

3334
def node_get_additional_dependencies(
3435
package_name: str, package_version: str,
35-
) -> List[str]:
36+
) -> list[str]:
3637
return [f'{package_name}@{package_version}']
3738

3839

3940
def rust_get_additional_dependencies(
4041
package_name: str, package_version: str,
41-
) -> List[str]:
42+
) -> list[str]:
4243
return [f'cli:{package_name}:{package_version}']
4344

4445

pre_commit_mirror_maker/main.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1+
from __future__ import annotations
2+
13
import argparse
24
import json
3-
from typing import List
4-
from typing import Optional
55
from typing import Sequence
6-
from typing import Tuple
76

87
from pre_commit_mirror_maker.make_repo import LIST_VERSIONS
98
from pre_commit_mirror_maker.make_repo import make_repo
109

1110

12-
def split_by_commas(maybe_s: str) -> Tuple[str, ...]:
11+
def split_by_commas(maybe_s: str) -> tuple[str, ...]:
1312
"""Split a string by commas, but allow escaped commas.
1413
- If maybe_s is falsey, returns an empty tuple
1514
- Ignore backslashed commas
1615
"""
1716
if not maybe_s:
1817
return ()
19-
parts: List[str] = []
18+
parts: list[str] = []
2019
split_by_backslash = maybe_s.split(r'\,')
2120
for split_by_backslash_part in split_by_backslash:
2221
splitby_comma = split_by_backslash_part.split(',')
@@ -28,7 +27,7 @@ def split_by_commas(maybe_s: str) -> Tuple[str, ...]:
2827
return tuple(parts)
2928

3029

31-
def main(argv: Optional[Sequence[str]] = None) -> int:
30+
def main(argv: Sequence[str] | None = None) -> int:
3231
parser = argparse.ArgumentParser()
3332
parser.add_argument(
3433
'repo_path',

pre_commit_mirror_maker/make_repo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import json
24
import os.path
35
import subprocess

pre_commit_mirror_maker/python/setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from setuptools import setup
24

35

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ classifiers =
1414
License :: OSI Approved :: MIT License
1515
Programming Language :: Python :: 3
1616
Programming Language :: Python :: 3 :: Only
17-
Programming Language :: Python :: 3.6
1817
Programming Language :: Python :: 3.7
1918
Programming Language :: Python :: Implementation :: CPython
2019
Programming Language :: Python :: Implementation :: PyPy
2120

2221
[options]
2322
packages = find:
2423
install_requires = packaging
25-
python_requires = >=3.6.1
24+
python_requires = >=3.7
2625

2726
[options.entry_points]
2827
console_scripts =

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
from __future__ import annotations
2+
13
from setuptools import setup
24
setup()

tests/languages_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from pre_commit_mirror_maker.languages import node_get_package_versions
24
from pre_commit_mirror_maker.languages import python_get_package_versions
35
from pre_commit_mirror_maker.languages import ruby_get_package_versions

tests/main_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from unittest import mock
24

35
import pytest

0 commit comments

Comments
 (0)