Feature Suggestion: Environmental awareness #785

Closed
jvc26 opened this Issue Jan 31, 2013 · 3 comments

Comments

Projects
None yet
4 participants
@jvc26

jvc26 commented Jan 31, 2013

So, what I'm proposing is the addition of environmental awareness to requirements.txt files. At present, you can add recursive requirements with the -r flag. This is great for abstracting out sets of requirements, but a bigger feature would be to influence the inclusion of these based on the environment.

For example, a project with two sets of requirements, the basic requirements for the function of the application, and a subsequent set for the testing of the project (for example PEP8, WebTest and so forth).

requirements.txt:
    django==1.4.3

test-requirements.txt:
    WebTest==1.4.3
    pep8==1.4.1

There are times we want to recursively include test-requirements.txt (i.e. when we're doing our testing/on our continuous integration server), however, in deployment they are completely superfluous.

Making pip (and requirements files) environmentally aware would enable a 12 factor style facility to install requirements recursively dependent on environment. When, for example the environment variable DEBUG is set, pip could include the testing-related requirements. When it is not, it won't.

Thoughts?

@graingert

This comment has been minimized.

Show comment
Hide comment
@graingert

graingert Feb 1, 2013

Contributor

you could use the setup key tests_require from setuptools

Contributor

graingert commented Feb 1, 2013

you could use the setup key tests_require from setuptools

@dstufft

This comment has been minimized.

Show comment
Hide comment
@dstufft

dstufft Mar 24, 2017

Member

We're not going to add this to the current requirements.txt format, any feature along this line would have to be a part of #1795.

Member

dstufft commented Mar 24, 2017

We're not going to add this to the current requirements.txt format, any feature along this line would have to be a part of #1795.

@dstufft dstufft closed this Mar 24, 2017

@graingert

This comment has been minimized.

Show comment
Hide comment
@graingert

graingert Mar 24, 2017

Contributor

@jvc26 it's already a feature in pipfile:

Existing requirements files tend to proliferate into multiple files - e.g. dev-requirements.txt, test-requirements.txt, etc. - but a Pipfile will allow seamlessly specifying groups of dependencies in one place.

Contributor

graingert commented Mar 24, 2017

@jvc26 it's already a feature in pipfile:

Existing requirements files tend to proliferate into multiple files - e.g. dev-requirements.txt, test-requirements.txt, etc. - but a Pipfile will allow seamlessly specifying groups of dependencies in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment