check-python-versions 0.21.3__py2.py3-none-any.whl → 0.22.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- check_python_versions/__init__.py +1 -1
- check_python_versions/parsers/poetry_version_spec.py +6 -3
- check_python_versions/parsers/python.py +6 -11
- check_python_versions/parsers/requires_python.py +5 -2
- check_python_versions/parsers/yaml.py +1 -1
- check_python_versions/versions.py +1 -1
- {check_python_versions-0.21.3.dist-info → check_python_versions-0.22.1.dist-info}/METADATA +5 -4
- {check_python_versions-0.21.3.dist-info → check_python_versions-0.22.1.dist-info}/RECORD +12 -12
- {check_python_versions-0.21.3.dist-info → check_python_versions-0.22.1.dist-info}/WHEEL +1 -1
- {check_python_versions-0.21.3.dist-info → check_python_versions-0.22.1.dist-info}/LICENSE +0 -0
- {check_python_versions-0.21.3.dist-info → check_python_versions-0.22.1.dist-info}/entry_points.txt +0 -0
- {check_python_versions-0.21.3.dist-info → check_python_versions-0.22.1.dist-info}/top_level.txt +0 -0
@@ -6,7 +6,6 @@ https://python-poetry.org/docs/dependency-specification/#version-constraints
|
|
6
6
|
"""
|
7
7
|
|
8
8
|
import re
|
9
|
-
from functools import partial
|
10
9
|
from typing import Callable, Dict, List, Optional, Tuple, Union
|
11
10
|
|
12
11
|
from ..utils import warn
|
@@ -61,7 +60,11 @@ def parse_poetry_version_constraint(
|
|
61
60
|
#
|
62
61
|
|
63
62
|
handlers: Dict[str, HandlerFn] = {}
|
64
|
-
|
63
|
+
|
64
|
+
def handler(operator: str) -> Callable[[HandlerFn], None]:
|
65
|
+
def decorator(fn: HandlerFn) -> None:
|
66
|
+
handlers[operator] = fn
|
67
|
+
return decorator
|
65
68
|
|
66
69
|
#
|
67
70
|
# We are not doing a strict version check here because if the spec says,
|
@@ -231,7 +234,7 @@ def detect_poetry_version_spec_style(spec: str) -> VersionSpecStyle:
|
|
231
234
|
"""Determine how a python_requires string was formatted.
|
232
235
|
|
233
236
|
The return value is a dict of kwargs that can be splatted
|
234
|
-
into
|
237
|
+
into compute_poetry_spec(..., **style).
|
235
238
|
"""
|
236
239
|
comma = ', '
|
237
240
|
if ',' in spec and ', ' not in spec:
|
@@ -209,11 +209,8 @@ def eval_ast_node(
|
|
209
209
|
|
210
210
|
``keyword`` is used for error reporting.
|
211
211
|
"""
|
212
|
-
if isinstance(node, ast.
|
213
|
-
|
214
|
-
# https://github.com/python/mypy/issues/8837
|
215
|
-
assert isinstance(node.s, str)
|
216
|
-
return node.s
|
212
|
+
if isinstance(node, ast.Constant) and isinstance(node.value, str):
|
213
|
+
return node.value
|
217
214
|
if isinstance(node, (ast.List, ast.Tuple)):
|
218
215
|
values: List[str] = []
|
219
216
|
warned = False
|
@@ -238,20 +235,18 @@ def eval_ast_node(
|
|
238
235
|
return tuple(values)
|
239
236
|
return values
|
240
237
|
if (isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute)
|
241
|
-
and isinstance(node.func.value, ast.
|
238
|
+
and isinstance(node.func.value, ast.Constant)
|
239
|
+
and isinstance(node.func.value.value, str)
|
242
240
|
and node.func.attr == 'join'):
|
243
241
|
try:
|
244
|
-
|
245
|
-
# https://github.com/python/mypy/issues/8837
|
246
|
-
assert isinstance(node.func.value.s, str)
|
247
|
-
return node.func.value.s.join(ast.literal_eval(node.args[0]))
|
242
|
+
return node.func.value.value.join(ast.literal_eval(node.args[0]))
|
248
243
|
except ValueError:
|
249
244
|
pass
|
250
245
|
if isinstance(node, ast.BinOp) and isinstance(node.op, ast.Add):
|
251
246
|
left = eval_ast_node(node.left, keyword, filename=filename)
|
252
247
|
right = eval_ast_node(node.right, keyword, filename=filename)
|
253
248
|
if left is not None and right is not None:
|
254
|
-
if type(left)
|
249
|
+
if type(left) is not type(right):
|
255
250
|
warn(f'{keyword}= in {filename} is computed by adding'
|
256
251
|
' incompatible types:'
|
257
252
|
f' {type(left).__name__} and {type(right).__name__}')
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Tools for manipulating requires-python PyPI classifiers.
|
3
3
|
"""
|
4
4
|
import re
|
5
|
-
from functools import partial
|
6
5
|
from typing import Callable, Dict, List, Optional, Tuple, Union
|
7
6
|
|
8
7
|
from ..utils import warn
|
@@ -58,7 +57,11 @@ def parse_python_requires(
|
|
58
57
|
#
|
59
58
|
|
60
59
|
handlers: Dict[str, HandlerFn] = {}
|
61
|
-
|
60
|
+
|
61
|
+
def handler(operator: str) -> Callable[[HandlerFn], None]:
|
62
|
+
def decorator(fn: HandlerFn) -> None:
|
63
|
+
handlers[operator] = fn
|
64
|
+
return decorator
|
62
65
|
|
63
66
|
#
|
64
67
|
# We are not doing a strict PEP-440 implementation here because if
|
@@ -111,7 +111,7 @@ def update_yaml_list(
|
|
111
111
|
if kept_last:
|
112
112
|
if replacements and value in replacements:
|
113
113
|
lines_to_keep.append(
|
114
|
-
f"{' '* indent}- {replacements[value]}\n"
|
114
|
+
f"{' ' * indent}- {replacements[value]}\n"
|
115
115
|
)
|
116
116
|
else:
|
117
117
|
lines_to_keep.append(line)
|
@@ -11,7 +11,7 @@ from typing import Collection, List, NamedTuple, Optional, Set, Union
|
|
11
11
|
|
12
12
|
MAX_PYTHON_1_VERSION = 6 # i.e. 1.6
|
13
13
|
MAX_PYTHON_2_VERSION = 7 # i.e. 2.7
|
14
|
-
CURRENT_PYTHON_3_VERSION =
|
14
|
+
CURRENT_PYTHON_3_VERSION = 13 # i.e. 3.13
|
15
15
|
|
16
16
|
MAX_MINOR_FOR_MAJOR = {
|
17
17
|
1: MAX_PYTHON_1_VERSION,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: check-python-versions
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.22.1
|
4
4
|
Summary: Compare supported Python versions in setup.py vs tox.ini et al.
|
5
5
|
Home-page: https://github.com/mgedmin/check-python-versions
|
6
6
|
Author: Marius Gedminas
|
@@ -15,14 +15,15 @@ Classifier: Environment :: Console
|
|
15
15
|
Classifier: Intended Audience :: Developers
|
16
16
|
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
|
17
17
|
Classifier: Operating System :: OS Independent
|
18
|
-
Classifier: Programming Language :: Python :: 3.7
|
19
18
|
Classifier: Programming Language :: Python :: 3.8
|
20
19
|
Classifier: Programming Language :: Python :: 3.9
|
21
20
|
Classifier: Programming Language :: Python :: 3.10
|
22
21
|
Classifier: Programming Language :: Python :: 3.11
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
23
24
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
24
25
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
25
|
-
Requires-Python: >=3.
|
26
|
+
Requires-Python: >=3.8
|
26
27
|
Description-Content-Type: text/x-rst
|
27
28
|
License-File: LICENSE
|
28
29
|
Requires-Dist: pyyaml
|
@@ -415,6 +416,6 @@ Add the following snippet to your ``.pre-commit-config.yaml``.
|
|
415
416
|
|
416
417
|
repos:
|
417
418
|
- repo: https://github.com/mgedmin/check-python-versions
|
418
|
-
rev: "0.
|
419
|
+
rev: "0.22.1"
|
419
420
|
hooks:
|
420
421
|
- id: check-python-versions
|
@@ -1,19 +1,19 @@
|
|
1
|
-
check_python_versions/__init__.py,sha256
|
1
|
+
check_python_versions/__init__.py,sha256=FgwRrOmdq_09j3kvSdxV-h2AYXRzy_N6KFf7ngKcIDo,401
|
2
2
|
check_python_versions/__main__.py,sha256=3S4LJTimwAmcTUOog4Fh6c9wt96rHti9Bw93cj0KliI,110
|
3
3
|
check_python_versions/cli.py,sha256=otmgDMvoXkAMTbcudMeaEYLNL3aemqT7UT-4LEMsRVU,16774
|
4
4
|
check_python_versions/utils.py,sha256=oECHZ5TX7UW73ZZTU39d7xNC-RFaOlIUCIknyHVUEJM,3991
|
5
|
-
check_python_versions/versions.py,sha256=
|
5
|
+
check_python_versions/versions.py,sha256=lr1cmn_zzwfptJrALiyuFnMBJCrCBIc8hMzjnIGC_GI,5063
|
6
6
|
check_python_versions/parsers/__init__.py,sha256=k8XlWs_u7oqjp67dtu-22dP7Hxn1eOP7wUUPck-JUAM,50
|
7
7
|
check_python_versions/parsers/appveyor.py,sha256=chI4zU0snKUIr2BgG4vcsQgSuuN9gwdUAOzW1utgJdU,6089
|
8
8
|
check_python_versions/parsers/classifiers.py,sha256=HDIOMqTkz-n9rSQ3BTpLdcB_jAb2jTGV2-ZNxgZVel4,2508
|
9
9
|
check_python_versions/parsers/ini.py,sha256=MtKyt-Mg_ABXHhcg3D82uzJfT4g4giEHu84JQiODOSo,2178
|
10
10
|
check_python_versions/parsers/manylinux.py,sha256=5YcCJJT2RCp8qEMGN1w5WmY_Uybhi6P-a5HvqLR_IQs,2615
|
11
|
-
check_python_versions/parsers/poetry_version_spec.py,sha256=
|
12
|
-
check_python_versions/parsers/python.py,sha256=
|
13
|
-
check_python_versions/parsers/requires_python.py,sha256=
|
11
|
+
check_python_versions/parsers/poetry_version_spec.py,sha256=nNPeWNbUvRpy5VlqdAfDFGE9qcv2_WUqDS6yOfAC8cg,10421
|
12
|
+
check_python_versions/parsers/python.py,sha256=SQOb00cgqw1JeX1GDYrIxfW-d-lv70cQTXwCrk3awGU,8717
|
13
|
+
check_python_versions/parsers/requires_python.py,sha256=AWCgDDtZPnDldmc6lbMgpSlV9OVFcukJAT-wg310U6I,9075
|
14
14
|
check_python_versions/parsers/tox.py,sha256=p-TNHUQKIsfnxjmu-OMfNff_KsTQtwSPICaew3t2ZwU,9191
|
15
15
|
check_python_versions/parsers/travis.py,sha256=wUHf6G3QBlPBroy2eY4BcQwUmtrLbuPuC3BAtKWRtNw,12350
|
16
|
-
check_python_versions/parsers/yaml.py,sha256=
|
16
|
+
check_python_versions/parsers/yaml.py,sha256=ZCHgkWMDuDWtQGzeOaux7lzpmfY_GTtgmo0LHjg45jk,6886
|
17
17
|
check_python_versions/sources/__init__.py,sha256=HDKHKaRDZarfDweJFXgCoUPW2g5VCu4-yyW4Q9mtTnE,53
|
18
18
|
check_python_versions/sources/all.py,sha256=NPBGmVIFCNPIb3zsLpDAkp5AN-Z500ShugMsBMiEvDs,607
|
19
19
|
check_python_versions/sources/appveyor.py,sha256=35le4a3ctPruM-pop9gFvCaEnYUDcH6IpRukvQn6W-c,6370
|
@@ -24,9 +24,9 @@ check_python_versions/sources/pyproject.py,sha256=Q7aztzjvO1R5zQD1dfv2uLTx81B8Vd
|
|
24
24
|
check_python_versions/sources/setup_py.py,sha256=mg85K98zKRpzZhy1cve-2Z_pdrElaGqYbLefhXsfL0A,6353
|
25
25
|
check_python_versions/sources/tox.py,sha256=HHOO_bSy704POHA9Di7vL_eSdVtMEJkpopZMMg-2bzc,8343
|
26
26
|
check_python_versions/sources/travis.py,sha256=jzlPbFBUU4MPrSP8S6HbKsQsQ7YSb-HYI-XEWGaerwc,7317
|
27
|
-
check_python_versions-0.
|
28
|
-
check_python_versions-0.
|
29
|
-
check_python_versions-0.
|
30
|
-
check_python_versions-0.
|
31
|
-
check_python_versions-0.
|
32
|
-
check_python_versions-0.
|
27
|
+
check_python_versions-0.22.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
28
|
+
check_python_versions-0.22.1.dist-info/METADATA,sha256=NaSQsQMgLkhw3vvpKlUkbCfQX5lP7h93lj8OEELzq1I,13775
|
29
|
+
check_python_versions-0.22.1.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
|
30
|
+
check_python_versions-0.22.1.dist-info/entry_points.txt,sha256=x9xSZ-bykDb8Fdbn5dveeKR_FremlF7LtoleDZsc6HY,73
|
31
|
+
check_python_versions-0.22.1.dist-info/top_level.txt,sha256=EXCdlUG8MIX0NEzRDdG7u2SBhm5v15MNVPO5RrOxkHQ,22
|
32
|
+
check_python_versions-0.22.1.dist-info/RECORD,,
|
File without changes
|
{check_python_versions-0.21.3.dist-info → check_python_versions-0.22.1.dist-info}/entry_points.txt
RENAMED
File without changes
|
{check_python_versions-0.21.3.dist-info → check_python_versions-0.22.1.dist-info}/top_level.txt
RENAMED
File without changes
|