Skip to main content

Install python modules from pypi from a previous date in history

Project description

pip-rewind

pip-rewind is a command-line tool that can rewind pypi module versions (given as command-line arguments or read from a requirements.txt file) to a previous date in time.

This tool doesn't install any packages itself - rather, it generates output with modules constrained to specific versions, which can then be fed into pip install.

Usage

$ pip-rewind --date "09/01/2020" requests > new-requirements.txt
$ pip install -r new-requirements.txt

Or give it a requirements file:

$ pip-rewind --date "07/01/2019" -r requirements.txt > new-requirements.txt
$ pip install -r new-requirements.txt

You can also pipe the output directly to pip if preferred:

$ pip-rewind --date "12/01/2020 -r requirements.txt | pip install -r /dev/stdin

Currently, this package only parses a simple subset of valid requirements lines:

modulename
modulename<=5.0.0
modulename==4.0.0

Any line that describes a pypi dependency named modulename, possibly with a version identifier after, is valid - this tool simply cares about modulename since the version will be rewound anyway. Other lines (such as git dependencies) are ignored.

Motivation

Starting to work on old projects that don't have all their dependencies listed and version-constrained can be difficult (especially when some of those dependencies interact with specific versions of OS packages). The simple existence of a line specifying redis in a requirements.txt file without its version can lead to possible breakage when dealing with month- or year-old software.

LICENSE

MIT

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

pip-rewind-0.1.1.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

pip_rewind-0.1.1-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

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