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

Remove transitional stuff from setup.py? #101

Open
Jc2k opened this issue Nov 6, 2015 · 4 comments
Open

Remove transitional stuff from setup.py? #101

Jc2k opened this issue Nov 6, 2015 · 4 comments

Comments

@Jc2k
Copy link
Contributor

Jc2k commented Nov 6, 2015

Hi

Calling setup() in setup.py twice is weird and confuses pip.

One example is if you try to use wheels. We use wheels to speed up our Travis CI - our requirements.txt is fetched and compiled once, and future builds are about 10 minutes quicker (lots of dependencies!). Unfortunately, because setup() is called twice this no longer works:

  Running setup.py bdist_wheel for pysimplesoap
  Destination directory: /home/travis/wheelhouse
  Complete output from command /home/travis/virtualenv/python2.7.9/bin/python -c "import setuptools;__file__='/tmp/pip-build-v0_SSU/pysimplesoap/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /home/travis/wheelhouse:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/pysimplesoap
  copying pysimplesoap/__init__.py -> build/lib/pysimplesoap
  copying pysimplesoap/helpers.py -> build/lib/pysimplesoap
  copying pysimplesoap/c14n.py -> build/lib/pysimplesoap
  copying pysimplesoap/transport.py -> build/lib/pysimplesoap
  copying pysimplesoap/simplexml.py -> build/lib/pysimplesoap
  copying pysimplesoap/xmlsec.py -> build/lib/pysimplesoap
  copying pysimplesoap/plugins.py -> build/lib/pysimplesoap
  copying pysimplesoap/wsse.py -> build/lib/pysimplesoap
  copying pysimplesoap/client.py -> build/lib/pysimplesoap
  copying pysimplesoap/server.py -> build/lib/pysimplesoap
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  creating build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/__init__.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/helpers.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/c14n.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/transport.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/simplexml.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/xmlsec.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/plugins.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/wsse.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/client.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  copying build/lib/pysimplesoap/server.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  running install_egg_info
  running egg_info
  creating soap2py.egg-info
  writing soap2py.egg-info/PKG-INFO
  writing top-level names to soap2py.egg-info/top_level.txt
  writing dependency_links to soap2py.egg-info/dependency_links.txt
  writing manifest file 'soap2py.egg-info/SOURCES.txt'
  warning: manifest_maker: standard file '-c' not found
  reading manifest file 'soap2py.egg-info/SOURCES.txt'
  writing manifest file 'soap2py.egg-info/SOURCES.txt'
  Copying soap2py.egg-info to build/bdist.linux-x86_64/wheel/soap2py-1.16-py2.7.egg-info
  running install_scripts
  creating build/bdist.linux-x86_64/wheel/soap2py-1.16.dist-info/WHEEL
  running bdist_wheel
  running build
  running build_py
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  copying build/lib/pysimplesoap/__init__.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
  error: [Errno 2] No such file or directory: 'build/bdist.linux-x86_64/wheel/pysimplesoap/__init__.py'
  ----------------------------------------
  Failed building wheel for pysimplesoap

I recreated this locally, and fixed it by only calling setup() once.

Another weird thing is that if you pip install pysimplesoap in an empty virtualenv and do pip freeze you get:

$ pip freeze
PySimpleSOAP==1.16
soap2py==1.16

That's because setup.py is executed by pip during the install. So pip downloads pysimplesoap but setup.py install will install pysimplesoap and soap2py from that .tar.gz. Of course, depending on which one you install, the other won't have the correct installed_files.txt in its egg-info, so pip uninstall gets weird:

$ pip uninstall soap2py
Uninstalling soap2py-1.16:
  lib/python2.7/site-packages/pysimplesoap
  lib/python2.7/site-packages/soap2py-1.16-py2.7.egg-info
Proceed (y/n)? n

$ pip uninstall pysimplesoap
Uninstalling PySimpleSOAP-1.16:
  lib/python2.7/site-packages/PySimpleSOAP-1.16-py2.7.egg-info
  lib/python2.7/site-packages/pysimplesoap/__init__.py
  lib/python2.7/site-packages/pysimplesoap/__init__.pyc
  lib/python2.7/site-packages/pysimplesoap/c14n.py
  lib/python2.7/site-packages/pysimplesoap/c14n.pyc
  <snip>
  lib/python2.7/site-packages/pysimplesoap/xmlsec.py
  lib/python2.7/site-packages/pysimplesoap/xmlsec.pyc
Proceed (y/n)? n

And if you uninstall one of these it will leave the egg-info directory for the other.

And if someone else then installs your requirements.txt that you made with pip freeze then pip will install pysimplesoap which will install both, then soap2py which will install both. Fun times!

There are a couple of alternatives you could try:

  • Dummy project for the old name that just depends on the new name and has no other code, with a README.rst that gets shown on pypi to explain further.
  • Dummy project for the old name that just explodes when setup.py is run (with a message saying what the new name is). Same README as above.
@Jc2k
Copy link
Contributor Author

Jc2k commented Nov 9, 2015

Coincidentally, I hit a package that does options 2 - try 'pip install py.test'. It just does:

import sys
from distutils.core import setup

if __name__ == "__main__":
    if "sdist" not in sys.argv[1:]:
        raise ValueError("please use 'pytest' pypi package instead of 'py.test'")
    setup(
        name="py.test",
        version="0.0",
        description="please use 'pytest' for installation",
    )

@ematta
Copy link

ematta commented Apr 12, 2016

Has this ever been resolved? We are running into the same issues.

@Jc2k
Copy link
Contributor Author

Jc2k commented Apr 12, 2016

I'm still hoping for a fix too..

reingart added a commit that referenced this issue Jun 23, 2016
Drop transitional package (fixes #63 and #101)
@Jc2k Jc2k mentioned this issue Aug 2, 2016
@SafdarM
Copy link

SafdarM commented Apr 20, 2018

copying build/lib.linux-x86_64-2.7/pysimplesoap/helpers.py -> build/bdist.linux-x86_64/wheel/pysimplesoap
error: [Errno 2] No such file or directory: 'build/bdist.linux-x86_64/wheel/pysimplesoap/helpers.py'

I have been facing the same issue. I have deleted both pysimplesoap and soap2py and ran the execution. It is still prompting me with the same error.

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

No branches or pull requests

3 participants