goshippo / shippo-python-client

Shipping API Python library (USPS, FedEx, UPS and more)
https://goshippo.com/docs
MIT License
123 stars 70 forks source link

Fix bug in setup.py with Python 3.5 #16

Closed cmorbitzer closed 8 years ago

cmorbitzer commented 8 years ago

Installing from the source distribution fails for Shippo 1.2.2 with Python 3.5:

[root@localhost ~]# pip install shippo
Collecting shippo
  Using cached shippo-1.2.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-5_1ok3na/shippo/setup.py", line 5, in <module>
        from version import VERSION
    ImportError: No module named 'version'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5_1ok3na/shippo/

This is because version.py is not included in the base directory of the archive with setup.py. Moving import VERSION to beneath the line where shippo/ is added to the search paths for modules fixes this issue. I think this change also makes /version.py unnecessary.

Tests, wheels, and source distributions created on Python 2.7 and 3.5. All tests pass and all distribution packages install successfully.

mnowik commented 8 years ago

@cmorbitzer Thanks for the PR. I will take care of this.