djangorecipe does not fulfill 'django' dependency on eggs

Bug #397864 reported by Daniel Bruce
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Django Recipe
Fix Released
Undecided
Jeroen Vloothuis

Bug Description

I am creating a buildout that uses django via djangorecipe, but also some other eggs that require 'django>=1.0'.

When the eggs begin to install, the django install fetched by djangorecipe does not satisfy that dependency, so buildout will download the newest version of django from PyPI, overriding what's fetched by djangorecipe.

It seems the problem can be fixed by installing the checkout as a develop-egg, and I have attached a quick, hacky patch I did that seemed to fix my issue. I'm not really very familiar with buildout recipes, so I might be flying in the face of some really basic guidelines here, but it did at least let my django project build and run.

Revision history for this message
Daniel Bruce (ircubic) wrote :
Revision history for this message
Jeroen Vloothuis (jvloothuis) wrote :

Thanks for reporting this issue with patch. It seems like a valid way to handle your problem.

It would be nice if there was a test to verify this behavior. Would you be willing to take a stab at this?

Changed in djangorecipe:
assignee: nobody → Jeroen Vloothuis (jvloothuis)
Revision history for this message
Daniel Bruce (ircubic) wrote :

I tried, but was unable to run the tests. mock was complaining about being unable to patch things, think you might have written them for an older version, so I didn't want to rip them up too much. I think you're better suited to writing the actual tests, since you know the code better.

What I did try to write, though, was a test that ran self.recipe.install(), then checked this:

    options = develop_install.call_args[0][2]
    self.assertEqual(options['setup'], os.path.join(self.parts_dir, 'django'))

where develop_install is a mock of zc.recipe.egg.Develop.install

Revision history for this message
Dan Fairs (danfairs) wrote :

I'm going to take a quick look at this, though I should add that I get the same problem as Daniel Bruce when running the tests with both Mock 0.5.0 and Mock 0.6.0:

(djangorecipe)leafhopper:djangorecipe dan$ bin/test
Test-module import failures:

Module: djangorecipe.tests

Traceback (most recent call last):
  File "/Users/dan/.eggs/djangorecipe-0.19.2-py2.6.egg/djangorecipe/tests.py", line 24, in <module>
    class TestRecipe(unittest.TestCase):
  File "/Users/dan/.eggs/djangorecipe-0.19.2-py2.6.egg/djangorecipe/tests.py", line 110, in TestRecipe
    @mock.patch('subprocess', 'Popen')
  File "build/bdist.macosx-10.6-universal/egg/mock.py", line 260, in patch
    raise TypeError("Need a valid target to patch. You supplied: %r" % (target,))
TypeError: Need a valid target to patch. You supplied: 'subprocess'

Revision history for this message
Dan Fairs (danfairs) wrote :

My bad - the version of mock required is much older, 0.3.1. Sorry for the noise.

Revision history for this message
Dan Fairs (danfairs) wrote :

This patch is the same change to the recipe code, but updates the tests both to test the new behaviour, and to fix up existing tests.

Revision history for this message
Daniel Bruce (ircubic) wrote :

Oh wow, great effort, much thanks.

At the time I filed this bug I had no free time at work to actually fix the tests, or I'd have done it myself, I just had to make do with a locally patched copy of the recipe. I've recently picked up Django again, and it's nice to see things are being done to address this. :)

Changed in djangorecipe:
status: New → Fix Committed
Revision history for this message
Reinout van Rees (reinout) wrote :

I'd like a release with this functionality included. Is it planned?

Revision history for this message
roland (roland-micite) wrote :

This was released in version 0.20.

Changed in djangorecipe:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.