Skip to content

Support Python 2.7, 3.4, 3.5, 3.6 - #17

Merged
oena merged 11 commits into
cmap:masterfrom
mruffalo:python3
Nov 5, 2017
Merged

oena merged 11 commits into
cmap:masterfrom
mruffalo:python3

Conversation

@mruffalo

Copy link
Copy Markdown
Contributor

Not many changes were required:

  • Relative imports
  • Using the six package for a few renamed modules/builtin functions/etc.
  • Using the __future__.print_function import in test_concat_gctoo.py

All tests passed under 2.7, 3.4, 3.5, and 3.6, as per an older Travis CI build at https://travis-ci.org/mruffalo/cmapPy/builds/294957365 -- though that build is from an older version of these changes which also included testing Python 3.3. I'm sure everything will work under Python 3.3 also, but the h5py package fails to install under 3.3 on the Travis CI service, so that version probably shouldn't be marked as "supported" without any test coverage.

Version unimportant; all versions of `six` have the (basic) functionality we
need, and those "moves" imports are core parts of the package which would be
catastrophic to change in the future.
This was suggested by 2to3, and may as well commit it.
2to3 didn't like these, and converted all of these to just 'raise Exception',
so match normal Python idioms a little closer.
@levlitichev levlitichev reopened this Oct 30, 2017
@levlitichev

Copy link
Copy Markdown
Contributor

Sorry for accidentally closing! Thanks for the PR, @mruffalo. There are a few things we want to review first, but from a glance, the changes look great.

@oena
oena merged commit cf02643 into cmap:master Nov 5, 2017
@oena

oena commented Nov 5, 2017

Copy link
Copy Markdown
Contributor

Thanks for taking the time to do this, @mruffalo! Appreciate it.

@mruffalo
mruffalo deleted the python3 branch November 5, 2017 17:09
@mruffalo

mruffalo commented Nov 9, 2017

Copy link
Copy Markdown
Contributor Author

My pleasure! This was much less work than a similar pull request I made in the old l1ktools repository: https://github.com/cmap/l1ktools/pull/14 -- especially since this code was written using modern Python 2.x idioms/style, which really eases the process of making it run under 3.x also. It was also very useful to already have Travis CI testing in place.

@oena

oena commented Nov 9, 2017

Copy link
Copy Markdown
Contributor

@mruffalo that was the whole idea behind refactoring it, so I'm very happy to hear it's not just us who find it easier to work with!

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