Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rez platform_ broken with python3.8 #883

Closed
predat opened this issue Apr 30, 2020 · 0 comments · Fixed by #954
Closed

rez platform_ broken with python3.8 #883

predat opened this issue Apr 30, 2020 · 0 comments · Fixed by #954

Comments

@predat
Copy link
Contributor

predat commented Apr 30, 2020

Summary

According to https://bugs.python.org/issue28167, 'platform.linux_distribution()' and ' platform.dist()' are remove in python 3.8.
https://github.com/nir0s/distro could be include in 'vendor' directrory and use 'distro.linux_distribution()'?

Info

Rez version: master efabf3e
Platform and operating system: Arch Linux
Simplest possible steps to reproduce:

rez-env
Traceback (most recent call last):
  File "/opt/rez/lib/python3.8/site-packages/rez/vendor/version/version.py", line 863, in __init__
    parser = _VersionRangeParser(range_str, make_token,
  File "/opt/rez/lib/python3.8/site-packages/rez/vendor/version/version.py", line 665, in __init__
    raise ParseException("Syntax error in version range '%s'" % part)
rez.vendor.version.util.ParseException: Syntax error in version range '=={system.os}'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/rez/bin/rez/rez-env", line 8, in <module>
    sys.exit(run_rez_env())
  File "/opt/rez/lib/python3.8/site-packages/rez/cli/_entry_points.py", line 152, in run_rez_env
    return run("env")
  File "/opt/rez/lib/python3.8/site-packages/rez/cli/_main.py", line 160, in run
    returncode = run_cmd()
  File "/opt/rez/lib/python3.8/site-packages/rez/cli/_main.py", line 152, in run_cmd
    return func(opts, opts.parser, extra_arg_groups)
  File "/opt/rez/lib/python3.8/site-packages/rez/cli/env.py", line 195, in command
    context = ResolvedContext(package_requests=request,
  File "/opt/rez/lib/python3.8/site-packages/rez/resolved_context.py", line 209, in __init__
    self.implicit_packages = [PackageRequest(x)
  File "/opt/rez/lib/python3.8/site-packages/rez/resolved_context.py", line 209, in <listcomp>
    self.implicit_packages = [PackageRequest(x)
  File "/opt/rez/lib/python3.8/site-packages/rez/utils/formatting.py", line 64, in __init__
    super(PackageRequest, self).__init__(s)
  File "/opt/rez/lib/python3.8/site-packages/rez/vendor/version/requirement.py", line 152, in __init__
    self.range_ = VersionRange(
  File "/opt/rez/lib/python3.8/site-packages/rez/vendor/version/version.py", line 867, in __init__
    raise VersionError("Syntax error in version range '%s': %s"
rez.vendor.version.util.VersionError: Syntax error in version range '=={system.os}': Syntax error in version range '=={system.os}'
[predat@homepc rez (master)]$ rez-bind os
searching /opt/rez/lib/python3.8/site-packages/rez/bind...
creating package 'os' in /home/predat/packages...
Traceback (most recent call last):
  File "/opt/rez/lib/python3.8/site-packages/rez/utils/platform_.py", line 271, in _os
    distributor_, release_, _ = platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/rez/bin/rez/rez-bind", line 8, in <module>
    sys.exit(run_rez_bind())
  File "/opt/rez/lib/python3.8/site-packages/rez/cli/_entry_points.py", line 103, in run_rez_bind
    return run("bind")
  File "/opt/rez/lib/python3.8/site-packages/rez/cli/_main.py", line 160, in run
    returncode = run_cmd()
  File "/opt/rez/lib/python3.8/site-packages/rez/cli/_main.py", line 152, in run_cmd
    return func(opts, opts.parser, extra_arg_groups)
  File "/opt/rez/lib/python3.8/site-packages/rez/cli/bind.py", line 101, in command
    bind_package(name,
  File "/opt/rez/lib/python3.8/site-packages/rez/package_bind.py", line 110, in bind_package
    variants_ = _bind_package(name_,
  File "/opt/rez/lib/python3.8/site-packages/rez/package_bind.py", line 175, in _bind_package
    variants = bindfunc(path=install_path,
  File "/opt/rez/lib/python3.8/site-packages/rez/bind/os.py", line 12, in bind
    version = Version(system.os)
  File "/opt/rez/lib/python3.8/site-packages/rez/utils/data_utils.py", line 191, in __get__
    result = self.func(instance)
  File "/opt/rez/lib/python3.8/site-packages/rez/system.py", line 52, in os
    r = platform_.os
  File "/opt/rez/lib/python3.8/site-packages/rez/utils/data_utils.py", line 191, in __get__
    result = self.func(instance)
  File "/opt/rez/lib/python3.8/site-packages/rez/utils/platform_mapped.py", line 31, in inner
    result = func(*args, **kwargs)
  File "/opt/rez/lib/python3.8/site-packages/rez/utils/platform_.py", line 33, in os
    return self._os()
  File "/opt/rez/lib/python3.8/site-packages/rez/utils/platform_.py", line 273, in _os
    distributor_, release_, _ = platform.dist()
AttributeError: module 'platform' has no attribute 'dist'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant