Skip to content

MAINT: remove support for python 2.6#437

Merged
lesteve merged 4 commits intojoblib:masterfrom
aabadie:remove_py26
Dec 5, 2016
Merged

MAINT: remove support for python 2.6#437
lesteve merged 4 commits intojoblib:masterfrom
aabadie:remove_py26

Conversation

@aabadie
Copy link
Copy Markdown
Contributor

@aabadie aabadie commented Dec 2, 2016

Fixes #435

Achievements:

  • PY26 global variable dropped
  • Travis CI matrix updated
  • Most of existing references to python 2.6 have been removed
  • python 2.6 test data removed
  • string formatting style updated

2 things are not done though because I need someone else's opinion:

  • in doc/Memory.rst : the collision warning is also available with python >= 2.7. Should I just change 2.6 in 2.7 or rephrase ?
  • in joblib/func_inspect.py: the getfullargspec() docstring suggests to rewrite this method using a backport of Python 3. Should this be done in this PR or does it deserve a dedicated PR ?

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 2, 2016

in doc/Memory.rst : the collision warning is also available with python >= 2.7. Should I just change 2.6 in 2.7 or rephrase ?

If you have the collision warning in Python 2.7 use Python 2.7.

in joblib/func_inspect.py: the getfullargspec() docstring suggests to rewrite this method using a backport of Python 3. Should this be done in this PR or does it deserve a dedicated PR ?

You know my answer to this one, right ;-) ? Dedicated PR please. To be honest the way we do it in scikit-learn is not that great we use a backport of inspect.signature that does not seem to be very actively maintained. One pyston guy opened a reasonably trivial PR and got no answer there. See testing-cabal/funcsigs#30 for more details.

Copy link
Copy Markdown
Member

@lesteve lesteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes seem fine, but were there not more code like your streaming compression stuff that was Python 2.6 specific?


env:
matrix:
- PYTHON_VERSION="2.6" NUMPY_VERSION="1.6"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Python 2.7 to keep testing for numpy 1.6

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, travis shows that this change needs new test data to be generated...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep good point, should be quick with the scripts, also add py27-np16 to the list of conda envs in the main script regenerating the data for all the envs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm the tests pass now although you have not regenerated the data. This is a bit worrisome.

"""Nice bench summary function."""
summary = """Benchmark summary:
- Global values:
. Joblib version: {0}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kudos for the nice initiative

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Dec 2, 2016

The changes seem fine, but were there not more code like your streaming compression stuff that was Python 2.6 specific?

Yes . The cases were also used for some file object (BZ2File) with python 2.7.

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 2, 2016

Yes . The cases were also used for some file object (BZ2File) with python 2.7.

I am a bit disappointed not to remove more code :).

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 5, 2016

The Travis error needs to be looked at. We get two warnings when we expect one, not sure why.

======================================================================
FAIL: joblib.test.test_numpy_pickle.test_joblib_pickle_across_python_versions
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/miniconda2/envs/testenv/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/joblib/joblib/joblib/test/test_numpy_pickle.py", line 525, in test_joblib_pickle_across_python_versions
    _check_pickle(fname, expected_list)
  File "/home/travis/build/joblib/joblib/joblib/test/test_numpy_pickle.py", line 457, in _check_pickle
    assert len(caught_warnings) == expected_nb_warnings
AssertionError: 
>>  assert len([<warnings.WarningMessage object at 0x2b2522d8cdd0>, <warnings.WarningMessage object at 0x2b2522e47d10>]) == 1

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 5, 2016

It looks like we catch a DeprecationWarning from numpy ... DeprecationWarning('The compiler package is deprecated and removed in Python 3.x.',). Maybe the simplest thing to do is to filter warnings manually if w.filename does not contain joblib. Maybe there is a better way to do it more cleanly with a warnings filter ...

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 5, 2016

I pushed a fix, let's see how this goes.


env:
matrix:
- PYTHON_VERSION="2.6" NUMPY_VERSION="1.6"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm the tests pass now although you have not regenerated the data. This is a bit worrisome.


# Change the list according to your local conda/virtualenv env.
CONDA_ENVS="py26-np16 py27-np17 py33-np18 py34-np19 py35-np19"
CONDA_ENVS="py27-np17 py33-np18 py34-np19 py35-np19"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add py27-np16 here.

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 5, 2016

I generated the data for python 2.7 and numpy 1.6. While doing that I realised that there were some .lzma and .xz files for Python 2.6, that does not make any sense right @aabadie ?

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 5, 2016

OK, merging this one, thanks!

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 6, 2016

There are still Python 2.6 stuff, @aabadie could you finish up the cleanup?

$ git grep '2\.6'
README.rst:versions are 2.6+ and 3.3+). Numpy (at least version 1.6.1) is an
joblib/func_inspect.py:    once we drop support for Python 2.6. We went for a simpler
joblib/func_inspect.py:    which is not available in Python 2.6.
joblib/numpy_pickle_utils.py:    Required as e.g. ZipExtFile in python 2.6 can return less data than
joblib/pool.py:    # customize the dispatch table without side effects in Python 2.6
joblib/testing.py:    # Python <= 2.6, we still need nose here
setup.py:              'Programming Language :: Python :: 2.6',

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Dec 6, 2016

indeed @lesteve, I'll issue another PR soon.

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 6, 2016

Can you add an entry in CHANGES.rst as well, saying that Python 2.6 support has been dropped in version ? (maybe worth going to 0.11 for this exact reason).

@aabadie aabadie mentioned this pull request Dec 6, 2016
@GaelVaroquaux
Copy link
Copy Markdown
Member

GaelVaroquaux commented Dec 6, 2016 via email

@lesteve
Copy link
Copy Markdown
Member

lesteve commented Dec 6, 2016

+1 for jumping the version number. That said, let's release only when we have significant new features: the goal is not to drop 2.6 and not bring anything to people.

Yep, agreed.

yarikoptic added a commit to yarikoptic/joblib that referenced this pull request Dec 8, 2016
* commit '0.10.2-55-g660fe5d': (52 commits)
  MAINT simplify way to skip doctests
  Do not print frames with IPython internals in format_stack
  BF(TST): compare for version in pickled filename ignoring full path, and looking for _ as well (joblib#445)
  [MRG] Remove nose dependency completely. (joblib#441)
  MAINT add Python 3.5 in setup.py
  Remove some Python 2.6 specific code
  [MRG] Make test execution on CI possible through py.test command. (joblib#433)
  Remove more python 2.6 related code (joblib#440)
  [MRG] Use commit range for diff in flake8_diff.sh (joblib#439)
  MAINT remove support for python 2.6 (joblib#437)
  Improve doc about caching methods (joblib#432)
  Get the tests passing with py.test
  MAINT update flake8_diff.sh
  COSMIT move stdlib imports where they belong
  [MRG] Replace assert_* methods with "assert" keyword statements. (joblib#430)
  Reraise when the exception is not a TransportableException (joblib#429)
  Make sure LICENSE.txt is included in the wheel
  Add LICENSE.txt
  Update doc/paralle.rst
  [MRG+1] Remove all nose imports from test scripts. (joblib#422)
  ...
yarikoptic added a commit to yarikoptic/joblib that referenced this pull request Dec 8, 2016
* releases: (52 commits)
  MAINT simplify way to skip doctests
  Do not print frames with IPython internals in format_stack
  BF(TST): compare for version in pickled filename ignoring full path, and looking for _ as well (joblib#445)
  [MRG] Remove nose dependency completely. (joblib#441)
  MAINT add Python 3.5 in setup.py
  Remove some Python 2.6 specific code
  [MRG] Make test execution on CI possible through py.test command. (joblib#433)
  Remove more python 2.6 related code (joblib#440)
  [MRG] Use commit range for diff in flake8_diff.sh (joblib#439)
  MAINT remove support for python 2.6 (joblib#437)
  Improve doc about caching methods (joblib#432)
  Get the tests passing with py.test
  MAINT update flake8_diff.sh
  COSMIT move stdlib imports where they belong
  [MRG] Replace assert_* methods with "assert" keyword statements. (joblib#430)
  Reraise when the exception is not a TransportableException (joblib#429)
  Make sure LICENSE.txt is included in the wheel
  Add LICENSE.txt
  Update doc/paralle.rst
  [MRG+1] Remove all nose imports from test scripts. (joblib#422)
  ...
@aabadie aabadie deleted the remove_py26 branch February 27, 2018 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants