Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Initialize a Python Poetry project without human interaction

I'd love to initialize a poetry-generated project without going through the interactive shell for versions and dependencies etc.

However, a few attempts of fiddling around with the command line options all failed.

Such as

poetry init --name my_proj --description  "my proj" --author john.doe --python 3.9 --dependency "pytest:^6.2.0" --dev-dependency coverage -l MIT

gives me the interactive shell to confirm all the info I provided.

Expectation

I expect that by giving all the dependencies, the command should generate a pyproject.toml automatically without me entering anything.

Where am I wrong?

like image 851
kakyo Avatar asked Jun 15 '26 23:06

kakyo


1 Answers

As stated in the docs, just add -n or --no-interaction to your command and you will get what you are asking for.

like image 116
finswimmer Avatar answered Jun 18 '26 12:06

finswimmer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!