Skip to content

Remove codepath for Python < 3.6 #11949

Closed

Description

@Carreau

This issue is in priority for new for new contributors; even if you are a new contributor lease fix only one of the places linked to below; to leave a chance for someone else to contribute.

We dropped Python 3.5 a few minutes ago : #11937

There is likely a number of place that use codepath only for Python 3.5 and below:

tools/gen_latex_symbols.py
14:if sys.version_info[0] < 3:

IPython/core/async_helpers.py
102:        if sys.version_info >= (3,8):
133:    if sys.version_info < (3, 7):
152:    if sys.version_info > (3, 8):

IPython/core/interactiveshell.py
119:if sys.version_info > (3,6):
169:if sys.version_info > (3, 5):
2248:        if sys.version_info >(3,5):

IPython/lib/pretty.py
102:DICT_IS_ORDERED = sys.version_info >= (3, 6)

IPython/terminal/interactiveshell.py
418:        if sys.version_info >= (3, 6):

IPython/testing/iptest.py
116:        In [3]: test_for('sys', (2,6), callback=lambda sys: sys.version_info)

IPython/extensions/tests/test_autoreload.py
143:    @skipif(sys.version_info < (3, 6))

IPython/lib/tests/test_display.py
52:    if sys.version_info >= (3, 6):

IPython/core/tests/test_async_helpers.py
17:if sys.version_info > (3, 5):
204:                          sys.version_info >= (3, 6),

IPython/core/tests/test_completer.py
474:            if sys.version_info > (3, 4):

Some of these can be cleaned up either because they are always True or False now.

If you are a new contributor and look to make one of your first contribution; try to find one of these place in the IPython codebase (line number may have shifted a bit); understand what it does, and try to clean it up to make the code base simpler.

Activity

  1. pinned this issue on Nov 16, 2019
  2. kousikmitra commented on Nov 17, 2019

    @kousikmitra
    Contributor

    hey, I am a new contributor. I want to work on this issue and it will be my first contribution. Can I work on this?

  3. Carreau commented on Nov 17, 2019

    @Carreau
    MemberAuthor

    hi @kousikmitra ,

    Of course; If you need more detailed instructions feel free to ask; and you can send a pull-request even if it's unfinished.

    The goal of this issue is to make it easy to a do a first simple, couple of line contribution; make sure you can get IPython installed from source and working.

  4. kousikmitra commented on Nov 17, 2019

    @kousikmitra
    Contributor

    Thanks. what about the version checks of python version 3.8, 3.7. Those checks are still needed right?
    As per your example,

    IPython/core/async_helpers.py
    
    102:    if sys.version_info >= (3,8):
    
    133:    if sys.version_info < (3, 7):
    
    152:    if sys.version_info > (3, 8):
    
  5. kousikmitra commented on Nov 18, 2019

    @kousikmitra
    Contributor

    I have made all changes. But the iptest is failing because of this reason,

    Test group: core
    C:\Users\Kousik\open-source\ipython\IPython\html.py:14: ShimWarning: The `IPython.html` package has been deprecated since IPython 4.0. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
      "`IPython.html.widgets` has moved to ``ipywidgets``.", ShimWarning)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\kousik\open-source\ipython\IPython\__init__.py", line 56, in <module>
        from .terminal.embed import embed
      File "c:\users\kousik\open-source\ipython\IPython\terminal\embed.py", line 15, in <module>
        from IPython.display import display
      File "c:\users\kousik\open-source\ipython\IPython\display.py", line 16, in <module>
        from IPython.lib.display import *
      File "c:\users\kousik\open-source\ipython\IPython\lib\display.py", line 5, in <module>
        from html import escape as html_escape
    
     ______________________________________________________________________
    Test suite completed for system with the following information:
    IPython version: 7.10.0.dev
    IPython commit : 6a8a5943e (repository)
    IPython package: c:\users\kousik\open-source\ipython\IPython
    Python version : 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
    sys.executable : c:\users\kousik\.virtualenvs\ipython-mxouhwgk\scripts\python.exe
    Platform       : Windows-10-10.0.18362-SP0
    
    Tools and libraries available at test time:
       matplotlib pygments sqlite3
    
    Status: ERROR - 1 out of 1 test groups failed (core). Took 0.430s.
    
    You may wish to rerun these, with:
      iptest core
    

    This test was also failing before I made the changes. Should I create the pull request?

  6. added a commit that references this issue on Nov 21, 2019
  7. unpinned this issue on Nov 21, 2019
  8. added this to the 7.10 milestone on Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions