66
77from setupbase import get_version
88
9- def buildBundle ():
9+ VERSION_PY = 'jupyterlab_git/_version.py'
10+
11+ def buildLabextensionBundle ():
1012 subprocess .run (['jlpm' , 'clean:slate' ])
1113 subprocess .run (['jlpm' , 'build:labextension' ])
1214
@@ -22,11 +24,11 @@ def tag(version, dryrun=False, kind=None):
2224 subprocess .run (['git' , 'tag' , tag ])
2325 subprocess .run (['git' , 'push' , 'origin' , tag ])
2426
25- def pypi (bdist = True , test = False ):
27+ def pypi (wheel = True , test = False ):
2628 """release on pypi
2729 """
28- if bdist :
29- # build the source (sdist) and binary wheel (bdist ) releases
30+ if wheel :
31+ # build the source (sdist) and binary wheel (bdist_wheel ) releases
3032 subprocess .run (['python' , 'setup.py' , 'sdist' , 'bdist_wheel' ])
3133 else :
3234 # build just the source release
@@ -39,10 +41,10 @@ def pypi(bdist=True, test=False):
3941 # release to the production server
4042 subprocess .run (['twine' , 'upload' , 'dist/*' ])
4143
42- def npmjs (dryRun = False ):
44+ def npmjs (dryrun = False ):
4345 """release on npmjs
4446 """
45- if dryRun :
47+ if dryrun :
4648 # dry run build and release
4749 subprocess .run (['npm' , 'publish' , '--access' , 'public' , '--dry-run' ])
4850 else :
@@ -68,23 +70,23 @@ def labExtensionVersion(dryrun=False, version=None):
6870
6971def serverExtensionVersion ():
7072 # get single source of truth from the Python serverextension
71- return get_version ('jupyterlab_hdf/_version.py' )
73+ return get_version (VERSION_PY )
7274
7375def doRelease (test = False ):
7476 # do a clean build of the bundle
75- buildBundle ()
77+ buildLabextensionBundle ()
7678
7779 # treat the serverextension version as the "real" single source of truth
7880 version = serverExtensionVersion ()
7981 # force the labextension version to agree with the serverextension version
80- labExtensionVersion (version = version )
82+ labExtensionVersion (dryrun = test , version = version )
8183
8284 # tag with version and push the tag
8385 tag (dryrun = test , version = version )
8486
8587 # release to pypi and npmjs
8688 pypi (test = test )
87- npmjs (dryRun = test )
89+ npmjs (dryrun = test )
8890
8991def main ():
9092 parser = argpar .ArgumentParser ()
0 commit comments