pysimplesoap / pysimplesoap

Python Simple SOAP Library
http://code.google.com/p/pysimplesoap/
Other
373 stars 229 forks source link

Remove transitional stuff from setup.py? #101

Open Jc2k opened 8 years ago

Jc2k commented 8 years ago

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:

Jc2k commented 8 years ago

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 commented 8 years ago

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

Jc2k commented 8 years ago

I'm still hoping for a fix too..

SafdarM commented 6 years ago

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.