Commit bc0a3144 by Sébastien Eustace

Fix --optional option in add command

parent a2f9aec5
......@@ -10,6 +10,7 @@
- Fixed Python version retrieval inside virtualenvs.
- Fixed optional dependencies being set as required in sdist.
- Fixed `--optional` option in the `add` command not being used.
## [0.6.3] - 2018-03-20
......
......@@ -53,6 +53,12 @@ If you do not specify a version constraint, poetry will choose a suitable one ba
parser.parse_constraints(constraint)
for name, constraint in requirements.items():
if self.option('optional'):
constraint = {
'version': constraint,
'optional': True
}
poetry_content[section][name] = constraint
# Write new content
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment