-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
python setup.py egg_info is broken #78
Comments
So the idea is to make dependencies (like cython and numpy) be only imported in the else case? This is for a fresh install to not require dependencies? I'm a little confused about the use-case. |
No, this is to fix projects relying on systems like tox ( actually any build automation software or CI ), which use Any project you will want to build using ta_lib, if you put ta_lib in The reason, is that pip internally uses To verify, try to run This is already fixed by most upstream packages ( numpy, etc. ) which used to have the same issue. |
So I want to hide import errors in the case of It seems kinda lame that pip leaks this build dependency problem to everyone's |
Does this work for you? |
This is more about the correct usage of setuptools - which are notoriously hard to use properly and are almost unusable. Unfortunately no: at minimum three use cases should work:
You would also need to add: from setuptools import setup, find_packages I apologize for not submitting proper pull request, I'm a bit constrained, let me know if you want me to fix it I will try to submit proper pull request later. |
After looking at setup, it seems more work is required - here is better example, with cythonized extensions: |
I don't mind fixing it -- any idea how to get |
Yes,
on top |
That makes |
Unforutnately, no - I know, that's a mess - there is no clean way to do everything, that's why if len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
sys.argv[1] in ('--help-commands', 'egg_info', '--version',
'clean')):
# Use setuptools for these commands (they don't work well or at all
# with distutils). For normal builds use distutils.
try:
from setuptools import setup
except ImportError:
from distutils.core import setup I think that's probably the best way |
Ok, thanks @ayoshi, I will work on this today. |
Okay, pushed some fixes so it works on a fresh install without numpy and cython and all three of those setup.py commands exit with 0. |
Sorry - there is still something missing - setup.py develop will not work properly, that will break installing from URL I think. It might be the cython requirement is missing in setupy.py .
|
Hmm, this might be a good time to fix that - I've wanted ta-lib to not require cython to install unless you're making changes or compiling the |
Okay, I think |
Thank you! It works! |
This is a very common issue, that breaks an ability to move ta-lib to requirements.txt,
making tox builds unusable.
The problem is that is simple cases ( --help and egg_info ) setup.py shouldn't import any requirements, or build requirements.
Simplest fix is to move all imports into conditional block, example from :
https://github.com/Unidata/netcdf4-python/blob/master/setup.py
The text was updated successfully, but these errors were encountered: