poetry-add-requirements.txt & uv-add-requirements.txt
Add dependencies specified in requirements.txt file(s) to your Poetry / UV project
Features
- Auto detect charset of requirements.txt file(s) and feed normalized dependency specs to
poetry/uv. - Stop on first
poetry / uv adderror. - Ignore dependency version requirements specified in requirements.txt file(s).
- Ignore errors when installing individual dependencies.
- Pass arbitrary arguments to
poetry / uv addafter--at the end of the command.
Installation
The package name are 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-argsat the end of the command - Pass
-n,--dry-runto 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
Metadata
Release files for uv-add-requirements.txt 1.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uv_add_requirements_txt-1.5.2.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uv_add_requirements_txt-1.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.0 kB
Release files / uv_add_requirements_txt-1.5.2.tar.gz
| Download URL | uv_add_requirements_txt-1.5.2.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd43502c9bd726acd021d32cc799062bec78a1d631dafad0a63c91c16682098a
|
|
BLAKE2b-256 checksum How to use checksums |
6c9a94d20ce96c421ebd68a2a116fc369703f3f4bf8dab4f3808815111115ed0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.9 Darwin/24.3.0
|
Release files / uv_add_requirements_txt-1.5.2-py3-none-any.whl
| Download URL | uv_add_requirements_txt-1.5.2-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6d88741edc9277dcfa5a5d0cbe567e44af8e284ff15c472dd9ba43f47eb8d9d
|
|
BLAKE2b-256 checksum How to use checksums |
b01bfdb5eb791b777e6e47e9771629ee256d9c5d68b0bc5a35218707878ee909
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.9 Darwin/24.3.0
|