[Distutils] workflow recommendations to update requirements.txt

Glyph Lefkowitz glyph at twistedmatrix.com
Wed Dec 16 01:40:02 EST 2015

> On Dec 15, 2015, at 8:56 PM, 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.

This is what I'm doing right now (occasionally manually curating the output of `pip freeze´) but I have heard good things about https://github.com/nvie/pip-tools/ <https://github.com/nvie/pip-tools/> and I intend to investigate it.  As I understand it, pip-compile is the tool you want.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20151215/c15adec2/attachment.html>

More information about the Distutils-SIG mailing list