Skip to content

Commit

Permalink
drop python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Oct 6, 2024
1 parent 9592f36 commit 4537325
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Changelog
*`shed` uses [calendar versioning](https://calver.org/), with a year.month.patch scheme.*

#### 2024.10.1 - 2024-04-27
- Disable `PIE790` fix due to [ruff issue #10538](https://github.com/astral-sh/ruff/issues/10538)
- [Python 3.8 has reached end-of-life](https://devguide.python.org/versions/),
so `shed` targets and runs on Python 3.9 or later.

#### 2024.3.1 - 2024-03-13
- Replace usage of Autoflake, PyUpgrade and isort with ruff.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ adding the following to your `.pre-commit-config.yaml`:
minimum_pre_commit_version: '2.9.0'
repos:
- repo: https://github.com/Zac-HD/shed
rev: 2024.3.1
rev: 2024.10.1
hooks:
- id: shed
# args: [--refactor, --py311-plus]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"pyupgrade >= 3.15.0",
"ruff",
],
python_requires=">=3.8",
python_requires=">=3.9",
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU Affero General Public License v3",
Expand Down
7 changes: 4 additions & 3 deletions src/shed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import textwrap
import warnings
from operator import attrgetter
from typing import Any, FrozenSet, Match, Tuple
from re import Match
from typing import Any, FrozenSet, Tuple

import black
from black.mode import TargetVersion
from black.parsing import lib2to3_parse

__version__ = "2024.4.1"
__version__ = "2024.10.1"
__all__ = ["shed", "docshed"]

# Conditionally imported in refactor mode to reduce startup latency in the common case
Expand All @@ -28,7 +29,7 @@
_version_map = {
k: (int(k.name[2]), int(k.name[3:]))
for k in TargetVersion
if k.value >= TargetVersion.PY38.value
if k.value >= TargetVersion.PY39.value
}
_default_min_version = min(_version_map.values())
_SUGGESTIONS = (
Expand Down
2 changes: 1 addition & 1 deletion src/shed/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _guess_first_party_modules(cwd: Optional[str] = None) -> FrozenSet[str]:
)


@functools.lru_cache(maxsize=None)
@functools.cache
def _should_format(fname: str) -> bool:
return fname.endswith((".md", ".rst", ".pyi")) or is_python_file(fname)

Expand Down
3 changes: 0 additions & 3 deletions src/shed/_codemods.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,6 @@ def _remove_recursive_helper(cls, bool_node):

@leave(m.With())
def remove_nested_with(self, _, updated_node):
if self.min_version < (3, 9):
return updated_node

candidate_with: cst.With = updated_node
compound_items: List[cst.WithItem] = []
final_body: cst.BaseSuite = candidate_with.body
Expand Down
2 changes: 1 addition & 1 deletion tests/test_shed.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def check(
return result


example_kwargs = {"refactor": True, "provides": frozenset(), "min_version": (3, 8)}
example_kwargs = {"refactor": True, "provides": frozenset(), "min_version": (3, 9)}


@given(
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ commands =

[testenv:deps]
description = Updates test corpora and the pinned dependencies in `deps/*.txt`
basepython = 3.8
basepython = 3.9
deps =
pip-tools
commands =
Expand All @@ -53,7 +53,7 @@ ignore = D1,E501,W503,S101,S310,SIM105
exclude = .*/,__pycache__

[mypy]
python_version = 3.8
python_version = 3.9
platform = linux
disallow_untyped_calls = True
disallow_untyped_defs = True
Expand Down

0 comments on commit 4537325

Please sign in to comment.