You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
package resolution fails with TypeError: '<' not supported between instances of 'str' and 'NoneType' #240
python-inspector --python-version 313 --operating-system linux --json-pdt python-inspector.json --requirement requirements.txt --verbose
returns the following error message:
retrieve package data from pypi:
retrieved package 'pkg:pypi/aiohappyeyeballs@2.6.1'
retrieved package 'pkg:pypi/aiosignal@1.3.2'
retrieved package 'pkg:pypi/annotated-types@0.7.0'
retrieved package 'pkg:pypi/aiohttp@3.11.18'
retrieved package 'pkg:pypi/anyio@4.9.0'
retrieved package 'pkg:pypi/asgiref@3.8.1'
retrieved package 'pkg:pypi/attrs@25.3.0'
retrieved package 'pkg:pypi/azure-common@1.1.28'
Traceback (most recent call last):
File "/home/scheer/.local/lib/python3.12/site-packages/python_inspector/resolve_cli.py", line 259, in resolve_dependencies
resolution_result: Dict = resolver_api(
^^^^^^^^^^^^^
File "/home/scheer/.local/lib/python3.12/site-packages/python_inspector/api.py", line 312, in resolve_dependencies
packages = [pkg.to_dict() for pkg in asyncio.run(gather_pypi_data()) if pkg is not None]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/scheer/.local/lib/python3.12/site-packages/python_inspector/api.py", line 310, in gather_pypi_data
return await asyncio.gather(*[get_pypi_data(package) for package in purls])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scheer/.local/lib/python3.12/site-packages/python_inspector/api.py", line 298, in get_pypi_data
data = await get_pypi_data_from_purl(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scheer/.local/lib/python3.12/site-packages/python_inspector/package_data.py", line 82, in get_pypi_data_from_purl
wheel_url = choose_single_wheel(wheel_urls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/scheer/.local/lib/python3.12/site-packages/python_inspector/package_data.py", line 128, in choose_single_wheel wheel_urls.sort(reverse=True)
TypeError: '<' not supported between instances of 'str' and 'NoneType'
I found a very simple solution which works at least at my requirements.txt. The reason for the error is a none return value from wheel_urls, means no wheel for the retrieved package could be found.
package_data.py:
wheels_urls.sort expects a string and fails on none.
so the fix is a add a new command the line BEFORE wheel_urls.sort(reverse=True) to skip the none value:
wheel_urls = [url for url in wheel_urls if url is not None]
Could somebody please retribute this change to the project.
Activity
thomasscheer commentedon Aug 5, 2025
requirements.txt
thomasscheer commentedon Nov 20, 2025
I found a very simple solution which works at least at my requirements.txt. The reason for the error is a none return value from wheel_urls, means no wheel for the retrieved package could be found.
package_data.py:
wheels_urls.sort expects a string and fails on none.
so the fix is a add a new command the line BEFORE wheel_urls.sort(reverse=True) to skip the none value:
Could somebody please retribute this change to the project.
TG1999 commentedon Nov 24, 2025
Hey @thomasscheer, thanks for catching this. Can you please do the above changes in a PR ?
thomasscheer commentedon Nov 27, 2025
@TG1999 Currently I'm not allowed to push my branch to the repository of python-inspector. So I can't create a PR.
TG1999 commentedon Nov 27, 2025
Hey, @thomasscheer you can make a fork, and create a PR from the fork
thomasscheer commentedon Feb 3, 2026
@TG1999 PR created with Update package_data.py #255