AcademySoftwareFoundation / rez

An integrated package configuration, build and deployment system for software
https://rez.readthedocs.io
Apache License 2.0
938 stars 332 forks source link

Installing Rez with Python 3.12 causes errors because of old six vendored version #1612

Open victorfleury opened 8 months ago

victorfleury commented 8 months ago

I tried to install Rez on my machine with Python 3.12 on Fedora 39

The installation script seemed to run almost flawlessly except for the end where even if I got a SUCCESS message it turned out to be a faulty installation with the following traceback (see below)

After a bit of investigation from @JeanChristopheMorinPerso it looks like the vendored six package is not enough up to date. Rez bundles six-1.12.0 when Python 3.12 comes up with six-1.16.0.

One solution would be to update the bundled version of six with Rez. The other probably to remove the vendored version of six and use the one from the system Python already.

Environment

To Reproduce

  1. Run a linux distro with Python 3.12
  2. Run the installation script

Expected behavior The expected behaviour would have been to get Rez installed and ready to use.

Actual behavior The actual result was this traceback :

SUCCESS!
Rez executable installed to: /opt/rez/bin/rez/rez
Traceback (most recent call last):
  File "/opt/rez/bin/rez/rez", line 8, in <module>
    sys.exit(run_rez())
             ^^^^^^^^^
  File "/opt/rez/lib64/python3.12/site-packages/rez/cli/_entry_points.py", line 68, in run_rez
    from rez.cli._main import run
  File "/opt/rez/lib64/python3.12/site-packages/rez/cli/_main.py", line 13, in <module>
    from rez.cli._util import subcommands, LazyArgumentParser, _env_var_true
  File "/opt/rez/lib64/python3.12/site-packages/rez/cli/_util.py", line 123, in <module>
    subcommands.update(load_plugin_cmd())
                       ^^^^^^^^^^^^^^^^^
  File "/opt/rez/lib64/python3.12/site-packages/rez/cli/_util.py", line 90, in load_plugin_cmd
    from rez.config import config
  File "/opt/rez/lib64/python3.12/site-packages/rez/config.py", line 12, in <module>
    from rez.utils.scope import scoped_format
  File "/opt/rez/lib64/python3.12/site-packages/rez/utils/scope.py", line 8, in <module>
    from rez.vendor.six.six.moves import UserDict
ModuleNotFoundError: No module named 'rez.vendor.six.six.moves'

To activate Rez, add the following path to $PATH:
/opt/rez/bin/rez

You may also want to source the completion script (for bash):
source /opt/rez/completion/complete.sh

And running any rez commands would end up spitting out the same error message.

JeanChristopheMorinPerso commented 7 months ago

Thanks for reporting this! We'll have a couple of changes to do before we can support Python 3.12.

Hopefully we should be able to get to fixing this after support for Python 2.7 is removed (so post rez 3.0).

victorfleury commented 7 months ago

Looks like it is working fine with the new 3.0.0 version. Just spotted a small typo in rezconfig.py making Python complain about a bad escaping sequence.

JeanChristopheMorinPerso commented 7 months ago

I think it'll fail later, somewhere in the plugin loading stage.

victorfleury commented 7 months ago

Indeed, trying both rez bind and rez build yields errors :

Traceback (most recent call last):
  File "/opt/rez/lib64/python3.12/site-packages/rez/plugin_managers.py", line 211, in get_plugin_class
    return self.plugin_classes[plugin_name]
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'memory'