• Stars
    star
    614
  • Rank 73,061 (Top 2 %)
  • Language
    Python
  • License
    Other
  • Created over 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Update the packages in a requirements.txt file.
Tests Coverage Version Supported Python Versions

pip-update-requirements

Update the packages in a requirements.txt file.

Purring Cat

Installation

pip install pur

Usage

Give pur your requirements.txt file and it updates all your packages to the latest versions.

For example, given a requirements.txt file:

flask==0.9
sqlalchemy==0.9.10
alembic==0.8.4

Running pur on that file updates the packages to current latest versions:

$ pur -r requirements.txt
Updated flask: 0.9 -> 1.0.2
Updated sqlalchemy: 0.9.10 -> 1.2.8
Updated alembic: 0.8.4 -> 0.9.9
All requirements up-to-date.

Pur never modifies your environment or installed packages, it only modifies your requirements.txt file.

You can also use Pur directly from Python:

$ python
Python 3.6.1
>>> from pur import update_requirements
>>> print([x[0]['message'] for x in update_requirements(input_file='requirements.txt').values()])
['Updated flask: 0.9 -> 1.0.2', 'Updated sqlalchemy: 0.9.10 -> 1.2.8', 'Updated alembic: 0.8.4 -> 0.9.9']
>>> print(open('requirements.txt').read())
flask==1.0.2
sqlalchemy==1.2.8
alembic==0.9.9

Options

-r, --requirement PATH
 The requirements.txt file to update; Defaults to using requirements.txt from the current directory if it exist.
-o, --output PATH
 Output updated packages to this file; Defaults to overwriting the input requirements.txt file.
--interactive Interactively prompts before updating each package.
-f, --force Force updating packages even when a package has no version specified in the input requirements.txt file.
-d, --dry-run Output changes to STDOUT instead of overwriting the requirements.txt file.
--dry-run-changed
 When running with --dry-run, only output packages with updates, not packages that are already the latest.
-n, --no-recursive
 Prevents updating nested requirements files.
--skip TEXT Comma separated list of packages to skip updating.
--skip-gt Skip updating packages using > or >= spec, to allow specifying minimum supported versions of packages.
--index-url TEXT
 Base URL of the Python Package Index. Can be provided multiple times for extra index urls.
--cert PATH Path to PEM-encoded CA certificate bundle. If provided, overrides the default.
--no-ssl-verify
 Disable verifying the server's TLS certificate.
--only TEXT Comma separated list of packages. Only these packages will be updated.
--minor TEXT Comma separated list of packages to only update minor versions, never major. Use "*" to limit every package to minor version updates.
--patch TEXT Comma separated list of packages to only update patch versions, never major or minor. Use "*" to limit every package to patch version updates.
--pre TEXT Comma separated list of packages to allow updating to pre-release versions. Use "*" to allow all packages to be updated to pre-release versions. By default packages are only updated to stable versions.
-z, --nonzero-exit-code
 Exit with status 1 when some packages were updated, 0 when no packages updated, or a number greater than 1 when there was an error. By default, exit status 0 is used unless there was an error irregardless of whether packages were or not updated.
--version Show the version and exit.
--help Show this message and exit.

Contributing

Before contributing a pull request, make sure tests pass:

virtualenv venv
. venv/bin/activate
pip install tox
tox

Many thanks to all contributors!

More Repositories

1

readtime

Calculates the time some text takes the average human to read, based on Medium's read time forumula.
Python
124
star
2

flask-static-compress

Auto-detects your static files for minification, combination, and versioning. Like Django-Compressor for Flask.
Python
41
star
3

dotfiles

install my Vim config by pasting some Terminal commands
Vim Script
29
star
4

eufy-garage-door-watcher

Send yourself an email whenever the garage door is left open, using a Eufy Security door sensor.
Python
17
star
5

CLMapper

Craigslist posts shown on a map while viewing Craigslist housing.
JavaScript
16
star
6

jQuery-Picasa-Gallery

jQuery plugin widget that displays your public picasa web albums.
JavaScript
15
star
7

alanhamlett

public profile readme
13
star
8

AwayMail-Irssi-Plugin

send an email notification when someone says your name or sends you a pm on an IRC server
Perl
12
star
9

eufy-security-dashboard

Eufy Security iOS app for displaying camera and door sensors on a dashboard, with auto-refresh.
Swift
11
star
10

BeeLine

Chrome extension that makes reading easier by color-coding lines on the page
JavaScript
3
star
11

purpleair-notify

Watch this repo to receive an email whenever PurpleAir sensor(s) go over an air quality PM2.5 threshold.
TypeScript
2
star
12

alanhamlett.github.com

my personal website
Rich Text Format
2
star
13

codepath-ios-ex1

Assignment 1
Swift
1
star
14

hackathonranks

JavaScript
1
star
15

wonderful

1
star
16

github-issue-polls

Easily add a poll/survey and collect votes from GitHub issues
Python
1
star
17

gedit-hilight

gedit plugin to highlight all occurances of selected text
Python
1
star