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

The setup should not depend on the module it is setting up nor any depen... #38

Closed
wants to merge 1 commit into from

Conversation

merisbahti
Copy link

...dencies which would be resolved after the setup.

I've come across an issue when installing ipwhois.

When, for example installing from pip:
pip install ipwhois

results in this error:
ImportError: No module named 'dns'

This is because the setup.py file acquires the version number from the ipwhois module and thus depends on it.

The problem is that setup.py depends on ipwhois which depends on dnspython.
However, since setup.py hasn't installed the dependencies for ipwhois yet, the setup fails.

The solution could be:
Install the dns module before even attempting to install ipwhois.

This, however, is not a feasible solution for deployments such as Heroku, Openshift and other "butt" providers since the gears/nodes sometimes spin down and then, when using the requirements.txt flle to install the dependencies again, will fail.

This is because pip features "look before you leap" - pip ensures that all dependencies can be found, unpacked, and have working setup.py before it installs any of them. source: post #3 pypa/pip#25.

A better solution would be to not having to import ipwhois in the actual setup.py file, as is shown in this pull request.

…pendencies which would be resolved after the setup.
@qerub
Copy link

qerub commented May 15, 2014

The problem here is that the ipwhois module actually hasn't been installed yet

@3amice means the dnspython module here.

Here's my attempt at describing the problem: setup.py imports ipwhois/__init__.py which imports ipwhois/ipwhois.py which uses dnspython. This means that setup.py can't be loaded without having dnspython installed, which is a problem because that dependency isn't known until setup.py has been processed.

@qerub
Copy link

qerub commented May 15, 2014

Correction: @3amice meant the ipwhois module, but the actual problem is with the early import of dnspython. That means there's probably a better way to fix this than 7c8f7d0.

@merisbahti
Copy link
Author

I agree, the description was quite vague. I've corrected it.

@secynic
Copy link
Owner

secynic commented May 15, 2014

Thanks guys. I actually already pushed this fix to the dev branch the other day:
2dfb02f

It will be fixed in the next release.

@secynic secynic added the bug label May 15, 2014
@secynic secynic self-assigned this May 15, 2014
@netantho
Copy link

+1, I had to hack a pip install ipaddr dnspython before doing my pip install -r requirements.txt
That's very hackish and it would really help if you could release a new stable version with this change.
Thanks!

@chorsley
Copy link

Another +1 - just stumbled on this myself. Are there plans to merge this into master?

@secynic
Copy link
Owner

secynic commented Jul 23, 2014

Yes, I plan to push out the next major release before the end of the month. I have been extremely busy at work, and I do apologize for the delay.

@secynic secynic added this to the 0.9.0 milestone Jul 24, 2014
@secynic
Copy link
Owner

secynic commented Jul 28, 2014

Added in 0.9.0

@secynic secynic closed this Jul 28, 2014
@netantho
Copy link

Thanks! :)

@secynic
Copy link
Owner

secynic commented Nov 8, 2017

@timofonic Yes, this was fixed in v0.9.0. Are you still having an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants