[TIP] merging requirements.txt with specified deps

Antony Seedhouse antony.seedhouse at gmail.com
Tue Jun 16 05:27:05 PDT 2015


I have not seen the benefit of using (or being forced to use) setup.py for
this or many projects: as you said, requirements.txt contains the freeze of
the deployment configuration, which as a deployed application not a library
is all that is needed?

If tox supports "merging" dependencies from setup.py & depends, and tox has
added support for requirements.txt, then it would make sense for them to be
some way to use both ways?

I simply want to use tox to be able to easily test the project against
multiple versions of dependencies, and avoid having to keep multiple places
up to date, or having to create n number of files where n is the number of
dependencies that can change :)


Best regards,
Antony

On 16 June 2015 at 14:04, Robert Collins <robertc at robertcollins.net> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20150616/a0d52a8f/attachment.htm>


More information about the testing-in-python mailing list