##// END OF EJS Templates
use python -m build
Matthias Bussonnier -
Show More
@@ -1,51 +1,51 b''
1 """Various utilities common to IPython release and maintenance tools.
1 """Various utilities common to IPython release and maintenance tools.
2 """
2 """
3
3
4 # Library imports
4 # Library imports
5 import os
5 import os
6 import sys
6 import sys
7
7
8 # Useful shorthands
8 # Useful shorthands
9 pjoin = os.path.join
9 pjoin = os.path.join
10 cd = os.chdir
10 cd = os.chdir
11
11
12 # Constants
12 # Constants
13
13
14 # SSH root address of the archive site
14 # SSH root address of the archive site
15 archive_user = 'ipython@archive.ipython.org'
15 archive_user = 'ipython@archive.ipython.org'
16 archive_dir = 'archive.ipython.org'
16 archive_dir = 'archive.ipython.org'
17 archive = '%s:%s' % (archive_user, archive_dir)
17 archive = '%s:%s' % (archive_user, archive_dir)
18
18
19 # Build commands
19 # Build commands
20 # Source dists
20 # Source dists
21 sdists = "{python} setup.py sdist --formats=gztar".format(python=sys.executable)
21 sdists = "{python} -m build".format(python=sys.executable)
22 # Binary dists
22 # Binary dists
23 def buildwheels():
23 def buildwheels():
24 sh("{python} setup.py bdist_wheel".format(python=sys.executable))
24 sh("{python} -m build".format(python=sys.executable))
25
25
26
26
27 # Utility functions
27 # Utility functions
28 def sh(cmd):
28 def sh(cmd):
29 """Run system command in shell, raise SystemExit if it returns an error."""
29 """Run system command in shell, raise SystemExit if it returns an error."""
30 print("$", cmd)
30 print("$", cmd)
31 stat = os.system(cmd)
31 stat = os.system(cmd)
32 #stat = 0 # Uncomment this and comment previous to run in debug mode
32 #stat = 0 # Uncomment this and comment previous to run in debug mode
33 if stat:
33 if stat:
34 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
34 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
35
35
36 def get_ipdir():
36 def get_ipdir():
37 """Get IPython directory from command line, or assume it's the one above."""
37 """Get IPython directory from command line, or assume it's the one above."""
38
38
39 # Initialize arguments and check location
39 # Initialize arguments and check location
40 ipdir = pjoin(os.path.dirname(__file__), os.pardir)
40 ipdir = pjoin(os.path.dirname(__file__), os.pardir)
41
41
42 ipdir = os.path.abspath(ipdir)
42 ipdir = os.path.abspath(ipdir)
43
43
44 cd(ipdir)
44 cd(ipdir)
45 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
45 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
46 raise SystemExit('Invalid ipython directory: %s' % ipdir)
46 raise SystemExit('Invalid ipython directory: %s' % ipdir)
47 return ipdir
47 return ipdir
48
48
49 def execfile(fname, globs, locs=None):
49 def execfile(fname, globs, locs=None):
50 locs = locs or globs
50 locs = locs or globs
51 exec(compile(open(fname).read(), fname, "exec"), globs, locs)
51 exec(compile(open(fname).read(), fname, "exec"), globs, locs)
General Comments 0
You need to be logged in to leave comments. Login now