Skip to content

Commit

Permalink
Merge pull request #213 from asottile/all-repos_autofix_all-repos-manual
Browse files Browse the repository at this point in the history
py39+
  • Loading branch information
asottile authored Oct 11, 2024
2 parents 82de14b + df21f38 commit b8fe20a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:

jobs:
main-windows:
uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0
uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0
with:
env: '["py38"]'
env: '["py39"]'
os: windows-latest
main-linux:
uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0
uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0
with:
env: '["py38", "py39", "py310", "py311"]'
env: '["py39", "py310", "py311", "py312"]'
os: ubuntu-latest
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
rev: v3.13.0
hooks:
- id: reorder-python-imports
args: [--py38-plus, --add-import, 'from __future__ import annotations']
args: [--py39-plus, --add-import, 'from __future__ import annotations']
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
Expand All @@ -26,7 +26,7 @@ repos:
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py39-plus]
- repo: https://github.com/hhatto/autopep8
rev: v2.3.1
hooks:
Expand Down
14 changes: 7 additions & 7 deletions classify_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import os.path
import stat
import sys
from collections.abc import Generator
from collections.abc import Iterable
from typing import Callable
from typing import Generator
from typing import Iterable
from typing import NamedTuple


Expand Down Expand Up @@ -65,7 +65,7 @@ def _find_local(path: tuple[str, ...], base: str) -> bool:


if sys.version_info >= (3, 10): # pragma: >=3.10 cover
@functools.lru_cache(maxsize=None)
@functools.cache
def _get_app(app_dirs: tuple[str, ...]) -> tuple[str, ...]:
app_dirs_ret = []
filtered_stats = set()
Expand All @@ -81,7 +81,7 @@ def _get_app(app_dirs: tuple[str, ...]) -> tuple[str, ...]:

return tuple(app_dirs_ret)

@functools.lru_cache(maxsize=None)
@functools.cache
def classify_base(base: str, settings: Settings = Settings()) -> str:
try:
return _STATIC_CLASSIFICATIONS[base]
Expand All @@ -103,7 +103,7 @@ def classify_base(base: str, settings: Settings = Settings()) -> str:

_BUILTIN_MODS = frozenset(sys.builtin_module_names)

@functools.lru_cache(maxsize=None)
@functools.cache
def _get_path(
sys_path: tuple[str, ...],
app_dirs: tuple[str, ...],
Expand Down Expand Up @@ -149,7 +149,7 @@ def _get_path(
)
return finder, tuple(app_dirs_ret)

@functools.lru_cache(maxsize=None)
@functools.cache
def classify_base(base: str, settings: Settings = Settings()) -> str:
try:
return _STATIC_CLASSIFICATIONS[base]
Expand Down Expand Up @@ -298,7 +298,7 @@ def __repr__(self) -> str:
_import_type = {ast.Import: Import, ast.ImportFrom: ImportFrom}


@functools.lru_cache(maxsize=None)
@functools.cache
def import_obj_from_str(s: str) -> Import | ImportFrom:
node = ast.parse(s, mode='single').body[0]
return _import_type[type(node)](node)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ classifiers =

[options]
py_modules = classify_imports
python_requires = >=3.8
python_requires = >=3.9

[bdist_wheel]
universal = True
Expand Down

0 comments on commit b8fe20a

Please sign in to comment.