Skip to main content

A script to help creating and maintaining frozen requirements for pip

Project description

freeze-requirements

A script to help creating and maintaining frozen requirements for pip, inspired by this Mozilla dev team blog post.

Frozen requirements contain the packages you specified, plus all their dependencies, with pinned versions.

For example if you have requirements.txt containing this:

pyramid
sqlalchemy

The frozen version would be:

# This file has been automatically generated, DO NOT EDIT!

# Frozen requirements for "requirements.txt"

pastedeploy==1.5.2
pyramid==1.5.1
repoze.lru==0.6
setuptools==5.5.1
sqlalchemy==0.9.7
translationstring==1.1
venusian==1.0
webob==1.4
zope.deprecation==4.1.1
zope.interface==4.1.1

Then you can use the frozen requirements in your deployment scripts with pip install -r requirements-frozen.txt --no-deps, and enjoy consistent deployments even if some packages are updated on pypi.

freeze-requirements can also put the downloaded source packages in a pypi-like directory structure on your web server, so you can speed up your deployments with pip install -r requirements-frozen.txt --index-url http://mywebserver.com/pypi-mirror, and also build wheels to speed up deployments even more.

Installation

Install from pypi:

$ pip install freeze-requirements

Or from source:

$ ./setup.py install

Examples

Create a frozen versions of two requirements files (they will be named requirements-frozen.txt and requirements2-frozen.txt in this example, the -frozen suffix can be customized with --separate-requirements-suffix):

$ freeze-requirements freeze --separate-requirements requirements.txt requirements2.txt

Merge multiple requirements in a single file:

$ freeze-requirements freeze --merged-requirements requirements-merged.txt requirements.txt requirements2.txt

Use a cache to avoid reprocessing known requirements files:

$ freeze-requirements freeze --cache-dependencies requirements.txt

Put downloaded source packages and build wheels for them in a pypi-like directory structure:

$ freeze-requirements freeze --output-dir /path/to/my/pypi --build-wheels requirements.txt

News

0.4.4

Added workarounds for packages with non-string versions in their setup.py (bugs were caused by unittest2 0.7.1, see https://code.google.com/p/unittest-ext/issues/detail?id=84).

0.4.3

Added automatic conflicts resolution.

0.4.2

Added –no-rebuild-wheels flag, to avoid rebuilding wheels already present in –output-dir.

0.4.1

First proper release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

freeze-requirements-0.4.4.tar.gz (9.9 kB view details)

Uploaded Source

File details

Details for the file freeze-requirements-0.4.4.tar.gz.

File metadata

File hashes

Hashes for freeze-requirements-0.4.4.tar.gz
Algorithm Hash digest
SHA256 6efc3af443c0388a40b68d5c2fefc9263f1475b7aa55ff40b4c96d6c0320f736
MD5 ea487c278606a2e5e56e3e0bca8d1c15
BLAKE2b-256 6e70a539bee6c730058e9828ce0842bdfe68ce53d52252348f75020bfae0172e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page