Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support passing arguments to poetry add #2

Open
jannikmi opened this issue Jan 11, 2024 · 4 comments
Open

support passing arguments to poetry add #2

jannikmi opened this issue Jan 11, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@jannikmi
Copy link

it would be nice to be able to pass command line arguments to poetry add (https://python-poetry.org/docs/cli/#options-4), e.g. --lock

something like:

usage: poetry-add-requirements.txt [-h] [-D] [-I] [-V] [--args additional args] [requirements.txt files ...]

@tddschn
Copy link
Owner

tddschn commented Jan 11, 2024

Thanks for the suggestion!

I updated the code and package on PyPI - could you try the updated version?

@tddschn tddschn self-assigned this Jan 11, 2024
@tddschn tddschn added the enhancement New feature or request label Jan 11, 2024
@jannikmi
Copy link
Author

Thank you for the fast response.

The documentation states:

positional arguments:
  poetry_args           Poetry args, pass them after -- at the end of the command

running poeareq requirements.txt -- --lock does not work: "FileNotFoundError: [Errno 2] No such file or directory: '--lock'"

running poeareq requirements.txt --lock works, but still seems to install the dependencies (--lock is being ingnored)

@tddschn
Copy link
Owner

tddschn commented Jan 12, 2024

Thanks for the feedback! I made some change and tested the new -p, --poetry-args option, and it should be working now for v1.3.0.

No -- required for this version, please see the Usage examples and tips section in the readme.

@jannikmi
Copy link
Author

Thanks.

poeareq --ignore-errors existing.requirements.txt --poetry-args --lock works with version 1.4.0.

The documentation however suggests using poeareq --ignore-errors --poetry-args --lock existing.requirements.txt

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

options:
...
  -p ..., --poetry-args ...
                        Additional arguments to pass to Poetry, put this at
                        the END of the command (default: None)

I guess, this description could be improved to avoid ambiguities.

Additionally, the link to the test-extra-args.sh on PyPI is broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants