braintree / braintree_python

Braintree Python library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
242 stars 115 forks source link

Declare package version in 'setup.py' to enable installing 'requests' as a dependency #36

Closed paparomeo closed 10 years ago

paparomeo commented 10 years ago

Importing the braintree.version module in setup.py will import the braintree package which in turn, by importing all its modules into its namespace will end in the chain of imports attempt to import requests. This prevents setup.py from working correctly if requests hasn't been previously installed manually.

The proposed change, by moving the package version declaration to setup.py and then reading that in braintree.version avoids this problem and enables the automatic install of requests as a dependency.

agjohnson commented 10 years ago

I'm hitting the same issue here when installing python_3_beta fresh, without requests installed beforehand. Any word on this?

agfor commented 10 years ago

@pmcnr @agjohnson Thanks for the report. pkg_resources is part of setuptools, not the standard library. We try to avoid dependencies whenever possible so I don't think the proposed fix works in this case. It looks like the simplest solution is putting the version string in both version.py and setup.py. I'll do that in the next version of the python_3_beta branch unless a better idea presents itself.

If you have any other problems / have any feedback about the python_3_beta branch, please let us / me know.

fuhrysteve commented 10 years ago

https://github.com/braintree/braintree_python/pull/39 addresses this without depending on setuptools.

agfor commented 10 years ago

Fixed by 3.0.0.