Skip to content

Commit 577ed4d

Browse files
Fix resolution issues (#248)
* Update expected test results Signed-off-by: Martin Nonnenmacher <[email protected]> * Test all linux platforms defined in utils_pypi Use the list of linux platforms as defined in utils_pypi for testing, instead of redefining the list in the test. This ensures that newly added platforms are tested and fixes the problem that the list in the test was already outdated. Signed-off-by: Martin Nonnenmacher <[email protected]> * Add manylinux_2_31_x86_64 platform For example, the platform is used by open3d 19.0.0 [1]. [1]: https://pypi.org/project/open3d/0.19.0/#files Signed-off-by: Martin Nonnenmacher <[email protected]> * Fix `is_valid_version()` for prerelease versions By default, the check if an empty specifier contains a prerelease version returns `false`. This made the `is_valid_version()` check for prerelease versions fail, when there is also a requirement with a non-empty specifier. In this case, the previous logic detected a conflict of the prerelease version and the empty specifier. Fix this by explicitly allowing prerelease versions when checking if a specifier contains a version. Note that the function that collects candidates for a dependency still ignores prerelease versions if any release versions are available, as required by the specs [1]. [1]: https://packaging.python.org/en/latest/specifications/version-specifiers/#handling-of-pre-releases Signed-off-by: Martin Nonnenmacher <[email protected]> --------- Signed-off-by: Martin Nonnenmacher <[email protected]>
1 parent 8cb2bfc commit 577ed4d

14 files changed

+182
-200
lines changed

src/python_inspector/resolution.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ def is_valid_version(
172172
"""
173173
if parsed_version in bad_versions:
174174
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+
):
176178
if all(not r.specifier for r in requirements[identifier]):
177179
return True
178180
return False

src/python_inspector/utils_pypi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def get_python_dot_version(version):
155155
"manylinux2014_x86_64",
156156
"manylinux_2_27_x86_64",
157157
"manylinux_2_28_x86_64",
158+
"manylinux_2_31_x86_64",
158159
"manylinux2014_aarch6",
159160
"musllinux_1_2_x86_64",
160161
"manylinux_2_33_aarch64",

tests/data/azure-devops.req-310-expected.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -522,12 +522,12 @@
522522
"type": "pypi",
523523
"namespace": null,
524524
"name": "click",
525-
"version": "8.2.2",
525+
"version": "8.3.0",
526526
"qualifiers": {},
527527
"subpath": null,
528528
"primary_language": "Python",
529529
"description": "Composable command line interface toolkit\n<div align=\"center\"><img src=\"https://raw.githubusercontent.com/pallets/click/refs/heads/stable/docs/_static/click-name.svg\" alt=\"\" height=\"150\"></div>\n\n# Click\n\nClick is a Python package for creating beautiful command line interfaces\nin a composable way with as little code as necessary. It's the \"Command\nLine Interface Creation Kit\". It's highly configurable but comes with\nsensible defaults out of the box.\n\nIt aims to make the process of writing command line tools quick and fun\nwhile also preventing any frustration caused by the inability to\nimplement an intended CLI API.\n\nClick in three points:\n\n- Arbitrary nesting of commands\n- Automatic help page generation\n- Supports lazy loading of subcommands at runtime\n\n\n## A Simple Example\n\n```python\nimport click\n\[email protected]()\[email protected](\"--count\", default=1, help=\"Number of greetings.\")\[email protected](\"--name\", prompt=\"Your name\", help=\"The person to greet.\")\ndef hello(count, name):\n \"\"\"Simple program that greets NAME for a total of COUNT times.\"\"\"\n for _ in range(count):\n click.echo(f\"Hello, {name}!\")\n\nif __name__ == '__main__':\n hello()\n```\n\n```\n$ python hello.py --count=3\nYour name: Click\nHello, Click!\nHello, Click!\nHello, Click!\n```\n\n\n## Donate\n\nThe Pallets organization develops and supports Click and other popular\npackages. In order to grow the community of contributors and users, and\nallow the maintainers to devote more time to the projects, [please\ndonate today][].\n\n[please donate today]: https://palletsprojects.com/donate\n\n## Contributing\n\nSee our [detailed contributing documentation][contrib] for many ways to\ncontribute, including reporting issues, requesting features, asking or answering\nquestions, and making PRs.\n\n[contrib]: https://palletsprojects.com/contributing/",
530-
"release_date": "2025-08-02T02:23:39",
530+
"release_date": "2025-09-18T17:32:22",
531531
"parties": [
532532
{
533533
"type": "person",
@@ -545,11 +545,11 @@
545545
"Typing :: Typed"
546546
],
547547
"homepage_url": null,
548-
"download_url": "https://files.pythonhosted.org/packages/ec/85/e7297e34133ae1cfde3bffd30c24e1ef055248251baa877834e048687a28/click-8.2.2-py3-none-any.whl",
549-
"size": 103900,
548+
"download_url": "https://files.pythonhosted.org/packages/db/d3/9dcc0f5797f070ec8edf30fbadfb200e71d9db6b84d211e3b2085a7589a0/click-8.3.0-py3-none-any.whl",
549+
"size": 107295,
550550
"sha1": null,
551-
"md5": "7d180e1baded1a50d5ad31b43a965888",
552-
"sha256": "52e1e9f5d3db8c85aa76968c7c67ed41ddbacb167f43201511c8fd61eb5ba2ca",
551+
"md5": "dd99757a403a5728bb37a5cab4d46c83",
552+
"sha256": "9b9f285302c6e3064f4330c05f05b81945b2a39544279343e6e7c5f27a9baddc",
553553
"sha512": null,
554554
"bug_tracking_url": null,
555555
"code_view_url": "https://github.com/pallets/click/",
@@ -564,20 +564,20 @@
564564
"dependencies": [],
565565
"repository_homepage_url": null,
566566
"repository_download_url": null,
567-
"api_data_url": "https://pypi.org/pypi/click/8.2.2/json",
567+
"api_data_url": "https://pypi.org/pypi/click/8.3.0/json",
568568
"datasource_id": null,
569-
"purl": "pkg:pypi/click@8.2.2"
569+
"purl": "pkg:pypi/click@8.3.0"
570570
},
571571
{
572572
"type": "pypi",
573573
"namespace": null,
574574
"name": "cryptography",
575-
"version": "46.0.1",
575+
"version": "46.0.2",
576576
"qualifiers": {},
577577
"subpath": null,
578578
"primary_language": "Python",
579579
"description": "cryptography is a package which provides cryptographic recipes and primitives to Python developers.\npyca/cryptography\n=================\n\n.. image:: https://img.shields.io/pypi/v/cryptography.svg\n :target: https://pypi.org/project/cryptography/\n :alt: Latest Version\n\n.. image:: https://readthedocs.org/projects/cryptography/badge/?version=latest\n :target: https://cryptography.io\n :alt: Latest Docs\n\n.. image:: https://github.com/pyca/cryptography/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/pyca/cryptography/actions/workflows/ci.yml?query=branch%3Amain\n\n``cryptography`` is a package which provides cryptographic recipes and\nprimitives to Python developers. Our goal is for it to be your \"cryptographic\nstandard library\". It supports Python 3.8+ and PyPy3 7.3.11+.\n\n``cryptography`` includes both high level recipes and low level interfaces to\ncommon cryptographic algorithms such as symmetric ciphers, message digests, and\nkey derivation functions. For example, to encrypt something with\n``cryptography``'s high level symmetric encryption recipe:\n\n.. code-block:: pycon\n\n >>> from cryptography.fernet import Fernet\n >>> # Put this somewhere safe!\n >>> key = Fernet.generate_key()\n >>> f = Fernet(key)\n >>> token = f.encrypt(b\"A really secret message. Not for prying eyes.\")\n >>> token\n b'...'\n >>> f.decrypt(token)\n b'A really secret message. Not for prying eyes.'\n\nYou can find more information in the `documentation`_.\n\nYou can install ``cryptography`` with:\n\n.. code-block:: console\n\n $ pip install cryptography\n\nFor full details see `the installation documentation`_.\n\nDiscussion\n~~~~~~~~~~\n\nIf you run into bugs, you can file them in our `issue tracker`_.\n\nWe maintain a `cryptography-dev`_ mailing list for development discussion.\n\nYou can also join ``#pyca`` on ``irc.libera.chat`` to ask questions or get\ninvolved.\n\nSecurity\n~~~~~~~~\n\nNeed to report a security issue? Please consult our `security reporting`_\ndocumentation.\n\n\n.. _`documentation`: https://cryptography.io/\n.. _`the installation documentation`: https://cryptography.io/en/latest/installation/\n.. _`issue tracker`: https://github.com/pyca/cryptography/issues\n.. _`cryptography-dev`: https://mail.python.org/mailman/listinfo/cryptography-dev\n.. _`security reporting`: https://cryptography.io/en/latest/security/",
580-
"release_date": "2025-09-17T00:09:47",
580+
"release_date": "2025-10-01T00:28:26",
581581
"parties": [
582582
{
583583
"type": "person",
@@ -612,11 +612,11 @@
612612
"Topic :: Security :: Cryptography"
613613
],
614614
"homepage_url": null,
615-
"download_url": "https://files.pythonhosted.org/packages/a2/67/65dc233c1ddd688073cf7b136b06ff4b84bf517ba5529607c9d79720fc67/cryptography-46.0.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
616-
"size": 4562369,
615+
"download_url": "https://files.pythonhosted.org/packages/a8/5d/1fdbd2e5c1ba822828d250e5a966622ef00185e476d1cd2726b6dd135e53/cryptography-46.0.2-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
616+
"size": 4439524,
617617
"sha1": null,
618-
"md5": "329af3462aa6c5e199ab4681bf0be5ba",
619-
"sha256": "341fb7a26bc9d6093c1b124b9f13acc283d2d51da440b98b55ab3f79f2522ead",
618+
"md5": "f3d262ca380c380953e41d9b95ca67e6",
619+
"sha256": "bca3f0ce67e5a2a2cf524e86f44697c4323a86e0fd7ba857de1c30d52c11ede1",
620620
"sha512": null,
621621
"bug_tracking_url": null,
622622
"code_view_url": null,
@@ -631,9 +631,9 @@
631631
"dependencies": [],
632632
"repository_homepage_url": null,
633633
"repository_download_url": null,
634-
"api_data_url": "https://pypi.org/pypi/cryptography/46.0.1/json",
634+
"api_data_url": "https://pypi.org/pypi/cryptography/46.0.2/json",
635635
"datasource_id": null,
636-
"purl": "pkg:pypi/[email protected].1"
636+
"purl": "pkg:pypi/[email protected].2"
637637
},
638638
{
639639
"type": "pypi",
@@ -1323,7 +1323,7 @@
13231323
"package": "pkg:pypi/[email protected]",
13241324
"dependencies": [
13251325
"pkg:pypi/[email protected]",
1326-
"pkg:pypi/[email protected].1",
1326+
"pkg:pypi/[email protected].2",
13271327
"pkg:pypi/[email protected]",
13281328
"pkg:pypi/[email protected]"
13291329
]
@@ -1343,11 +1343,11 @@
13431343
"dependencies": []
13441344
},
13451345
{
1346-
"package": "pkg:pypi/click@8.2.2",
1346+
"package": "pkg:pypi/click@8.3.0",
13471347
"dependencies": []
13481348
},
13491349
{
1350-
"package": "pkg:pypi/[email protected].1",
1350+
"package": "pkg:pypi/[email protected].2",
13511351
"dependencies": [
13521352
"pkg:pypi/[email protected]",
13531353
"pkg:pypi/[email protected]"

tests/data/azure-devops.req-312-expected.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -522,12 +522,12 @@
522522
"type": "pypi",
523523
"namespace": null,
524524
"name": "click",
525-
"version": "8.2.2",
525+
"version": "8.3.0",
526526
"qualifiers": {},
527527
"subpath": null,
528528
"primary_language": "Python",
529529
"description": "Composable command line interface toolkit\n<div align=\"center\"><img src=\"https://raw.githubusercontent.com/pallets/click/refs/heads/stable/docs/_static/click-name.svg\" alt=\"\" height=\"150\"></div>\n\n# Click\n\nClick is a Python package for creating beautiful command line interfaces\nin a composable way with as little code as necessary. It's the \"Command\nLine Interface Creation Kit\". It's highly configurable but comes with\nsensible defaults out of the box.\n\nIt aims to make the process of writing command line tools quick and fun\nwhile also preventing any frustration caused by the inability to\nimplement an intended CLI API.\n\nClick in three points:\n\n- Arbitrary nesting of commands\n- Automatic help page generation\n- Supports lazy loading of subcommands at runtime\n\n\n## A Simple Example\n\n```python\nimport click\n\[email protected]()\[email protected](\"--count\", default=1, help=\"Number of greetings.\")\[email protected](\"--name\", prompt=\"Your name\", help=\"The person to greet.\")\ndef hello(count, name):\n \"\"\"Simple program that greets NAME for a total of COUNT times.\"\"\"\n for _ in range(count):\n click.echo(f\"Hello, {name}!\")\n\nif __name__ == '__main__':\n hello()\n```\n\n```\n$ python hello.py --count=3\nYour name: Click\nHello, Click!\nHello, Click!\nHello, Click!\n```\n\n\n## Donate\n\nThe Pallets organization develops and supports Click and other popular\npackages. In order to grow the community of contributors and users, and\nallow the maintainers to devote more time to the projects, [please\ndonate today][].\n\n[please donate today]: https://palletsprojects.com/donate\n\n## Contributing\n\nSee our [detailed contributing documentation][contrib] for many ways to\ncontribute, including reporting issues, requesting features, asking or answering\nquestions, and making PRs.\n\n[contrib]: https://palletsprojects.com/contributing/",
530-
"release_date": "2025-08-02T02:23:39",
530+
"release_date": "2025-09-18T17:32:22",
531531
"parties": [
532532
{
533533
"type": "person",
@@ -545,11 +545,11 @@
545545
"Typing :: Typed"
546546
],
547547
"homepage_url": null,
548-
"download_url": "https://files.pythonhosted.org/packages/ec/85/e7297e34133ae1cfde3bffd30c24e1ef055248251baa877834e048687a28/click-8.2.2-py3-none-any.whl",
549-
"size": 103900,
548+
"download_url": "https://files.pythonhosted.org/packages/db/d3/9dcc0f5797f070ec8edf30fbadfb200e71d9db6b84d211e3b2085a7589a0/click-8.3.0-py3-none-any.whl",
549+
"size": 107295,
550550
"sha1": null,
551-
"md5": "7d180e1baded1a50d5ad31b43a965888",
552-
"sha256": "52e1e9f5d3db8c85aa76968c7c67ed41ddbacb167f43201511c8fd61eb5ba2ca",
551+
"md5": "dd99757a403a5728bb37a5cab4d46c83",
552+
"sha256": "9b9f285302c6e3064f4330c05f05b81945b2a39544279343e6e7c5f27a9baddc",
553553
"sha512": null,
554554
"bug_tracking_url": null,
555555
"code_view_url": "https://github.com/pallets/click/",
@@ -564,20 +564,20 @@
564564
"dependencies": [],
565565
"repository_homepage_url": null,
566566
"repository_download_url": null,
567-
"api_data_url": "https://pypi.org/pypi/click/8.2.2/json",
567+
"api_data_url": "https://pypi.org/pypi/click/8.3.0/json",
568568
"datasource_id": null,
569-
"purl": "pkg:pypi/click@8.2.2"
569+
"purl": "pkg:pypi/click@8.3.0"
570570
},
571571
{
572572
"type": "pypi",
573573
"namespace": null,
574574
"name": "cryptography",
575-
"version": "46.0.1",
575+
"version": "46.0.2",
576576
"qualifiers": {},
577577
"subpath": null,
578578
"primary_language": "Python",
579579
"description": "cryptography is a package which provides cryptographic recipes and primitives to Python developers.\npyca/cryptography\n=================\n\n.. image:: https://img.shields.io/pypi/v/cryptography.svg\n :target: https://pypi.org/project/cryptography/\n :alt: Latest Version\n\n.. image:: https://readthedocs.org/projects/cryptography/badge/?version=latest\n :target: https://cryptography.io\n :alt: Latest Docs\n\n.. image:: https://github.com/pyca/cryptography/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/pyca/cryptography/actions/workflows/ci.yml?query=branch%3Amain\n\n``cryptography`` is a package which provides cryptographic recipes and\nprimitives to Python developers. Our goal is for it to be your \"cryptographic\nstandard library\". It supports Python 3.8+ and PyPy3 7.3.11+.\n\n``cryptography`` includes both high level recipes and low level interfaces to\ncommon cryptographic algorithms such as symmetric ciphers, message digests, and\nkey derivation functions. For example, to encrypt something with\n``cryptography``'s high level symmetric encryption recipe:\n\n.. code-block:: pycon\n\n >>> from cryptography.fernet import Fernet\n >>> # Put this somewhere safe!\n >>> key = Fernet.generate_key()\n >>> f = Fernet(key)\n >>> token = f.encrypt(b\"A really secret message. Not for prying eyes.\")\n >>> token\n b'...'\n >>> f.decrypt(token)\n b'A really secret message. Not for prying eyes.'\n\nYou can find more information in the `documentation`_.\n\nYou can install ``cryptography`` with:\n\n.. code-block:: console\n\n $ pip install cryptography\n\nFor full details see `the installation documentation`_.\n\nDiscussion\n~~~~~~~~~~\n\nIf you run into bugs, you can file them in our `issue tracker`_.\n\nWe maintain a `cryptography-dev`_ mailing list for development discussion.\n\nYou can also join ``#pyca`` on ``irc.libera.chat`` to ask questions or get\ninvolved.\n\nSecurity\n~~~~~~~~\n\nNeed to report a security issue? Please consult our `security reporting`_\ndocumentation.\n\n\n.. _`documentation`: https://cryptography.io/\n.. _`the installation documentation`: https://cryptography.io/en/latest/installation/\n.. _`issue tracker`: https://github.com/pyca/cryptography/issues\n.. _`cryptography-dev`: https://mail.python.org/mailman/listinfo/cryptography-dev\n.. _`security reporting`: https://cryptography.io/en/latest/security/",
580-
"release_date": "2025-09-17T00:08:49",
580+
"release_date": "2025-10-01T00:27:27",
581581
"parties": [
582582
{
583583
"type": "person",
@@ -612,11 +612,11 @@
612612
"Topic :: Security :: Cryptography"
613613
],
614614
"homepage_url": null,
615-
"download_url": "https://files.pythonhosted.org/packages/e5/d3/de61ad5b52433b389afca0bc70f02a7a1f074651221f599ce368da0fe437/cryptography-46.0.1-cp311-abi3-manylinux_2_28_x86_64.whl",
616-
"size": 4604234,
615+
"download_url": "https://files.pythonhosted.org/packages/e4/27/0f190ada240003119488ae66c897b5e97149292988f556aef4a6a2a57595/cryptography-46.0.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
616+
"size": 4450899,
617617
"sha1": null,
618-
"md5": "b3c22ab264b0f5a2ffc43bd9978e19e5",
619-
"sha256": "f7a24ea78de345cfa7f6a8d3bde8b242c7fac27f2bd78fa23474ca38dfaeeab9",
618+
"md5": "e8433775be9e1568bc3c70c4c84b1b47",
619+
"sha256": "bb7fb9cd44c2582aa5990cf61a4183e6f54eea3172e54963787ba47287edd135",
620620
"sha512": null,
621621
"bug_tracking_url": null,
622622
"code_view_url": null,
@@ -631,9 +631,9 @@
631631
"dependencies": [],
632632
"repository_homepage_url": null,
633633
"repository_download_url": null,
634-
"api_data_url": "https://pypi.org/pypi/cryptography/46.0.1/json",
634+
"api_data_url": "https://pypi.org/pypi/cryptography/46.0.2/json",
635635
"datasource_id": null,
636-
"purl": "pkg:pypi/[email protected].1"
636+
"purl": "pkg:pypi/[email protected].2"
637637
},
638638
{
639639
"type": "pypi",
@@ -1323,7 +1323,7 @@
13231323
"package": "pkg:pypi/[email protected]",
13241324
"dependencies": [
13251325
"pkg:pypi/[email protected]",
1326-
"pkg:pypi/[email protected].1",
1326+
"pkg:pypi/[email protected].2",
13271327
"pkg:pypi/[email protected]",
13281328
"pkg:pypi/[email protected]"
13291329
]
@@ -1343,11 +1343,11 @@
13431343
"dependencies": []
13441344
},
13451345
{
1346-
"package": "pkg:pypi/click@8.2.2",
1346+
"package": "pkg:pypi/click@8.3.0",
13471347
"dependencies": []
13481348
},
13491349
{
1350-
"package": "pkg:pypi/[email protected].1",
1350+
"package": "pkg:pypi/[email protected].2",
13511351
"dependencies": [
13521352
"pkg:pypi/[email protected]",
13531353
"pkg:pypi/[email protected]"

0 commit comments

Comments
 (0)