diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 356a1e5..7d5d9db 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -591,7 +591,7 @@ class Completer(Configurable): greedy = Bool(False, help="""Activate greedy completion - PENDING DEPRECTION. this is now mostly taken care of with Jedi. + PENDING DEPRECATION. this is now mostly taken care of with Jedi. This will enable completion on elements of lists, results of function calls, etc., but can be unsafe because the code is actually evaluated on TAB. diff --git a/IPython/core/magics/config.py b/IPython/core/magics/config.py index 25a74e0..c1387b6 100644 --- a/IPython/core/magics/config.py +++ b/IPython/core/magics/config.py @@ -82,7 +82,7 @@ class ConfigMagics(Magics): Current: False IPCompleter.greedy= Activate greedy completion - PENDING DEPRECTION. this is now mostly taken care of with Jedi. + PENDING DEPRECATION. this is now mostly taken care of with Jedi. This will enable completion on elements of lists, results of function calls, etc., but can be unsafe because the code is actually evaluated on TAB. Current: False diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 5e7d95f..c886b4b 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -51,7 +51,6 @@ from .prompts import Prompts, ClassicPrompts, RichPromptDisplayHook from .ptutils import IPythonPTCompleter, IPythonPTLexer from .shortcuts import create_ipython_shortcuts -DISPLAY_BANNER_DEPRECATED = object() PTK3 = ptk_version.startswith('3.') @@ -579,11 +578,7 @@ class TerminalInteractiveShell(InteractiveShell): rl_next_input = None - def interact(self, display_banner=DISPLAY_BANNER_DEPRECATED): - - if display_banner is not DISPLAY_BANNER_DEPRECATED: - warn('interact `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) - + def interact(self): self.keep_running = True while self.keep_running: print(self.separate_in, end='') @@ -599,11 +594,9 @@ class TerminalInteractiveShell(InteractiveShell): if code: self.run_cell(code, store_history=True) - def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED): + def mainloop(self): # An extra layer of protection in case someone mashing Ctrl-C breaks # out of our internal code. - if display_banner is not DISPLAY_BANNER_DEPRECATED: - warn('mainloop `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) while True: try: self.interact() diff --git a/IPython/terminal/ptshell.py b/IPython/terminal/ptshell.py deleted file mode 100644 index 666d3c5..0000000 --- a/IPython/terminal/ptshell.py +++ /dev/null @@ -1,8 +0,0 @@ -raise DeprecationWarning("""DEPRECATED: - -After Popular request and decision from the BDFL: -`IPython.terminal.ptshell` has been moved back to `IPython.terminal.interactiveshell` -during the beta cycle (after IPython 5.0.beta3) Sorry about that. - -This file will be removed in 5.0 rc or final. -""") diff --git a/tools/backport_pr.py b/tools/backport_pr.py deleted file mode 100755 index c4c06b5..0000000 --- a/tools/backport_pr.py +++ /dev/null @@ -1,192 +0,0 @@ -#!/usr/bin/env python -""" -Backport pull requests to a particular branch. - -Usage: backport_pr.py [org/repository] branch [PR] [PR2] - -e.g.: - - python tools/backport_pr.py 0.13.1 123 155 - -to backport PRs #123 and #155 onto branch 0.13.1 - -or - - python tools/backport_pr.py 2.1 - -to see what PRs are marked for backport with milestone=2.1 that have yet to be applied -to branch 2.x - -or - - python tools/backport_pr.py jupyter/notebook 0.13.1 123 155 - -to backport PRs #123 and #155 of the `jupyter/notebook` repo onto branch 0.13.1 -of that repo. - -""" - - -import os -import re -import sys - -from subprocess import Popen, PIPE, check_call, check_output -try: - from urllib.request import urlopen -except: - from urllib import urlopen - -from gh_api import ( - get_issues_list, - get_pull_request, - get_pull_request_files, - is_pull_request, - get_milestone_id, -) - -def find_rejects(root='.'): - for dirname, dirs, files in os.walk(root): - for fname in files: - if fname.endswith('.rej'): - yield os.path.join(dirname, fname) - -def get_current_branch(): - branches = check_output(['git', 'branch']) - for branch in branches.splitlines(): - if branch.startswith(b'*'): - return branch[1:].strip().decode('utf-8') - -def backport_pr(branch, num, project='ipython/ipython'): - current_branch = get_current_branch() - if branch != current_branch: - check_call(['git', 'checkout', branch]) - check_call(['git', 'pull']) - pr = get_pull_request(project, num, auth=True) - files = get_pull_request_files(project, num, auth=True) - patch_url = pr['patch_url'] - title = pr['title'] - description = pr['body'] - fname = "PR%i.patch" % num - if os.path.exists(fname): - print("using patch from {fname}".format(**locals())) - with open(fname, 'rb') as f: - patch = f.read() - else: - req = urlopen(patch_url) - patch = req.read() - - lines = description.splitlines() - if len(lines) > 5: - lines = lines[:5] + ['...'] - description = '\n'.join(lines) - - msg = "Backport PR #%i: %s" % (num, title) + '\n\n' + description - check = Popen(['git', 'apply', '--check', '--verbose'], stdin=PIPE) - a,b = check.communicate(patch) - - if check.returncode: - print("patch did not apply, saving to {fname}".format(**locals())) - print("edit {fname} until `cat {fname} | git apply --check` succeeds".format(**locals())) - print("then run tools/backport_pr.py {num} again".format(**locals())) - if not os.path.exists(fname): - with open(fname, 'wb') as f: - f.write(patch) - return 1 - - p = Popen(['git', 'apply'], stdin=PIPE) - a,b = p.communicate(patch) - - filenames = [ f['filename'] for f in files ] - - check_call(['git', 'add'] + filenames) - - check_call(['git', 'commit', '-m', msg]) - - print("PR #%i applied, with msg:" % num) - print() - print(msg) - print() - - if branch != current_branch: - check_call(['git', 'checkout', current_branch]) - - return 0 - -backport_re = re.compile(r"(?:[Bb]ackport|[Mm]erge).*#(\d+)") - -def already_backported(branch, since_tag=None): - """return set of PRs that have been backported already""" - if since_tag is None: - since_tag = check_output(['git','describe', branch, '--abbrev=0']).decode('utf8').strip() - cmd = ['git', 'log', '%s..%s' % (since_tag, branch), '--oneline'] - lines = check_output(cmd).decode('utf8') - return set(int(num) for num in backport_re.findall(lines)) - -def should_backport(labels=None, milestone=None, project='ipython/ipython'): - """return set of PRs marked for backport""" - if labels is None and milestone is None: - raise ValueError("Specify one of labels or milestone.") - elif labels is not None and milestone is not None: - raise ValueError("Specify only one of labels or milestone.") - if labels is not None: - issues = get_issues_list(project, - labels=labels, - state='closed', - auth=True, - ) - else: - milestone_id = get_milestone_id(project, milestone, - auth=True) - issues = get_issues_list(project, - milestone=milestone_id, - state='closed', - auth=True, - ) - - should_backport = set() - for issue in issues: - if not is_pull_request(issue): - continue - pr = get_pull_request(project, issue['number'], - auth=True) - if not pr['merged']: - print ("Marked PR closed without merge: %i" % pr['number']) - continue - if pr['base']['ref'] != 'master': - continue - should_backport.add(pr['number']) - return should_backport - -if __name__ == '__main__': - project = 'ipython/ipython' - - print("DEPRECATE: backport_pr.py is deprecated and it is now recommended" - "to install `ghpro` from PyPI.", file=sys.stderr) - - args = list(sys.argv) - if len(args) >= 2: - if '/' in args[1]: - project = args[1] - del args[1] - - if len(args) < 2: - print(__doc__) - sys.exit(1) - - if len(args) < 3: - milestone = args[1] - branch = milestone.split('.')[0] + '.x' - already = already_backported(branch) - should = should_backport(milestone=milestone, project=project) - print ("The following PRs should be backported:") - for pr in sorted(should.difference(already)): - print (pr) - sys.exit(0) - - for prno in map(int, args[2:]): - print("Backporting PR #%i" % prno) - rc = backport_pr(args[1], prno, project=project) - if rc: - print("Backporting PR #%i failed" % prno) - sys.exit(rc)