Skip to main content

poetry-add-requirements.txt & uv-add-requirements.txt

Add dependencies specified in requirements.txt file(s) to your Poetry / UV project

Can't remember how to use xargs or awk to do the job? This tool is for you, easy to use and comes with extra features.

Features

  • Auto detect charset of requirements.txt file(s) and feed normalized dependency specs to poetry / uv.
  • Stop on first poetry / uv add error.
  • Ignore dependency version requirements specified in requirements.txt file(s).
  • Ignore errors when installing individual dependencies.
  • Pass arbitrary arguments to poetry / uv add after -- at the end of the command.

Installation

The package name on PyPI is poetry-add-requirements.txt or uv-add-requirements.txt, both are equivalent.

They both provide these 4 commands / executables: poeareq, poetry-add-requirements.txt, uv-add-requirements.txt, uvareq

poeareq is just a shorthand for poetry-add-requirements.txt, and uvareq is just a shorthand for uv-add-requirements.txt.

uv

This is the fastest way to install, or use without permanent installation.

$ uv tool install poetry-add-requirements.txt

pipx

This is the recommended installation method.

$ pipx install poetry-add-requirements.txt

pip

$ pip install poetry-add-requirements.txt

Usage

For poetry

Run poetry-add-requirements.txt, optionally specify your requirements.txt files and --dev for dev dependencies.

poeareq is provided is an alias to poetry-add-requirements.txt.

$ poeareq --help

usage: poetry-add-requirements.txt [-h] [-D] [-I] [-i] [-n] [-p ...] [-V]
                                   [requirements.txt file(s) ...]

Add dependencies specified in requirements.txt to your Poetry project

positional arguments:
  requirements.txt file(s)
                        Path(s) to your requirements.txt file(s) (default:
                        requirements.txt)

options:
  -h, --help            show this help message and exit
  -D, --dev             Add to development dependencies (default: False)
  -I, --ignore-version-requirements
                        Ignore dependency version requirements in
                        requirements.txt file(s) (default: False)
  -i, --ignore-errors   Ignore errors (default: False)
  -n, --dry-run         Dry run, do not add dependencies (default: False)
  -p ..., --poetry-args ...
                        Additional arguments to pass to Poetry, put this at
                        the END of the command (default: None)
  -V, --version         show program's version number and exit

For uv

Same as above, just change the command to uv-add-requirements.txt or uvareq (they are equivalent).

Usage examples and tips

For examples, see test-extra-args.sh.

Tips:

  • Put all req files before any options
  • Put -p, --poetry-args at the end of the command
  • Pass -n, --dry-run to see the poetry commands that would be run

Screenshot

Running uv-add-requirements.txt without extra args:

Develop

$ git clone https://github.com/tddschn/poetry-add-requirements.txt.git
$ cd poetry-add-requirements.txt
$ poetry install

Download files

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

Source Distribution

poetry_add_requirements_txt-1.5.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

poetry_add_requirements_txt-1.5.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file poetry_add_requirements_txt-1.5.4.tar.gz.

File metadata

  • Download URL: poetry_add_requirements_txt-1.5.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.9 Darwin/24.3.0

File hashes

Hashes for poetry_add_requirements_txt-1.5.4.tar.gz
Algorithm Hash digest
SHA256 160a2f9c11b44883abed34fc33c3421c728dc8c7cf93b88a1313876c7f2bf531
MD5 68c448cce6e36ad6b5a91f25d7a4f2b6
BLAKE2b-256 517a17ce052dd24b3af464e2bedf3211b777944e949dc2e23c4c0e191d4e38da

See more details on using hashes here.

File details

Details for the file poetry_add_requirements_txt-1.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_add_requirements_txt-1.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 559a2afa6a659357ce8cdefed1c204aa53f81699dfbe04f6c58987e4b00754a2
MD5 35230cd70c1b88b66931083803910df1
BLAKE2b-256 d4e4dce31a3b4c7608d988513fb3ee76a91f1e54860c5e03ca8d120c1b8cf9a7

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.5.4 This release

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.4

2 files

1.1.3

1 file

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.2

2 files

0.1.1

2 files

Supported by

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