python-inspector 0.14.3__py3-none-any.whl → 0.15.0__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.
_packagedcode/pypi.py CHANGED
@@ -534,7 +534,7 @@ class PypiWheelHandler(BasePypiHandler):
534
534
  for metapath in path.iterdir():
535
535
  if not metapath.name.endswith('METADATA'):
536
536
  continue
537
-
537
+
538
538
  yield parse_metadata(
539
539
  location=metapath,
540
540
  datasource_id=cls.datasource_id,
@@ -945,6 +945,8 @@ def get_requirements_txt_dependencies(location, include_nested=False):
945
945
 
946
946
  purl = purl and purl.to_string() or None
947
947
 
948
+ hash_options = req.hash_options or []
949
+ req.hash_options = []
948
950
  requirement = req.dumps()
949
951
 
950
952
  if location.endswith(
@@ -973,7 +975,7 @@ def get_requirements_txt_dependencies(location, include_nested=False):
973
975
  extra_data=dict(
974
976
  is_editable=req.is_editable,
975
977
  link=req.link and req.link.url or None,
976
- hash_options=req.hash_options or [],
978
+ hash_options=hash_options,
977
979
  is_constraint=req.is_constraint,
978
980
  is_archive=req.is_archive,
979
981
  is_wheel=req.is_wheel,
@@ -123,10 +123,10 @@ def node_to_value(node, body):
123
123
  if isinstance(node, ast.Constant):
124
124
  return node.value
125
125
 
126
- if isinstance(node, ast.Str):
126
+ if isinstance(node, ast.Constant) and isinstance(node.value, str):
127
127
  return node.s
128
128
 
129
- if isinstance(node, ast.Num):
129
+ if isinstance(node, ast.Constant) and isinstance(node.value, int):
130
130
  return node.n
131
131
 
132
132
  if isinstance(node, (ast.List, ast.Tuple, ast.Set,)):
@@ -172,7 +172,9 @@ def is_valid_version(
172
172
  """
173
173
  if parsed_version in bad_versions:
174
174
  return False
175
- if any(parsed_version not in r.specifier for r in requirements[identifier]):
175
+ if any(
176
+ not r.specifier.contains(parsed_version, prereleases=True) for r in requirements[identifier]
177
+ ):
176
178
  if all(not r.specifier for r in requirements[identifier]):
177
179
  return True
178
180
  return False
@@ -21,7 +21,7 @@ from python_inspector.utils import write_output_in_file
21
21
 
22
22
  TRACE = False
23
23
 
24
- __version__ = "0.14.3"
24
+ __version__ = "0.14.4"
25
25
 
26
26
  DEFAULT_PYTHON_VERSION = settings.DEFAULT_PYTHON_VERSION
27
27
  PYPI_SIMPLE_URL = settings.PYPI_SIMPLE_URL
@@ -121,6 +121,7 @@ def iter_requirements(level, extras, setup_file):
121
121
 
122
122
  mock_args, mock_kwargs = mock_setup.call_args
123
123
  install_requires = mock_kwargs.get("install_requires", install_requires)
124
+ install_requires = [req for req in install_requires if req]
124
125
 
125
126
  requires_extras = mock_kwargs.get("extras_require", requires_extras)
126
127
  test_requires = mock_kwargs.get("test_requires", test_requires)
@@ -110,7 +110,7 @@ TRACE_DEEP = False
110
110
  TRACE_ULTRA_DEEP = False
111
111
 
112
112
  # Supported environments
113
- PYTHON_VERSIONS = "27", "36", "37", "38", "39", "310", "311", "312", "313"
113
+ PYTHON_VERSIONS = "27", "36", "37", "38", "39", "310", "311", "312", "313", "3.14"
114
114
 
115
115
  PYTHON_DOT_VERSIONS_BY_VER = {
116
116
  "27": "2.7",
@@ -122,6 +122,7 @@ PYTHON_DOT_VERSIONS_BY_VER = {
122
122
  "311": "3.11",
123
123
  "312": "3.12",
124
124
  "313": "3.13",
125
+ "314": "3.14",
125
126
  }
126
127
 
127
128
  valid_python_versions = list(PYTHON_DOT_VERSIONS_BY_VER.keys())
@@ -145,6 +146,7 @@ ABIS_BY_PYTHON_VERSION = {
145
146
  "311": ["cp311", "cp311m", "abi3"],
146
147
  "312": ["cp312", "cp312m", "abi3"],
147
148
  "313": ["cp313", "cp313m", "abi3"],
149
+ "314": ["cp314", "cp314m", "abi3"],
148
150
  }
149
151
 
150
152
  PLATFORMS_BY_OS = {
@@ -155,6 +157,7 @@ PLATFORMS_BY_OS = {
155
157
  "manylinux2014_x86_64",
156
158
  "manylinux_2_27_x86_64",
157
159
  "manylinux_2_28_x86_64",
160
+ "manylinux_2_31_x86_64",
158
161
  "manylinux2014_aarch6",
159
162
  "musllinux_1_2_x86_64",
160
163
  "manylinux_2_33_aarch64",
@@ -1693,7 +1696,14 @@ class Cache:
1693
1696
  cached = os.path.join(self.directory, cache_key)
1694
1697
  lock_file = f"{cached}.lockfile"
1695
1698
 
1696
- if force or not os.path.exists(cached):
1699
+ cache_valid = os.path.exists(cached) and os.path.getsize(cached) > 0
1700
+
1701
+ if force or not cache_valid:
1702
+ if not cache_valid and os.path.exists(cached):
1703
+ if TRACE_DEEP:
1704
+ print(f" FILE CACHE INVALID (empty file): {path_or_url}")
1705
+ os.remove(cached)
1706
+
1697
1707
  if TRACE_DEEP:
1698
1708
  print(f" FILE CACHE MISS: {path_or_url}")
1699
1709
  content = await get_file_content(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-inspector
3
- Version: 0.14.3
3
+ Version: 0.15.0
4
4
  Summary: python-inspector is is a collection of utilities to collect PyPI package metadata and resolve packages dependencies.
5
5
  Home-page: https://github.com/aboutcode-org/python-inspector
6
6
  Author: nexB. Inc. and others
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Classifier: Topic :: Software Development
15
15
  Classifier: Topic :: Utilities
16
- Requires-Python: >=3.9
16
+ Requires-Python: >=3.10
17
17
  Description-Content-Type: text/x-rst
18
18
  License-File: apache-2.0.LICENSE
19
19
  License-File: NOTICE
@@ -49,7 +49,7 @@ Requires-Dist: twine; extra == "dev"
49
49
  Requires-Dist: ruff; extra == "dev"
50
50
  Requires-Dist: pytest-rerunfailures; extra == "dev"
51
51
  Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
52
- Requires-Dist: Sphinx>=5.0.2; extra == "dev"
52
+ Requires-Dist: Sphinx>=6.2.0; extra == "dev"
53
53
  Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "dev"
54
54
  Requires-Dist: sphinx-reredirects>=0.1.2; extra == "dev"
55
55
  Requires-Dist: doc8>=0.11.2; extra == "dev"
@@ -1,9 +1,9 @@
1
1
  _packagedcode/__init__.py,sha256=cLQgRA2EjQgdVdz1i_o_pTsQakHBykIv4sMzFXV2Ntg,366
2
2
  _packagedcode/models.py,sha256=n2xL9HSLfC0QQwQlH1yzOPZjjHOcfTCJ36E8t45Qxis,48917
3
- _packagedcode/pypi.py,sha256=lxeAkeoA4d9srFZ4K_jgX6a4e4kyc-zvs557xHMhvos,70155
3
+ _packagedcode/pypi.py,sha256=dxEg2GYUa8ChUFL3tyZVjXjufZZ655BMEaPZEKIn89Q,70217
4
4
  _packagedcode/pypi.py.ABOUT,sha256=rqbtXJyYak0Sg-NCM3qDF7-JxCKXN5HEoU-qse_IqKA,551
5
5
  _packagedcode/pypi.py.NOTICE,sha256=QtJl8lok4abmslH7UT1UaOPFsuZPwM7hjd58UASQJ7o,1884
6
- _packagedcode/pypi_setup_py.py,sha256=8uXo28HFZeIQL9cbZZxkk98jrYzgvWKASRgjRi8D3Vo,5785
6
+ _packagedcode/pypi_setup_py.py,sha256=vEiYW8vQie5HKFmgRnBcFMvD6leuIODwHpmg43qSCN0,5859
7
7
  _packagedcode/pypi_setup_py.py.ABOUT,sha256=7FLC7R73YDfzEu47fij39PxteCqmojKSexChYZYpQlQ,300
8
8
  _packagedcode/pypi_setup_py.py.LICENSE,sha256=EsVAqcPMzlhNkyJ3j6EW_yF02WLs94p0w2igJYrUcxs,1077
9
9
  _packagedcode/utils.py,sha256=uxkWaSeZRY69LinSFdVFHirpuyLI4YcvYb2wLztU6T4,6970
@@ -14,29 +14,29 @@ python_inspector/dependencies.py,sha256=4-y2MprEg91cGR0NPJpiMc4tbwJZky4L7ZrIB-lk
14
14
  python_inspector/error.py,sha256=K3kRjIr8AXgSFMyhLa9MerhMfq8MhPKxLvDT6RiWD4M,457
15
15
  python_inspector/lockfile.py,sha256=I-xLXQjluh7RXJIB6-P9L_qR3reFpYioR0a4gApcfM0,790
16
16
  python_inspector/package_data.py,sha256=D4ilQazsa898_ysKI73Vg9DoTEK5eNctXNys7E20BCc,6552
17
- python_inspector/resolution.py,sha256=hcjhB1xF4OGoJDL7GXjkERjpEzkxkbQnonf2xZ0tyXs,30037
17
+ python_inspector/resolution.py,sha256=ufStgDuFNuR2nRJrBC9MamBH_4F9-MCOTjyTRSN-AiE,30076
18
18
  python_inspector/resolution.py.ABOUT,sha256=tYLeHLgyo4zZrPlMXlVF59EjC-GGDaQeFKogf7M7rXg,705
19
19
  python_inspector/resolution.py.LICENSE,sha256=84j9OMrRMRLB3A9mm76A5_hFQe26-3LzAw0sp2QsPJ0,751
20
- python_inspector/resolve_cli.py,sha256=glPwxZzt6P5v27JKWPQ_I36rGX_wy9a2wZoaPMqJS98,12129
20
+ python_inspector/resolve_cli.py,sha256=Z_UEGO6EXb7mTLuw85oF1uvQVkSc1W4lX6NJ3OkY79Q,12129
21
21
  python_inspector/settings.py,sha256=r4711MS_nFyXU4pWWhLtXt3mGo3QJBIZV28IttZT7gI,2304
22
- python_inspector/setup_py_live_eval.py,sha256=6uJLJT_Aw5SEeybe8JEaEiWCHOTbpsJ0BinN4mlprUE,7601
22
+ python_inspector/setup_py_live_eval.py,sha256=ZMhOvqf8djKFTBC0pq8HFsgpZDOuhnaJoGqoT_eTtCQ,7665
23
23
  python_inspector/setup_py_live_eval.py.ABOUT,sha256=ecRsdi0Z--mX8gnSwQzE2OqucpmD0AsmPlojp70uPxI,396
24
24
  python_inspector/setup_py_live_eval.py.LICENSE,sha256=5wfEqJLf5ANizw20WUURuTgoZOzMRK_4iGA39BApyRk,1643
25
25
  python_inspector/utils.py,sha256=cQWtdVT0RZ8XGj_sxYu_lX_sg-Iz3NCCtsg-haYbwiM,3541
26
26
  python_inspector/utils_pip_compatibility_tags.py,sha256=8ZQkXLldhqqO4sJ0aVXQwWYdw3Qo1_C9MhntShVlgE8,6831
27
27
  python_inspector/utils_pip_compatibility_tags.py.ABOUT,sha256=tFhzj7qUEA9H-Tg6K1BI5QBtmQEq0vHg0X2Ws7t073U,540
28
- python_inspector/utils_pypi.py,sha256=ZA4J_PEbG31vFbR4n8CT9ToAXY9g5P5POa6idPmlG3E,58985
28
+ python_inspector/utils_pypi.py,sha256=cT2FCKOqbaxQucDScTs_lAdgNqbEGWIRyoroX3cxcuU,59362
29
29
  python_inspector/utils_pypi.py.ABOUT,sha256=7s9WCNmS-qJJgHC979fI4whrM5Y41-Ar-LZoIfZXPVU,635
30
30
  python_inspector/utils_pypi_supported_tags.py,sha256=SdbIlKoCgyqBZIesEdrFhVMnYikBirvSDvPUPIomTSo,2850
31
31
  python_inspector/utils_pypi_supported_tags.py.ABOUT,sha256=ndJ1kQS6u7caYmLc6XVnNIdKfpnvGjKepxpmhQJWJyA,741
32
- python_inspector-0.14.3.dist-info/licenses/AUTHORS.rst,sha256=rRa-_IwbfBl84NqT5QZWFTXHsJnvRz8SP9dymwrEDAE,87
33
- python_inspector-0.14.3.dist-info/licenses/CHANGELOG.rst,sha256=NrV3N7byf6ZdTqV9S9Fuu3GWWs1jGamT0Ifm6WSmmVg,5871
34
- python_inspector-0.14.3.dist-info/licenses/CODE_OF_CONDUCT.rst,sha256=xXDTFpYY3Y7JoxrWADihieUvhGlwJc_oxsbmLJaBvE4,3422
35
- python_inspector-0.14.3.dist-info/licenses/NOTICE,sha256=fkLIlzyP8zWNnPbFSXkTInNgYl35THH5-J8vMKuNzhc,761
36
- python_inspector-0.14.3.dist-info/licenses/README.rst,sha256=ucUCSQt39WlNfVdOl_1WbuvBqEN0NZm_h5o_vltNFps,7033
37
- python_inspector-0.14.3.dist-info/licenses/apache-2.0.LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
38
- python_inspector-0.14.3.dist-info/METADATA,sha256=77x27VsJjqMSGKsEkcNffsjJHavtU64vJxiWX5o-kHk,9380
39
- python_inspector-0.14.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
- python_inspector-0.14.3.dist-info/entry_points.txt,sha256=2s9F95rPWbgz3cOnKN3Z7PwzglPt2EsX2qf7W0Xubpk,87
41
- python_inspector-0.14.3.dist-info/top_level.txt,sha256=C-KAHTL8C6jd7QULvFk83YjOBVxDrnyefG3RikRHRlw,31
42
- python_inspector-0.14.3.dist-info/RECORD,,
32
+ python_inspector-0.15.0.dist-info/licenses/AUTHORS.rst,sha256=cLH597eiqyd4cSHJ9Ny_CcbSWzTT7_VTCg3Zw43b4Ns,107
33
+ python_inspector-0.15.0.dist-info/licenses/CHANGELOG.rst,sha256=pqXm6Y962ADyckNliN4bjPs2Z-iHce5-poMAxj4LWyY,6419
34
+ python_inspector-0.15.0.dist-info/licenses/CODE_OF_CONDUCT.rst,sha256=xXDTFpYY3Y7JoxrWADihieUvhGlwJc_oxsbmLJaBvE4,3422
35
+ python_inspector-0.15.0.dist-info/licenses/NOTICE,sha256=fkLIlzyP8zWNnPbFSXkTInNgYl35THH5-J8vMKuNzhc,761
36
+ python_inspector-0.15.0.dist-info/licenses/README.rst,sha256=ucUCSQt39WlNfVdOl_1WbuvBqEN0NZm_h5o_vltNFps,7033
37
+ python_inspector-0.15.0.dist-info/licenses/apache-2.0.LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
38
+ python_inspector-0.15.0.dist-info/METADATA,sha256=MF4_8Jdalv3aNviIrcIty7lbhBhyT7EJ5aZKdSHOh0U,9381
39
+ python_inspector-0.15.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
+ python_inspector-0.15.0.dist-info/entry_points.txt,sha256=2s9F95rPWbgz3cOnKN3Z7PwzglPt2EsX2qf7W0Xubpk,87
41
+ python_inspector-0.15.0.dist-info/top_level.txt,sha256=C-KAHTL8C6jd7QULvFk83YjOBVxDrnyefG3RikRHRlw,31
42
+ python_inspector-0.15.0.dist-info/RECORD,,
@@ -1,3 +1,4 @@
1
1
  The following organizations or individuals have contributed to this repo:
2
2
 
3
3
  - nexB Inc.
4
+ - Robert Bosch GmbH
@@ -1,6 +1,18 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ v0.15.0
5
+ -----------
6
+
7
+ - Drop support for python3.9 and add support for python3.14
8
+ - Ensure that cached file is not empty before use https://github.com/aboutcode-org/python-inspector/pull/251
9
+ - Filter out empty values from install_requires https://github.com/aboutcode-org/python-inspector/pull/250
10
+
11
+ v0.14.4
12
+ -----------
13
+
14
+ - Cleanup requirement string to avoid packvers parsing issues https://github.com/aboutcode-org/python-inspector/pull/244
15
+ - Fix resolution issues for pre-release versions https://github.com/aboutcode-org/python-inspector/pull/248
4
16
 
5
17
  v0.14.3
6
18
  -----------