Skip to content

Commit 8433314

Browse files
authored
Derive package name from setuptools fullname (#3)
The value given by --name is the verbatim package name, while the --fullname yields the normalized package name used by setuptools followed by the version. We can trim off the version part to get the normalized name so that the proper package name is used when looking for the archives produced by the wheel build process.
1 parent fa5fa95 commit 8433314

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

publish_python/package.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ def get_package_name_and_version():
1414
raise RuntimeError(
1515
"Must be invoked in a directory containing a 'setup.py' file")
1616
output = subprocess.check_output(
17-
[sys.executable, 'setup.py', '--name', '--version'])
17+
[sys.executable, 'setup.py', '--fullname', '--version'])
1818
lines = output.decode('ascii').splitlines()
1919
assert len(lines) == 2
2020
Package = namedtuple('Package', ['name', 'version'])
21-
return Package(lines[0], lines[1])
21+
fullname = lines[0]
22+
version = lines[1]
23+
name = fullname[:-len(version) - 1]
24+
return Package(name, version)

0 commit comments

Comments
 (0)