Skip to content

Commit eb15b3d

Browse files
authored
Merge pull request #216 from davidbrochart/improve_multipy
Improve Python multi-package handling
2 parents 07860a7 + 0e05001 commit eb15b3d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

jupyter_releaser/lib.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import requests
1414
from ghapi.core import GhApi
1515
from pkg_resources import parse_version
16+
from pkginfo import SDist
17+
from pkginfo import Wheel
1618

1719
from jupyter_releaser import changelog
1820
from jupyter_releaser import npm
@@ -420,9 +422,12 @@ def publish_assets(
420422
name = Path(path).name
421423
suffix = Path(path).suffix
422424
if suffix in [".gz", ".whl"]:
423-
if name.startswith(
424-
python_package_name
425-
): # FIXME: not enough to know it's the right package
425+
if suffix == ".gz":
426+
dist = SDist
427+
else:
428+
dist = Wheel
429+
pkg = dist(path)
430+
if not python_package_name or python_package_name == pkg.name:
426431
env = os.environ.copy()
427432
env["TWINE_PASSWORD"] = twine_token
428433
# NOTE: Do not print the env since a twine token extracted from

0 commit comments

Comments
 (0)