Skip to main content

update-req-spec

Build Status License: MIT Code style: black

Update Python requirements in a setup.py file to permit latest available versions.

Motivation

You wish to cap the versions of the dependencies in your library to the major versions that are currently released since you have tested your library against these versions and, given everyone follows semantic versioning, minor updates should remain compatible. But keeping these version ranges up to date with new major releases can be tedious.

update-req-spec makes this a little easier by updating the install_requirements in your setup.py so that the version specifications allow the latest major releases while retaining the minimum permitted versions. Then all you need to do is run your tests and publish a new release.

For example, given:

from setuptools import setup

setup(
    # --- snip ---
    install_requires=[
        "requests",
        "Click>=6.1",
        "attrs~=18.1",
    ],
    # --- snip ---
)

will be transformed to:

from setuptools import setup

setup(
    # --- snip ---
    install_requires=[
        "requests<3",
        "Click>=6.1,<8",
        "attrs>=18.1,<19",
    ],
    # --- snip ---
)

Installation

Install with pipsi:

pipsi install update-req-sepc

or with pip:

python3 -m pip install update-req-spec

Usage

update-req-spec setup.py

If you use a private packge repository:

update-req-spec --index-url http://private-repo.example/ setup.py

# or

export PIP_INDEX_URL=http://private-repo.example/
update-req-spec setup.py

Metadata

Release files for update-req-spec 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for update-req-spec 1.0.2
File Size Uploaded
update-req-spec-1.0.2.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for update-req-spec 1.0.2
File Interpreter ABI Platform
update_req_spec-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / update-req-spec-1.0.2.tar.gz

Download URL update-req-spec-1.0.2.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
55a9dd66b8434af568a40c30d7a06a5dc6f3a8e401812ab70a8c630246fdf2a4
BLAKE2b-256 checksum
How to use checksums
cfcfe6efab9f7226a47751dddbc81d3ba1bb3c8ab468271c36cd849b9003d320
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0

Release files / update_req_spec-1.0.2-py3-none-any.whl

Download URL update_req_spec-1.0.2-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
170100ff6f38cdea44843379d212fa23245393e0d5dd07b65611c8598b8cb91d
BLAKE2b-256 checksum
How to use checksums
8e905a2be03da39c8b64f65d89a622ff2a12d37692c47bbd97b756f025fc6c6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page