##// END OF EJS Templates
Change return type in docstring to literal tuple to avoid bogus cross-ref....
Change return type in docstring to literal tuple to avoid bogus cross-ref. Before this change the Sphinx tried to produce cross-reference links for the returned (stdout, stderr) tuple. The docs build produced a warning because there are 2 possible cross-ref objects for `stdout`, one in `IPython.testing.iptestcontroller.TestController`, the other in `IPython.utils.capture.CapturedIO`. Neither of those is correct in the context of the `ipexec()` function. Changing literal ``(stdout, stderr)`` avoids the warning by preventing the attempt to produce cross-references.

File last commit:

r23530:eae27b5a
r24067:fcbe9bad
Show More
toollib.py
55 lines | 1.4 KiB | text/x-python | PythonLexer
"""Various utilities common to IPython release and maintenance tools.
"""
# Library imports
import os
# Useful shorthands
pjoin = os.path.join
cd = os.chdir
# Constants
# SSH root address of the archive site
archive_user = 'ipython@archive.ipython.org'
archive_dir = 'archive.ipython.org'
archive = '%s:%s' % (archive_user, archive_dir)
# Build commands
# Source dists
sdists = './setup.py sdist --formats=gztar'
# Binary dists
def buildwheels():
sh('python3 setupegg.py bdist_wheel')
# Utility functions
def sh(cmd):
"""Run system command in shell, raise SystemExit if it returns an error."""
print("$", cmd)
stat = os.system(cmd)
#stat = 0 # Uncomment this and comment previous to run in debug mode
if stat:
raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
# Backwards compatibility
c = sh
def get_ipdir():
"""Get IPython directory from command line, or assume it's the one above."""
# Initialize arguments and check location
ipdir = pjoin(os.path.dirname(__file__), os.pardir)
ipdir = os.path.abspath(ipdir)
cd(ipdir)
if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
raise SystemExit('Invalid ipython directory: %s' % ipdir)
return ipdir
try:
execfile = execfile
except NameError:
def execfile(fname, globs, locs=None):
locs = locs or globs
exec(compile(open(fname).read(), fname, "exec"), globs, locs)