Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Set django-compressor==1.2a2 instead of '==dev' #11

Closed
wants to merge 1 commit into from

Conversation

dicato
Copy link

@dicato dicato commented Jul 6, 2012

See issue #10.

I don't believe this was a local problem. Maybe pip can't find dev?

@rdegges
Copy link
Owner

rdegges commented Jul 13, 2012

Hey, sorry it took me so long to reply to this. I've actually been doing a lot of research to figure out why this is happening.

Turns out, this is a known bug in pip! See this issue: pypa/pip#436 @kennethreitz already wrote a patch for it, but it hasn't been accepted yet.

Here's what it means:

  • I have to keep django-compressor==dev in reqs/common.txt, otherwise Heroku won't be able to install django-compressor when we our project to production.
  • When you're setting up django-skel locally, you have to manually edit the reqs/common.txt file and set django-compressor==1.2a2 before you run pip install -r reqs/dev.txt.

That's a huge pain in the ass, but it's the only way to make things work in production (which I think is super important).

I'm no going to accept this pull request for that reason, but I will see what i can do about getting the pip patch accepted (I'll try to write some tests for it if I can figure out the pip codebase).

@dicato
Copy link
Author

dicato commented Jul 14, 2012

Great explanation, no worries about taking some time to respond.
I agree with your decision, thanks for taking the time to think about it.

I should be following pip, but don't.

@tonyxiao
Copy link

Hmm, changing reqs/common.txt to use django-compressor=1.2a2 doesn't solve the problem by itself actually. If you were to do that you'd get the following error output.

Downloading/unpacking django-compressor==1.2a2 (from -r reqs/common.txt (line 3))
  Could not find a version that satisfies the requirement django-compressor==1.2a2 (from -r reqs/common.txt (line 3)) (from versions: )

In addition to changing req/common.txt, I had to run the following two commands in sequence to solve the problem

pip install django-compressor==dev
pip install reqs/dev.txt

This way pip will notice that the django-compressor dependency is already satisfied and therefore won't complain. Until pip gets fixed, this seems to be the way around. If this workaround can be confirmed, it should be added to the project documentation.

@tonyxiao
Copy link

the key here is that if you run pip install django-compressor==dev directly it works, running it from a requirements.txt file is when it fails

@dicato
Copy link
Author

dicato commented Jul 15, 2012

It appears that on the first attempt, the install fails but it actually downloads the package. The second attempt finds the package locally and can install it. This is what happened to my co-worker on Windows at least. I can't easily recreate at the moment.

@tonyxiao
Copy link

Perhaps we can have django-compressor==dev' in the prod.txt anddjango-compressor==1.2a2' in the dev.txt? Seems rather tacky but is an option.

@kennethreitz
Copy link
Collaborator

==dev should, in general, be avoided.

@tonyxiao
Copy link

Hmm, that may be the best solution. I do wonder though, how come heroku installs ==dev correctly using pip v1.1 whereas on local dev machine it fails?

@kennethreitz
Copy link
Collaborator

@tonyxiao it's a bug in pip. I wrote a fix and patched it for heroku, but the patch is awaiting upstream approval because it doesn't have any tests written. I need to get on that.

You can see the pull request here: pypa/pip#436

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

Successfully merging this pull request may close these issues.

None yet

4 participants