Skip to main content

Upgrade only direct dependencies in requirements.txt or pyproject.toml

Project description

upgrade-py-direct-reqs

Upgrade only direct dependencies listed in requirements.txt safely.

A Python CLI tool that lets you review and upgrade only direct dependencies in a project’s requirements.txt (or pyproject.toml in future versions), while keeping your pinned versions up to date.

Developed by Miteshkumar N Raval with guidance and scripting assistance from OpenAI ChatGPT.


Features

  • Lists outdated direct dependencies.
  • Prompts for confirmation before upgrading.
  • Updates requirements.txt with new pinned versions.
  • Cross-platform: works on Linux, macOS, and Windows.
  • CLI installable via pipx.

Installation

# Recommended: install globally using pipx
pipx install upgrade-py-direct-reqs

Or via pip in a venv:

pip install upgrade-py-direct-reqs

Usage

# Explicitly specify your requirements file
upgrade-py-direct-reqs path/to/requirements.txt
  • The CLI will list outdated direct dependencies.
  • You can review versions and confirm before upgrading.
  • After upgrade, the requirements.txt file is updated with pinned versions.

Example

Before

requirements.txt:

requests==2.30.0
flask==2.2.5

Command

upgrade-py-direct-reqs requirements.txt

Output (sample)

📦 Outdated direct dependencies:

  requests: 2.30.0 → 2.32.3
  flask: 2.2.5 → 3.0.3

⚠️  Please review package revisions listed above before upgrading.
   Check release notes on pypi.org for BREAKING changes or necessary code updates.

Proceed with upgrade? (y/n): y
⬆️  Upgrading 2 packages...
✅ Requirements updated: requirements.txt

After

requirements.txt:

requests==2.32.3
flask==3.0.3

License

This project is licensed under the MIT License — see the LICENSE file for details.

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

upgrade_py_direct_reqs-0.1.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

upgrade_py_direct_reqs-0.1.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file upgrade_py_direct_reqs-0.1.2.tar.gz.

File metadata

  • Download URL: upgrade_py_direct_reqs-0.1.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for upgrade_py_direct_reqs-0.1.2.tar.gz
Algorithm Hash digest
SHA256 76e6d2d66378ad0c645789d2c5534dfb44da2fc24fb4834dbaffe87b76e0928d
MD5 3a71035940fc5c98977e11b95d75da66
BLAKE2b-256 bc616d42b7df0c7e1e67d42c32bb043f4731115f9b130c3319b3b6d9dcaa14c4

See more details on using hashes here.

File details

Details for the file upgrade_py_direct_reqs-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for upgrade_py_direct_reqs-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c17c16c634f233a651f161e96e850846a8ced93170c85c48acf5bc4c8606ea1
MD5 28281f2871de5f33a0f0361d593e7c18
BLAKE2b-256 4ffcd5c9c45a8528479bcc9fa43f7a3442150e7caf30de9f6e7e31371ed1eff0

See more details on using hashes here.

Supported by

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