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

Can't install if Django isn't already installed #14

Closed
LegoStormtroopr opened this issue Feb 27, 2017 · 10 comments
Closed

Can't install if Django isn't already installed #14

LegoStormtroopr opened this issue Feb 27, 2017 · 10 comments

Comments

@LegoStormtroopr
Copy link

If you try to install django-slowtests before django is installed, it fails. This makes it difficult to include in a tox script when django and django-slowtests are installed concurrently.

image

@mjhea0
Copy link
Contributor

mjhea0 commented Feb 28, 2017

@LegoStormtroopr what would you like to see changed? Want to issue a PR?

@LegoStormtroopr
Copy link
Author

Part of the problem is in setup.py, where setup imports django_slowtests:

version=__import__("django_slowtests").__version__,

which itself imports django on line 1:

from django.core.exceptions import ImproperlyConfigured

Thus, on setup it fails if Django isn't already installed.

I'm not sure how you'd want to fix this, but the choices I can see are either:

  • just declare the version in setup (probably not great)
  • Broaden the exception testing to catch everything (also not great)
  • Just import DiscoverSlowestTestsRunner without trying to catch anything (why are you catching anyway)
  • Or a fourth something else I can't think of

@mjhea0
Copy link
Contributor

mjhea0 commented Feb 28, 2017

Looks like this is a bigger issue with Tox in general -> tox-dev/tox#42.

@LegoStormtroopr
Copy link
Author

I disagree with that assessment. The screen shot shows I can replicate this using just plain pip without tox.

I can't see a reason for setup.py to depend so heavily on django already being installed to be able run.

I've offered a couple of ways to resolve this. Either way, this is a cool library and I'd love to be able to use it more, but this issue is a blocker for me.

@mjhea0
Copy link
Contributor

mjhea0 commented Mar 4, 2017

@LegoStormtroopr thoughts on using install_requires?

install_requires=['django>=1.5']

@inglesp
Copy link

inglesp commented Mar 16, 2017

Instead of importing django_slowtests , can you get around this by reading django_slowtests.__init__.py and searching for a line containing __version__?

@obestwalter
Copy link

Looks like this is a bigger issue with Tox in general -> tox-dev/tox#42.

It is arguable if this is a Tox issue, as deps is just calling pip with all the deps and from pips viewpoint it's not a bug, but an implementation detail.

There is a pretty painless workaround though for things like this (unless I am missing something), which is now mentioned in the tox issue and which hopefully finds its way into the docs at some point.

@obestwalter
Copy link

obestwalter commented Mar 17, 2017

I just saw that @LegoStormtroopr said the same thing ... sorry.

@mjhea0
Copy link
Contributor

mjhea0 commented Mar 19, 2017

Fixed! Thanks @inglesp! Just hard coded the version to the setup.py file.

@mjhea0 mjhea0 closed this as completed Mar 19, 2017
@LegoStormtroopr
Copy link
Author

Thanks! :)

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

No branches or pull requests

4 participants