Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 2.7 support #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
0.13.10 (unreleased)
--------------------

- Nothing changed yet.
- Drop Python 2.7 compatibility.


0.13.9 (2021-06-02)
Expand Down
14 changes: 3 additions & 11 deletions ipdb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Redistributable under the revised BSD license
# https://opensource.org/licenses/BSD-3-Clause

from __future__ import print_function
import os
import sys

Expand All @@ -16,10 +15,7 @@
from IPython.core.debugger import BdbQuit_excepthook
from IPython.terminal.ipapp import TerminalIPythonApp
from IPython.terminal.embed import InteractiveShellEmbed
try:
import configparser
except:
import ConfigParser as configparser
import configparser


def _get_debugger_cls():
Expand Down Expand Up @@ -93,7 +89,7 @@ def get_context_from_config():
)


class ConfigFile(object):
class ConfigFile:
"""
Filehandle wrapper that adds a "[ipdb]" section to the start of a config
file so that users don't actually have to manually add a [ipdb] section.
Expand Down Expand Up @@ -255,11 +251,7 @@ def main():
import sys
import getopt

try:
from pdb import Restart
except ImportError:
class Restart(Exception):
pass
from pdb import Restart

if sys.version_info >= (3, 7):
opts, args = getopt.getopt(sys.argv[1:], 'mhc:', ['help', 'command='])
Expand Down
1 change: 0 additions & 1 deletion ipdb/stdout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import sys
from contextlib import contextmanager
from IPython.utils import io
Expand Down
16 changes: 2 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import io
import re
from sys import version_info

from setuptools import find_packages, setup

Expand All @@ -19,18 +18,11 @@
'\n\n' + open('HISTORY.txt').read())


if version_info[0] == 2:
console_script = 'ipdb'
else:
console_script = 'ipdb%d' % version_info.major


setup(name='ipdb',
version=version,
description="IPython-enabled pdb",
long_description=long_description,
classifiers=[
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
Expand All @@ -54,23 +46,19 @@
include_package_data=True,
zip_safe=True,
test_suite='tests',
python_requires=">=2.7",
python_requires=">=3.4",
install_requires=[
'setuptools',
],
extras_require={
':python_version == "2.7"': ['ipython >= 5.1.0, < 6.0.0', 'toml >= 0.10.2', 'decorator < 5.0.0'],
# No support for python 3.0, 3.1, 3.2.
# FTR, `decorator` is also a dependency of Ipython.
':python_version == "3.4"': ['ipython >= 6.0.0, < 7.0.0', 'toml >= 0.10.2', 'decorator < 5.0.0'],
':python_version == "3.5"': ['ipython >= 7.0.0, < 7.10.0', 'toml >= 0.10.2', 'decorator'],
':python_version == "3.6"': ['ipython >= 7.10.0, < 7.17.0', 'toml >= 0.10.2', 'decorator'],
':python_version > "3.6"': ['ipython >= 7.17.0', 'toml >= 0.10.2', 'decorator'],
},
tests_require=[
'mock; python_version<"3"'
],
entry_points={
'console_scripts': ['%s = ipdb.__main__:main' % console_script]
'console_scripts': ['ipdb3 = ipdb.__main__:main']
}
)
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ipdb.__main__ import get_config


class ModifiedEnvironment(object):
class ModifiedEnvironment:
"""
I am a context manager that sets up environment variables for a test case.
"""
Expand Down
5 changes: 1 addition & 4 deletions tests/test_opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
# https://opensource.org/licenses/BSD-3-Clause

import unittest
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from unittest.mock import patch

from getopt import GetoptError
from ipdb.__main__ import main
Expand Down