Skip to content

rez pip install issue with Qt.py 1.4 #1941

Open
@vincentullmann

Description

@vincentullmann

Describe the bug here.

Environment

  • OS: Ubuntunu 22.04
  • Rez version: 3.2.1
  • Rez python version (output of "rez-python --version"): Python 3.11.11

To Reproduce

  1. rez pip -i -r Qt.py

Actual behavior
note: lines prefixes with [debug] are additional print statements added by me.

> me@carrotwo:~$ rez pip -i Qt.py
from_location /software/rez/3.2.1/lib/python3.11/site-packages setuptools-65.5.0.dist-info
from_location /software/rez/3.2.1/lib/python3.11/site-packages pip-25.0.1.dist-info
from_location /software/rez/3.2.1/lib/python3.11/site-packages rez-3.2.1.dist-info
from_location /software/rez/3.2.1/lib/python3.11/site-packages setuptools-65.5.0.dist-info
from_location /software/rez/3.2.1/lib/python3.11/site-packages pip-25.0.1.dist-info
from_location /software/rez/3.2.1/lib/python3.11/site-packages rez-3.2.1.dist-info
21:10:32 INFO     Trying to use pip from python package
21:10:32 INFO     Found pip-24.0 inside /software/packages/python/3.11.12/package.py. Will use it via /software/packages/python/3.11.12/platform-linux/arch-x86_64/bin/python3.11
21:10:32 INFO     Installing 'Qt.py' with pip taken from '/software/packages/python/3.11.12/platform-linux/arch-x86_64/bin/python3.11'
Collecting Qt.py
  Using cached qt_py-1.4.3-py2.py3-none-any.whl.metadata (29 kB)
Collecting types-PySide2 (from Qt.py)
  Using cached types_pyside2-5.15.2.1.7-py2.py3-none-any.whl.metadata (8.1 kB)
Using cached qt_py-1.4.3-py2.py3-none-any.whl (36 kB)
Using cached types_pyside2-5.15.2.1.7-py2.py3-none-any.whl (572 kB)
Installing collected packages: types-PySide2, Qt.py
Successfully installed Qt.py-1.4.3 types-PySide2-5.15.2.1.7

[notice] A new release of pip is available: 24.0 -> 25.0.1
[notice] To update, run: pip3 install --upgrade pip
[debug] Distribution.from_location /tmp/pip-9o16ipul-rez types_pyside2-5.15.2.1.7.dist-info
[debug] setuptools_dist.key = types-pyside2
[debug] installed_dist.key = qt.py
[debug] Distribution.from_location /tmp/pip-9o16ipul-rez qt_py-1.4.3.dist-info
[debug] setuptools_dist.key = qt-py
[debug] installed_dist.key = qt.py
Traceback (most recent call last):
  File "/software/rez/3.2.1/bin/rez/rez", line 8, in <module>
    sys.exit(run_rez())
             ^^^^^^^^^
  File "/software/rez/3.2.1/lib/python3.11/site-packages/rez/cli/_entry_points.py", line 69, in run_rez
    return run()
           ^^^^^
  File "/software/rez/3.2.1/lib/python3.11/site-packages/rez/cli/_main.py", line 189, in run
    returncode = run_cmd()
                 ^^^^^^^^^
  File "/software/rez/3.2.1/lib/python3.11/site-packages/rez/cli/_main.py", line 181, in run_cmd
    return func(opts, opts.parser, extra_arg_groups)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/software/rez/3.2.1/lib/python3.11/site-packages/rez/cli/pip.py", line 52, in command
    pip_install_package(
  File "/software/rez/3.2.1/lib/python3.11/site-packages/rez/pip.py", line 344, in pip_install_package
    rez_requires = get_rez_requirements(
                   ^^^^^^^^^^^^^^^^^^^^^
  File "/software/rez/3.2.1/lib/python3.11/site-packages/rez/utils/pip.py", line 392, in get_rez_requirements
    is_pure_python = is_pure_python_package(installed_dist)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/software/rez/3.2.1/lib/python3.11/site-packages/rez/utils/pip.py", line 316, in is_pure_python_package
    wheel_data = setuptools_dist.get_metadata("WHEEL")
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_metadata'

Workaround:
downgrading to Qt.py 1.3 seems to work

rez pip -i "Qt.py~=1.3.0"

Analysis:

  • It looks like the egg filename for Qt.py has changed in v1.4 from Qt.py-1.3.x.dist-info to qt_py-1.4.x.dist-info
  • Therefore the project_name extraced in Distribution.from_location has changed from Qt.py to qt_py
  • pkg_resources.safe_name used here replaces underscores but keeps dots (see my debug prints)
  • this leads to a missmatch of setuptools_dist.key = qt-py and pkg_resources.safe_name(installed_dist.key) = qt.py and results in the function returning None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrez-pipingesting py pkgs into rez (pip, wheels, etc)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions