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

lib2to3 will be removed in Python 3.10 #2086

Closed
hroncok opened this issue May 3, 2020 · 4 comments · Fixed by #2731 or 4dn-dcic/snovault#206
Closed

lib2to3 will be removed in Python 3.10 #2086

hroncok opened this issue May 3, 2020 · 4 comments · Fixed by #2731 or 4dn-dcic/snovault#206

Comments

@hroncok
Copy link
Contributor

hroncok commented May 3, 2020

See also #2081

The standard library module lib2to3 is deprecated and will be removed in Python 3.10.

https://bugs.python.org/issue40360

lib2to3 will likely become an external library available from PyPI, but my guess is that setuptools don't want to have more dependencies.

@hroncok
Copy link
Contributor Author

hroncok commented May 3, 2020

Here is what I think might be a path forward:

In the next setuptools release, using use_2to3 will become deprecated as well (with no set removal date). On Python 3.10, setuptools will have optional dependency (e.g. via setuptools[use_2to3]) on the 3rd party lib2to3 module to keep supporting installing old packages.

@jaraco
Copy link
Member

jaraco commented May 10, 2020

On Python 3.10, setuptools will have optional dependency (e.g. via setuptools[use_2to3]) on the 3rd party lib2to3 module to keep supporting installing old packages.

I'd prefer simply to drop support for building with 2to3 support and to require those old packages to be built on old versions of setuptools (or not at all). Regardless, let's get the deprecation in ASAP as possible to signal to users to stop using it.

@graingert
Copy link
Contributor

graingert commented Oct 4, 2020

I'm getting build failures because of this lib2to3 use https://github.com/twisted/ldaptor/runs/1205572060#step:12:103 so I'm in favour of it being removed.

note, you could use fissix instead of lib2to3, if you still wanted to support on the fly translation

openstack-mirroring pushed a commit to openstack/pbr that referenced this issue Oct 19, 2020
Odds are this was never used by any PBR-based projects, but was
included from the beginning to support a feature of Setuptools for a
utility which has been long since discouraged. As of Setuptools
46.2.0 and Python 3.9 it's generating deprecation warnings, and is
slated for removal from the Python 3.10 standard library.

https://bugs.python.org/issue40360
pypa/setuptools#2086

Change-Id: I6972984f29413d2534d802b142fa9323a7e4a4a3
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Oct 19, 2020
* Update pbr from branch 'master'
  - Merge "Remove use_2to3 backward compat for Setuptools"
  - Remove use_2to3 backward compat for Setuptools
    
    Odds are this was never used by any PBR-based projects, but was
    included from the beginning to support a feature of Setuptools for a
    utility which has been long since discouraged. As of Setuptools
    46.2.0 and Python 3.9 it's generating deprecation warnings, and is
    slated for removal from the Python 3.10 standard library.
    
    https://bugs.python.org/issue40360
    pypa/setuptools#2086
    
    Change-Id: I6972984f29413d2534d802b142fa9323a7e4a4a3
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Nov 13, 2020
Upstream issue: pypa/setuptools#2086

git-svn-id: file:///srv/repos/svn-community/svn@753826 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Nov 13, 2020
Upstream issue: pypa/setuptools#2086



git-svn-id: file:///srv/repos/svn-community/svn@753826 9fca08f4-af9d-4005-b8df-a31f2cc04f65
yan12125 added a commit to yan12125/buildbot that referenced this issue Nov 14, 2020
@graingert
Copy link
Contributor

graingert commented Jul 18, 2021

lib2to3 is still in Python3.10 as of Python 3.10.0b4 (default, Jul 12 2021, 22:16:23) [GCC 9.3.0] on linux

@graingert graingert mentioned this issue Jul 18, 2021
2 tasks
torbsorb referenced this issue in jimo1001/docutils-ast-writer Sep 7, 2021
This library does not support Python 3.x
because it uses `unicode` and `long` functions in `writer.py`.

Fix the problem by using the `use_2to3` option in `setup.py`.
halstead pushed a commit to openembedded/openembedded-core that referenced this issue Nov 8, 2021
Setuptools has removed support for 2to3 during builds since version
58[1]. But the nose's setup.py relies on use_2to3 option in setuptools,
it is failing an import and building without running 2to3 and generating
valid python3 code. As a workaround, we use command line 2to3 tool to
translate to Python3 code before build it.

Fixes:
$ python3
>>> import nose
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/site-packages/nose/_init_.py", line 1, in <module>
from nose.core import collector, main, run, run_exit, runmodule
File "/usr/lib/python3.10/site-packages/nose/core.py", line 153
print "%s version %s" % (os.path.basename(sys.argv[0]), _version_)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
>>>

[1] pypa/setuptools#2086

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kraj pushed a commit to YoeDistro/poky that referenced this issue Nov 8, 2021
Setuptools has removed support for 2to3 during builds since version
58[1]. But the nose's setup.py relies on use_2to3 option in setuptools,
it is failing an import and building without running 2to3 and generating
valid python3 code. As a workaround, we use command line 2to3 tool to
translate to Python3 code before build it.

Fixes:
$ python3
>>> import nose
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/site-packages/nose/_init_.py", line 1, in <module>
from nose.core import collector, main, run, run_exit, runmodule
File "/usr/lib/python3.10/site-packages/nose/core.py", line 153
print "%s version %s" % (os.path.basename(sys.argv[0]), _version_)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
>>>

[1] pypa/setuptools#2086

(From OE-Core rev: 11214c2de3282acb3a0fd28884d1a9c54c1c284a)

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kraj pushed a commit to YoeDistro/poky that referenced this issue Nov 8, 2021
Setuptools has removed support for 2to3 during builds since version
58[1]. But the nose's setup.py relies on use_2to3 option in setuptools,
it is failing an import and building without running 2to3 and generating
valid python3 code. As a workaround, we use command line 2to3 tool to
translate to Python3 code before build it.

Fixes:
$ python3
>>> import nose
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/site-packages/nose/_init_.py", line 1, in <module>
from nose.core import collector, main, run, run_exit, runmodule
File "/usr/lib/python3.10/site-packages/nose/core.py", line 153
print "%s version %s" % (os.path.basename(sys.argv[0]), _version_)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
>>>

[1] pypa/setuptools#2086

(From OE-Core rev: 11214c2de3282acb3a0fd28884d1a9c54c1c284a)

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
JostMigenda added a commit to SNEWS2/snewpy that referenced this issue Dec 14, 2021
* updated metadata
* remove unused imports
* remove deprecated argument, see pypa/setuptools#2086
ascherer97 referenced this issue in ascherer97/python-airsea Apr 20, 2022
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.

3 participants