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

Making python3 work with cmake and the new python wrapper #1923

Merged
merged 1 commit into from Feb 24, 2015

Conversation

Projects
None yet
4 participants
@philkr
Contributor

philkr commented Feb 21, 2015

Rebase of #1894 to master.

A small change than allows the cmake based build to use python3.
Simply specify the "python_version" in the cmake configuration (either 2 or 3).

Also replaced "import_array" with "import_array1" which works for both python 2.7 and 3.? .

Protobuf and pycaffe should now work with python3. Updated the docs to reflect the fact that protobuf 3.0 alpha is required for python3 (not for python2).

philkr added a commit to philkr/caffe that referenced this pull request Feb 21, 2015

Merge pull request BVLC#1923 from philkr/python3_master
Making python3 work with cmake and the new python wrapper
@longjon

This comment has been minimized.

Show comment
Hide comment
@longjon

longjon Feb 24, 2015

Contributor

Cool, but some of the Python changes appear to be superfluous... were they automatically generated? I.e., there are some extra parens in print statements, and some list(...)s added where not apparently needed. What's up with that?

Contributor

longjon commented Feb 24, 2015

Cool, but some of the Python changes appear to be superfluous... were they automatically generated? I.e., there are some extra parens in print statements, and some list(...)s added where not apparently needed. What's up with that?

@philkr

This comment has been minimized.

Show comment
Hide comment
@philkr

philkr Feb 24, 2015

Contributor

I used 2to3. The list and duplicate parens should be cleaned up now.

Contributor

philkr commented Feb 24, 2015

I used 2to3. The list and duplicate parens should be cleaned up now.

@tnarihi

This comment has been minimized.

Show comment
Hide comment
@tnarihi

tnarihi Feb 24, 2015

Contributor

Does this PR mean the future PRs regarding Python features should be compatible with Python 3?

Contributor

tnarihi commented Feb 24, 2015

Does this PR mean the future PRs regarding Python features should be compatible with Python 3?

@philkr

This comment has been minimized.

Show comment
Hide comment
@philkr

philkr Feb 24, 2015

Contributor

That would be nice. Do you have anything in mind that wouldn't work with python3?

Contributor

philkr commented Feb 24, 2015

That would be nice. Do you have anything in mind that wouldn't work with python3?

Show outdated Hide outdated python/caffe/io.py
@longjon

This comment has been minimized.

Show comment
Hide comment
@longjon

longjon Feb 24, 2015

Contributor

Looks good except as noted. @Nerei, can you give a nod to the CMake additions (or comment as needed)?

Regarding future PRs, yes, let's try to maintain Python 3 compatibility as long as it's easy to do so. If there's major functionality that relies on Python 2, we'll have to rethink that, but it's definitely going to be easier to maintain compatibility rather than lose it and try to restore it when we really want it.

@philkr, if you want to add Python 3 testing to Travis, that would be a big step toward keeping future code compatible.

Contributor

longjon commented Feb 24, 2015

Looks good except as noted. @Nerei, can you give a nod to the CMake additions (or comment as needed)?

Regarding future PRs, yes, let's try to maintain Python 3 compatibility as long as it's easy to do so. If there's major functionality that relies on Python 2, we'll have to rethink that, but it's definitely going to be easier to maintain compatibility rather than lose it and try to restore it when we really want it.

@philkr, if you want to add Python 3 testing to Travis, that would be a big step toward keeping future code compatible.

@tnarihi

This comment has been minimized.

Show comment
Hide comment
@tnarihi

tnarihi Feb 24, 2015

Contributor

@philkr No. I just thought it should be documented somewhere for developers or testing should be added for Python 3 compatibility as @longjon pointed.

Contributor

tnarihi commented Feb 24, 2015

@philkr No. I just thought it should be documented somewhere for developers or testing should be added for Python 3 compatibility as @longjon pointed.

@Nerei

This comment has been minimized.

Show comment
Hide comment
@Nerei

Nerei Feb 24, 2015

👍 This is a fine cmake change. Thank you!

JFYI, old cmake also supported Python3. Just in case of both installed it selected 2.x by default, for 3.x user had to specify paths manually then. But here is an additional boost_pyhton serach feature.

Nerei commented Feb 24, 2015

👍 This is a fine cmake change. Thank you!

JFYI, old cmake also supported Python3. Just in case of both installed it selected 2.x by default, for 3.x user had to specify paths manually then. But here is an additional boost_pyhton serach feature.

@longjon

This comment has been minimized.

Show comment
Hide comment
@longjon

longjon Feb 24, 2015

Contributor

Okay, all looks good now. Thanks for leading us into the future @philkr!

Contributor

longjon commented Feb 24, 2015

Okay, all looks good now. Thanks for leading us into the future @philkr!

longjon added a commit that referenced this pull request Feb 24, 2015

Merge pull request #1923 from philkr/python3_master
Making python3 work with cmake and the new python wrapper

@longjon longjon merged commit b915f9d into BVLC:master Feb 24, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

philkr added a commit to philkr/caffe that referenced this pull request Feb 25, 2015

@philkr philkr deleted the philkr:python3_master branch Feb 28, 2015

longjon added a commit that referenced this pull request Mar 4, 2015

Merge pull request #1966 from philkr/python_fixes
cmake and python3 bugfixes for #1939 and #1923

@lukeyeager lukeyeager referenced this pull request Mar 7, 2015

Merged

Pycaffe fixes and example reformation #2058

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment