[Distutils] workflow recommendations to update requirements.txt

Robert Collins robertc at robertcollins.net
Wed Dec 16 00:43:32 EST 2015

You might find https://github.com/openstack/requirements/blob/master/openstack_requirements/cmds/generate.py

Basically it takes a open-ended (or partly so) set of requirements,
expressed as in requirements.txt format, and generates an exact-match
requirements.txt file as output.

So, have one file, say 'dependencies.txt', which is open ended, and
your requirements.txt which is exact, then run generate from time to
time. There are other such tools around, but I forget their names ;)


On 16 December 2015 at 17:56, Chris Jerdonek <chris.jerdonek at gmail.com> wrote:
> Hi,
> I have a development workflow question I was wondering if people on
> this list had a recommended solution for.
> Say you're working on a web application that you deploy using a
> requirements.txt file.  And say you have a set of "abstract
> dependencies" that your application depends on.
> What are some convenient ways of storing your abstract dependencies in
> source control and periodically generating an updated requirements
> file from that information (e.g. when your dependencies come out with
> new versions)?
> The main idea that occurs to me is making a setup.py for the purposes
> of representing your abstract dependencies (e.g. using
> "install_requires," etc), creating a new virtualenv, running "pip
> install .", and then "pip freeze."
> One problem with this approach is that the pip freeze output includes
> an entry for the setup.py application itself, when the output should
> only include the _dependencies_ of the application and not the
> application itself.  It also seems clunky to me to create a virtualenv
> and install dependencies only for the purposes of computing
> dependencies.
> Thanks for any help or suggestions.
> --Chris
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig

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

More information about the Distutils-SIG mailing list