Skip to content

Commit 41f7b7c

Browse files
committed
new (utils.setup_reader): try to parse version found in setup.cfg
1 parent 3ec2e98 commit 41f7b7c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: poetry/utils/setup_reader.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
from typing import Tuple
99
from typing import Union
1010

11+
from poetry.core.semver import Version
12+
1113
from ._compat import PY35
1214
from ._compat import Path
1315
from ._compat import basestring
@@ -85,9 +87,10 @@ def read_setup_py(
8587
if not setup_call:
8688
return self.DEFAULT
8789

88-
# Inspecting keyword arguments
8990
result["name"] = self._find_single_string(setup_call, body, "name")
90-
result["version"] = self._find_single_string(setup_call, body, "version")
91+
result["version"] = Version.parse(
92+
self._find_single_string(setup_call, body, "version")
93+
).text
9194
result["install_requires"] = self._find_install_requires(setup_call, body)
9295
result["extras_require"] = self._find_extras_require(setup_call, body)
9396
result["python_requires"] = self._find_single_string(

0 commit comments

Comments
 (0)