Commit 6f7da285 by Sébastien Eustace

Fix add command for package with dots

parent aef45e20
import re import re
import toml
from typing import List from typing import List
from typing import Tuple from typing import Tuple
...@@ -64,6 +66,9 @@ If you do not specify a version constraint, poetry will choose a suitable one ba ...@@ -64,6 +66,9 @@ If you do not specify a version constraint, poetry will choose a suitable one ba
if index is not None: if index is not None:
for i, require in enumerate(requirements.items()): for i, require in enumerate(requirements.items()):
name, version = require name, version = require
if '.' in name:
name = f'"{name}"'
content.insert( content.insert(
index + i, index + i,
f'{name} = "{version}"' f'{name} = "{version}"'
......
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