[TIP] merging requirements.txt with specified deps

Robert Collins robertc at robertcollins.net
Tue Jun 16 05:04:43 PDT 2015


On 16 June 2015 at 23:19, Antony Seedhouse <antony.seedhouse at gmail.com> wrote:
> Is there a way to "merge" tox deps with requirements.txt, without having to
> split requirements.txt into multiple files (one per dep specified in
> tox.ini) or other more complicated methods?
>
> For example, I have a project with all current dependencies in
> requirements.txt, and would like to test it with multiple versions of django

Why do you have your dependencies in requirements.txt?
requirements.txt should be a freeze of the exact deployment
configuration....

> I would like my deps = to look like:
>
> deps =
>   -r../requirements.txt
>   django17: Django>=1.7,<1.8
>   django18: Django>=1.8,<1.9
>
> This would tell tox to overwrite the Django version in requirements.txt with
> the environment specified version
>
> Currently this errors: Double requirement given: Django==1.7.7 (from -r
> ../requirements.txt (line 3)) (already in Django<1.8,>=1.7, name='Django')

Yes, this is expected. I would have your dependencies be in your
setup.py, and use the tox syntax to select specific versions for
testing as you are trying to here.

-Rob


-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud



More information about the testing-in-python mailing list