Skip to content

Commit 8cf87be

Browse files
chore: drop black, flake8 and reoder-python-imports
1 parent 1f57be6 commit 8cf87be

36 files changed

+111
-127
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,19 @@
1-
default_language_version:
2-
python: python3.9
31
repos:
4-
- repo: https://github.com/psf/black
5-
rev: 23.12.1
6-
hooks:
7-
- id: black
8-
args: [--safe, --quiet]
9-
exclude: docs/examples/
10-
- repo: https://github.com/asottile/reorder-python-imports
11-
rev: v3.12.0
12-
hooks:
13-
- id: reorder-python-imports
14-
args: [ "--application-directories=.:src" , --py38-plus, --add-import, 'from __future__ import annotations']
152
- repo: https://github.com/pre-commit/pre-commit-hooks
163
rev: v4.5.0
174
hooks:
185
- id: trailing-whitespace
196
- id: check-yaml
207
- id: debug-statements
21-
- repo: https://github.com/PyCQA/flake8
22-
rev: 7.0.0
23-
hooks:
24-
- id: flake8
25-
- repo: https://github.com/asottile/pyupgrade
26-
rev: v3.15.0
27-
hooks:
28-
- id: pyupgrade
29-
args: [--py38-plus]
308
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.1.11
9+
rev: v0.2.1
3210
hooks:
3311
- id: ruff
3412
args: [--fix, --exit-non-zero-on-fix]
13+
- id: ruff-format
14+
3515
- repo: https://github.com/tox-dev/pyproject-fmt
36-
rev: "1.5.3"
16+
rev: "1.7.0"
3717
hooks:
3818
- id: pyproject-fmt
3919
exclude: docs/examples/

_own_version_helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
it works only if the backend-path of the build-system section
66
from pyproject.toml is respected
77
"""
8+
89
from __future__ import annotations
910

1011
import logging
1112
from typing import Callable
1213

1314
from setuptools import build_meta as build_meta # noqa
14-
15-
from setuptools_scm import _types as _t
1615
from setuptools_scm import Configuration
16+
from setuptools_scm import _types as _t
1717
from setuptools_scm import get_version
1818
from setuptools_scm import git
1919
from setuptools_scm import hg
2020
from setuptools_scm.fallbacks import parse_pkginfo
21+
from setuptools_scm.version import ScmVersion
2122
from setuptools_scm.version import get_local_node_and_date
2223
from setuptools_scm.version import guess_next_dev_version
23-
from setuptools_scm.version import ScmVersion
2424

2525
log = logging.getLogger("setuptools_scm")
2626
# todo: take fake entrypoints from pyproject.toml

docs/examples/version_scheme_code/setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
from setuptools import setup
6-
76
from setuptools_scm import ScmVersion
87

98

pyproject.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,18 @@ version = { attr = "_own_version_helper.version"}
113113
[tool.setuptools_scm]
114114

115115
[tool.ruff]
116-
select = ["E", "F", "B", "U", "YTT", "C", "DTZ", "PYI", "PT"]
117-
ignore = ["B028"]
116+
required-version = "0.2.1"
117+
fix = true
118+
lint.select = ["E", "F", "B", "U", "YTT", "C", "DTZ", "PYI", "PT", "I"]
119+
lint.ignore = ["B028"]
120+
121+
122+
[tool.ruff.lint.isort]
123+
force-single-line = true
124+
force-sort-within-sections = true
125+
from-first = false
126+
lines-between-types = 1
127+
order-by-type = true
118128

119129
[tool.pytest.ini_options]
120130
testpaths = ["testing"]

src/setuptools_scm/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
:copyright: 2010-2023 by Ronny Pfannschmidt
33
:license: MIT
44
"""
5+
56
from __future__ import annotations
67

8+
from ._config import DEFAULT_LOCAL_SCHEME
9+
from ._config import DEFAULT_VERSION_SCHEME
710
from ._config import Configuration
8-
from ._config import DEFAULT_LOCAL_SCHEME # soft deprecated
9-
from ._config import DEFAULT_VERSION_SCHEME # soft deprecated
10-
from ._get_version_impl import _get_version # soft deprecated
11-
from ._get_version_impl import get_version # soft deprecated
11+
from ._get_version_impl import _get_version
12+
from ._get_version_impl import get_version
1213
from ._integration.dump_version import dump_version # soft deprecated
1314
from ._version_cls import NonNormalizedVersion
1415
from ._version_cls import Version
1516
from .version import ScmVersion
1617

17-
1818
# Public API
1919
__all__ = [
2020
# soft deprecated imports, left for backward compatibility

src/setuptools_scm/_config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
""" configuration """
2+
23
from __future__ import annotations
34

45
import dataclasses
56
import os
6-
import re
7-
import warnings
87
from pathlib import Path
8+
import re
99
from typing import Any
1010
from typing import Pattern
1111
from typing import Protocol
12+
import warnings
1213

1314
from . import _log
1415
from . import _types as _t
@@ -17,9 +18,9 @@
1718
)
1819
from ._integration.pyproject_reading import read_pyproject as _read_pyproject
1920
from ._overrides import read_toml_overrides
21+
from ._version_cls import Version as _Version
2022
from ._version_cls import _validate_version_cls
2123
from ._version_cls import _VersionT
22-
from ._version_cls import Version as _Version
2324

2425
log = _log.log.getChild("config")
2526

src/setuptools_scm/_entrypoints.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
from __future__ import annotations
22

33
import sys
4+
from typing import TYPE_CHECKING
45
from typing import Any
56
from typing import Callable
6-
from typing import cast
77
from typing import Iterator
8+
from typing import cast
89
from typing import overload
9-
from typing import TYPE_CHECKING
1010

1111
from . import _log
1212
from . import version
1313

1414
if TYPE_CHECKING:
1515
from . import _types as _t
16-
from ._config import Configuration, ParseFunction
16+
from ._config import Configuration
17+
from ._config import ParseFunction
1718

1819

1920
from importlib.metadata import EntryPoint as EntryPoint
2021

21-
2222
if sys.version_info[:2] < (3, 10):
2323
from importlib.metadata import entry_points as legacy_entry_points
2424

@@ -38,7 +38,8 @@ def entry_points(group: str) -> EntryPoints:
3838
return EntryPoints(legacy_entry_points()[group])
3939

4040
else:
41-
from importlib.metadata import entry_points, EntryPoints
41+
from importlib.metadata import EntryPoints
42+
from importlib.metadata import entry_points
4243

4344

4445
log = _log.log.getChild("entrypoints")

src/setuptools_scm/_file_finders/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import itertools
44
import os
5-
from typing import Callable
65
from typing import TYPE_CHECKING
6+
from typing import Callable
77

88
from .. import _log
99
from .. import _types as _t

src/setuptools_scm/_file_finders/git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import tarfile
77
from typing import IO
88

9-
from . import is_toplevel_acceptable
10-
from . import scm_find_files
119
from .. import _types as _t
1210
from .._run_cmd import run as _run
1311
from ..integration import data_from_mime
12+
from . import is_toplevel_acceptable
13+
from . import scm_find_files
1414
from .pathtools import norm_real
1515

1616
log = logging.getLogger(__name__)

src/setuptools_scm/_get_version_impl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from __future__ import annotations
22

33
import logging
4-
import re
5-
import warnings
64
from pathlib import Path
5+
import re
76
from typing import Any
87
from typing import NoReturn
98
from typing import Pattern
9+
import warnings
1010

1111
from . import _config
1212
from . import _entrypoints
@@ -15,8 +15,8 @@
1515
from ._config import Configuration
1616
from ._overrides import _read_pretended_version_for
1717
from ._version_cls import _validate_version_cls
18-
from .version import format_version as _format_version
1918
from .version import ScmVersion
19+
from .version import format_version as _format_version
2020

2121
EMPTY_TAG_REGEX_DEPRECATION = DeprecationWarning(
2222
"empty regex for tag regex is invalid, using default"

0 commit comments

Comments
 (0)