6
6
7
7
from setupbase import get_version
8
8
9
- def buildBundle ():
9
+ VERSION_PY = 'jupyterlab_git/_version.py'
10
+
11
+ def buildLabextensionBundle ():
10
12
subprocess .run (['jlpm' , 'clean:slate' ])
11
13
subprocess .run (['jlpm' , 'build:labextension' ])
12
14
@@ -22,11 +24,11 @@ def tag(version, dryrun=False, kind=None):
22
24
subprocess .run (['git' , 'tag' , tag ])
23
25
subprocess .run (['git' , 'push' , 'origin' , tag ])
24
26
25
- def pypi (bdist = True , test = False ):
27
+ def pypi (wheel = True , test = False ):
26
28
"""release on pypi
27
29
"""
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
30
32
subprocess .run (['python' , 'setup.py' , 'sdist' , 'bdist_wheel' ])
31
33
else :
32
34
# build just the source release
@@ -39,10 +41,10 @@ def pypi(bdist=True, test=False):
39
41
# release to the production server
40
42
subprocess .run (['twine' , 'upload' , 'dist/*' ])
41
43
42
- def npmjs (dryRun = False ):
44
+ def npmjs (dryrun = False ):
43
45
"""release on npmjs
44
46
"""
45
- if dryRun :
47
+ if dryrun :
46
48
# dry run build and release
47
49
subprocess .run (['npm' , 'publish' , '--access' , 'public' , '--dry-run' ])
48
50
else :
@@ -68,23 +70,23 @@ def labExtensionVersion(dryrun=False, version=None):
68
70
69
71
def serverExtensionVersion ():
70
72
# get single source of truth from the Python serverextension
71
- return get_version ('jupyterlab_hdf/_version.py' )
73
+ return get_version (VERSION_PY )
72
74
73
75
def doRelease (test = False ):
74
76
# do a clean build of the bundle
75
- buildBundle ()
77
+ buildLabextensionBundle ()
76
78
77
79
# treat the serverextension version as the "real" single source of truth
78
80
version = serverExtensionVersion ()
79
81
# force the labextension version to agree with the serverextension version
80
- labExtensionVersion (version = version )
82
+ labExtensionVersion (dryrun = test , version = version )
81
83
82
84
# tag with version and push the tag
83
85
tag (dryrun = test , version = version )
84
86
85
87
# release to pypi and npmjs
86
88
pypi (test = test )
87
- npmjs (dryRun = test )
89
+ npmjs (dryrun = test )
88
90
89
91
def main ():
90
92
parser = argpar .ArgumentParser ()
0 commit comments