check-python-versions 0.21.3__tar.gz → 0.22.1__tar.gz

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.
Files changed (65) hide show
  1. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/CHANGES.rst +17 -1
  2. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/PKG-INFO +5 -4
  3. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/README.rst +1 -1
  4. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/appveyor.yml +3 -1
  5. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/setup.py +3 -2
  6. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/__init__.py +1 -1
  7. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/parsers/poetry_version_spec.py +6 -3
  8. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/parsers/python.py +6 -11
  9. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/parsers/requires_python.py +5 -2
  10. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/parsers/yaml.py +1 -1
  11. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/versions.py +1 -1
  12. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions.egg-info/PKG-INFO +5 -4
  13. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/parsers/test_python.py +6 -6
  14. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tox.ini +4 -2
  15. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/.coveragerc +0 -0
  16. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/.gitignore +0 -0
  17. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/.pre-commit-hooks.yaml +0 -0
  18. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/CLASSIFIERS +0 -0
  19. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/LICENSE +0 -0
  20. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/MANIFEST.in +0 -0
  21. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/Makefile +0 -0
  22. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/check-python-versions +0 -0
  23. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/pytest.ini +0 -0
  24. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/release.mk +0 -0
  25. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/setup.cfg +0 -0
  26. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/__main__.py +0 -0
  27. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/cli.py +0 -0
  28. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/parsers/__init__.py +0 -0
  29. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/parsers/classifiers.py +0 -0
  30. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/parsers/ini.py +0 -0
  31. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/__init__.py +0 -0
  32. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/all.py +0 -0
  33. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/appveyor.py +0 -0
  34. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/base.py +0 -0
  35. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/github.py +0 -0
  36. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/manylinux.py +0 -0
  37. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/pyproject.py +0 -0
  38. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/setup_py.py +0 -0
  39. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/tox.py +0 -0
  40. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/sources/travis.py +0 -0
  41. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions/utils.py +0 -0
  42. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions.egg-info/SOURCES.txt +0 -0
  43. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions.egg-info/dependency_links.txt +0 -0
  44. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions.egg-info/entry_points.txt +0 -0
  45. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions.egg-info/not-zip-safe +0 -0
  46. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions.egg-info/requires.txt +0 -0
  47. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/src/check_python_versions.egg-info/top_level.txt +0 -0
  48. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/__init__.py +0 -0
  49. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/conftest.py +0 -0
  50. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/parsers/test_classifiers.py +0 -0
  51. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/parsers/test_ini.py +0 -0
  52. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/parsers/test_poetry_version_spec.py +0 -0
  53. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/parsers/test_requires_python.py +0 -0
  54. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/parsers/test_yaml.py +0 -0
  55. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/sources/test_appveyor.py +0 -0
  56. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/sources/test_github.py +0 -0
  57. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/sources/test_manylinux.py +0 -0
  58. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/sources/test_pyproject.py +0 -0
  59. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/sources/test_setup_py.py +0 -0
  60. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/sources/test_tox.py +0 -0
  61. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/sources/test_travis.py +0 -0
  62. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/test___main__.py +0 -0
  63. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/test_cli.py +0 -0
  64. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/test_utils.py +0 -0
  65. {check-python-versions-0.21.3 → check-python-versions-0.22.1}/tests/test_versions.py +0 -0
@@ -1,6 +1,22 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 0.22.1 (2024-10-09)
5
+ -------------------
6
+
7
+ - Add support for Python 3.13: treat it as a released version, run CI tests on
8
+ 3.13.
9
+
10
+
11
+ 0.22.0 (2023-10-04)
12
+ -------------------
13
+
14
+ - Add support for Python 3.12: treat it as a released version, run CI tests on
15
+ 3.12.
16
+
17
+ - Drop support for Python 3.7.
18
+
19
+
4
20
  0.21.3 (2023-06-26)
5
21
  -------------------
6
22
 
@@ -37,7 +53,7 @@ Changelog
37
53
  0.20.0 (2022-10-27)
38
54
  -------------------
39
55
 
40
- - Add support for Python 3.11: threat it as a released version, run CI tests on
56
+ - Add support for Python 3.11: treat it as a released version, run CI tests on
41
57
  3.11.
42
58
 
43
59
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: check-python-versions
3
- Version: 0.21.3
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.7
26
+ Requires-Python: >=3.8
26
27
  Description-Content-Type: text/x-rst
27
28
  License-File: LICENSE
28
29
 
@@ -412,6 +413,6 @@ Add the following snippet to your ``.pre-commit-config.yaml``.
412
413
 
413
414
  repos:
414
415
  - repo: https://github.com/mgedmin/check-python-versions
415
- rev: "0.21.3"
416
+ rev: "0.22.1"
416
417
  hooks:
417
418
  - id: check-python-versions
@@ -384,6 +384,6 @@ Add the following snippet to your ``.pre-commit-config.yaml``.
384
384
 
385
385
  repos:
386
386
  - repo: https://github.com/mgedmin/check-python-versions
387
- rev: "0.21.3"
387
+ rev: "0.22.1"
388
388
  hooks:
389
389
  - id: check-python-versions
@@ -4,11 +4,12 @@ environment:
4
4
  matrix:
5
5
  # https://www.appveyor.com/docs/installed-software#python lists available
6
6
  # versions
7
- - PYTHON: "C:\\Python37"
8
7
  - PYTHON: "C:\\Python38"
9
8
  - PYTHON: "C:\\Python39"
10
9
  - PYTHON: "C:\\Python310"
11
10
  - PYTHON: "C:\\Python311"
11
+ - PYTHON: "C:\\Python312"
12
+ - PYTHON: "C:\\Python313"
12
13
 
13
14
  init:
14
15
  - "echo %PYTHON%"
@@ -23,6 +24,7 @@ install:
23
24
  - "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
24
25
  - python --version
25
26
  - pip install -U virtualenv # upgrade pip in tox's virtualenvs
27
+ - pip install setuptools # the test suite needs the system python to have setuptools
26
28
  - pip install tox
27
29
 
28
30
  build: off
@@ -51,16 +51,17 @@ setup(
51
51
  'Intended Audience :: Developers',
52
52
  'License :: OSI Approved :: GNU General Public License (GPL)',
53
53
  'Operating System :: OS Independent',
54
- 'Programming Language :: Python :: 3.7',
55
54
  'Programming Language :: Python :: 3.8',
56
55
  'Programming Language :: Python :: 3.9',
57
56
  'Programming Language :: Python :: 3.10',
58
57
  'Programming Language :: Python :: 3.11',
58
+ 'Programming Language :: Python :: 3.12',
59
+ 'Programming Language :: Python :: 3.13',
59
60
  'Programming Language :: Python :: Implementation :: CPython',
60
61
  'Programming Language :: Python :: Implementation :: PyPy',
61
62
  ],
62
63
  license='GPL',
63
- python_requires=">=3.7",
64
+ python_requires=">=3.8",
64
65
  packages=find_packages('src'),
65
66
  package_dir={'': 'src'},
66
67
  entry_points={
@@ -13,4 +13,4 @@ Makes sure the set of supported Python versions is consistent between
13
13
  """
14
14
 
15
15
  __author__ = 'Marius Gedminas <marius@gedmin.as>'
16
- __version__ = '0.21.3'
16
+ __version__ = '0.22.1'
@@ -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
- handler = partial(partial, handlers.__setitem__)
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 compute_python_requires(..., **style).
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.Str):
213
- # The assert is needed to placate mypy on Python 3.8
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.Str)
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
- # The assert is needed to placate mypy on Python 3.8
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) != type(right):
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
- handler = partial(partial, handlers.__setitem__)
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 = 11 # i.e. 3.10
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.21.3
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.7
26
+ Requires-Python: >=3.8
26
27
  Description-Content-Type: text/x-rst
27
28
  License-File: LICENSE
28
29
 
@@ -412,6 +413,6 @@ Add the following snippet to your ``.pre-commit-config.yaml``.
412
413
 
413
414
  repos:
414
415
  - repo: https://github.com/mgedmin/check-python-versions
415
- rev: "0.21.3"
416
+ rev: "0.22.1"
416
417
  hooks:
417
418
  - id: check-python-versions
@@ -15,23 +15,23 @@ from check_python_versions.parsers.python import (
15
15
  def test_find_call_kwarg_in_ast():
16
16
  tree = ast.parse('foo(bar="foo")')
17
17
  node = find_call_kwarg_in_ast(tree, 'foo', 'bar', filename='setup.py')
18
- assert isinstance(node, ast.Str)
19
- assert node.s == "foo"
18
+ assert isinstance(node, ast.Constant)
19
+ assert node.value == "foo"
20
20
 
21
21
 
22
22
  def test_find_call_kwarg_in_ast_dotted():
23
23
  tree = ast.parse('mod.foo(bar="gronk")')
24
24
  node = find_call_kwarg_in_ast(tree, 'mod.foo', 'bar', filename='setup.py')
25
- assert isinstance(node, ast.Str)
26
- assert node.s == "gronk"
25
+ assert isinstance(node, ast.Constant)
26
+ assert node.value == "gronk"
27
27
 
28
28
 
29
29
  def test_find_call_kwarg_in_ast_alternatives():
30
30
  tree = ast.parse('mod.foo(bar="gronk")')
31
31
  node = find_call_kwarg_in_ast(tree, ['foo', 'mod.foo'], 'bar',
32
32
  filename='a.py')
33
- assert isinstance(node, ast.Str)
34
- assert node.s == "gronk"
33
+ assert isinstance(node, ast.Constant)
34
+ assert node.value == "gronk"
35
35
 
36
36
 
37
37
  def test_find_call_kwarg_in_ast_no_arg(capsys):
@@ -1,8 +1,10 @@
1
1
  [tox]
2
- envlist = py37,py38,py39,py310,py311,pypy3,flake8,mypy,isort,coverage
2
+ envlist = py38,py39,py310,py311,py312,py313,pypy3,flake8,mypy,isort,coverage
3
3
 
4
4
  [testenv]
5
- deps = pytest
5
+ deps =
6
+ pytest
7
+ setuptools
6
8
  commands =
7
9
  pytest {posargs:tests}
8
10