how do you know which python egg is enforcing a constraint in buildout?
Asked Answered
S

1

7

For instance the following is built with bin/buildout -Nvv

...
Getting required 'grokcore.component>=2.5'
  required by five.grok 1.3.2.
  required by grokcore.viewlet 1.11.
Picked: grokcore.component = 2.5
Getting required 'grokcore.annotation'
  required by five.grok 1.3.2.
Picked: grokcore.annotation = 1.3
The constraint, 0.4, is not consistent with the requirement, 'five.localsitemanager>2.0dev'.
While:
  Installing instance.
Error: Bad constraint 0.4 five.localsitemanager>2.0dev

The constraint five.localsitemanager>2.0dev does not seem to be enforced by grokcore.annotation (see https://github.com/zopefoundation/grokcore.annotation/blob/master/setup.py) But how do I find out which egg is actually enforcing this?

Sushi answered 13/12, 2013 at 5:23 Comment(3)
Is it still relevant? If not, perhaps it's time to close the question...Clipboard
The problem still occurs from time to time, so the question can stay open. The packages change, but the problem remains.Carmellacarmelle
Check my answer to #29827758 (eggdeps)Fireboard
S
6

I know this is a very old question, but I had the same problem yesterday and my colleague found a way to solve the problem. So I thought I might as well post it here.

All your buildout eggs are either in an eggs folder in your project or in a .buildout folder in your home folder, including development eggs. In each egg you'll find a requires.txt file with the requirements for the egg. This means you can do a find/grep on the .buildout/eggs folder for the specific constraint to find out which package is enforcing it.

So in your case I would suggest you go to the eggs directory (in my case ~/.buildout/eggs) and then do:

find .|grep requires.txt|xargs grep 2.0dev

That should find the egg that's enforcing the constraint.

In my case I was upgrading to Django 1.7 and there was one package with the constraint 'Django >= 1.4, < 1.7'. So executing find .|grep requires.txt|xargs grep 1.7 found the problematic egg.

Senarmontite answered 24/4, 2015 at 8:11 Comment(4)
An addition: the ~/.buildout/eggs/ folder is only used if you enable it. Otherwise you have to look in the eggs/ folder inside the project directory.Carmellacarmelle
Second comment: the < 1.7 can be problematic as it can also be written as <1.7 (without spaces) and so. Searching for the package name in the various EGG-INFO/requires.txt files is quicker. Something like find . | grep requires.txt | xargs grep -i the-package-name Carmellacarmelle
Thanks for the additions @reinout-van-rees! I just looked in my .bash_history and that is indeed the command you used on my .buildout/eggs folder. I guess I wasn't paying close enough attention yesterday. I will update my answer.Senarmontite
Thanks. It worked for me ... but I found it into the parts/ directory. So it is better to run the grep command from the project directory root (the parent of eggs/ folder) when the folder ~/.buildout/eggs/ is not used.Knipe

© 2022 - 2024 — McMap. All rights reserved.