Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python poetry adding dependency to a group

I am using Poetry of version 1.3.2 (currently the last version), and added group to .toml file as below: [tool.poetry.group.dev.dependencies].

And following official documentation tried to add library to this group using command:
poetry add pytest --group dev.

But always getting error that says: The "--group" option does not exist.

(Using python of version 3.9.15)

I tried to change version of poetry to 1.2.x, but it did not help.

like image 836
Carmy John Avatar asked Apr 20 '26 00:04

Carmy John


1 Answers

Just type:

poetry add --group dev 'package_name'

That should work

like image 132
Sedat E. Avatar answered Apr 21 '26 14:04

Sedat E.



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!