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

bdist_egg doesn't run 2to3 after bdist_egg with python-2.x #135

Closed
ghost opened this issue Jan 10, 2014 · 4 comments
Closed

bdist_egg doesn't run 2to3 after bdist_egg with python-2.x #135

ghost opened this issue Jan 10, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 10, 2014

Originally reported by: shimizukawa (Bitbucket: shimizukawa, GitHub: shimizukawa)


If the source directory have build/lib that was created by python-2.x setup.py bdist_egg, bdist_egg (and bdist_wheel) with python3 does not invoke 2to3 process.

A similar issue #102 's workaround doesn't work for me.

bdist_egg with python3 generate egg successfully:

#!bash

$ cd sphinx-1.2  #or some kind of source that have 2to3
$ rm -Rf build
$ python-3.3 setup.py bdist_egg
...(with 2to3 and generate 2to3ed egg in successfully)...

bdist_egg with python2 and python3 generate broken py3-egg:

#!bash

$ rm -Rf build
$ python-2.7 setup.py bdist_egg
...(success)...
$ python-3.3 setup.py bdist_egg
...(without 2to3 and generate non-2to3ed egg)...

bdist_egg with python3 and python2 generate broken py2-egg:

#!bash

$ rm -Rf build
$ python-3.3 setup.py bdist_egg
...(with 2to3 and generate 2to3ed egg in successfully)...
$ python-2.7 setup.py bdist_egg
...(use 2to3ed source to generate egg)...

IMO, setuptools should separate build/lib directory for 2to3 and non-2to3.

And there are my current workarounds:

  1. use different build directory like setup.py build -b build.py33 bdist_egg
  2. remove build directory before packaging with another python version
  3. don't use 2to3
  4. don't use bdist_* (egg, wheel, ...)

FYI: this issue's behavior is confirmed with distribute-0.6.49, setuptools-0.9.8, 1.4.2, 2.1.


@ghost
Copy link
Author

ghost commented Jan 10, 2014

Original comment by aodag (Bitbucket: aodag, GitHub: aodag):


default build_lib is defined by distutils.

http://hg.python.org/cpython/file/fff1455e1147/Lib/distutils/command/build.py#l92

@ghost
Copy link
Author

ghost commented Jan 19, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


I agree. I've encountered this situation myself a number of times.

I've half a mind to say that setuptools should clear the build directory on each build of 2to3 is enabled. Otherwise, I don't believe there's any clear signal as to whether the code in the build directory has had 2to3 applied or not. I suspect also that distutils is subject to the same issue if the 'build_py_2to3' command is used per the documentation, though I haven't confirmed that. Regardless of distutils behavior, there's no reason setuptools can't improve on it.

I'm open to patch submissions or pull requests regarding this issue.

@ghost
Copy link
Author

ghost commented Jan 25, 2015

Original comment by stefanholek (Bitbucket: stefanholek, GitHub: stefanholek):


Use of 2to3 pretty much requires an sdist in my opinion.

@jaraco
Copy link
Member

jaraco commented Sep 13, 2021

This issue is now obsolete. See #1120.

@jaraco jaraco closed this as completed Sep 13, 2021
jaraco added a commit that referenced this issue Apr 10, 2022
Update test_home_installation_scheme for pypy install paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant