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

Make codebase compatible with both Python 2.7 and 3 (#35) #50

Merged
merged 5 commits into from May 20, 2019

Conversation

PawelLipski
Copy link
Collaborator

No description provided.

@PawelLipski PawelLipski requested a review from pasuder May 7, 2019 14:56
Copy link
Contributor

@pasuder pasuder left a comment

Choose a reason for hiding this comment

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

IMO change of version should touch minor or major version number due to change of python code base. It is a break in compatibility: https://apr.apache.org/versioning.html

- python: 3.6
env: TOXENV=py36
- python: 2.7 # TODO: bump to 3.6
Copy link
Contributor

Choose a reason for hiding this comment

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

What happened here? I found it in commit 2fc9aba and got it 😏

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Obsolete now

- python: 3.6
env: TOXENV=py36
- python: 2.7 # TODO: bump to 3.6
- python: 3.6
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pls take a look at the updated matrix (that still takes 2.7 into account)

Copy link
Contributor

Choose a reason for hiding this comment

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

pep8 run under python2.7 and python3.6. I do not know if it is needed, but maybe there are different rules for those versions. It seems to be okey.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I put the entire cartesian product of possible envs/versions just to be sure nothing is missed :)

RELEASE_NOTES.md Outdated
@@ -1,5 +1,9 @@
# Release notes

## New in git-machete 2.9.1
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO that change is a bit break in compatibility and should be reflected in at least minor number: 2.10.0 or even in major number: 3.0.0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually... I now tried to ensure that it works both under Python 2.7 and Python 3, pls take a look :) Thus, it now merits at most minor version change.

@@ -44,31 +44,35 @@ def underline(s):
return UNDERLINE + s + ENDC


def star(f): # tuple unpacking in lambdas
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice trick 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's what stackoverflow adviced to emulate tuple unpacking in lambdas under Python 3... since this feature is gone :(

@PawelLipski PawelLipski changed the title Migrate codebase to Python 3 (#35) Make codebase compatible with both Python 2.7 and 3 (#35) May 10, 2019
@PawelLipski
Copy link
Collaborator Author

@pasuder comments addressed, I tried to make codebase both Python 2 and 3 compatible... at least until next major relase.

- python: 3.6
env: TOXENV=py36
- python: 2.7 # TODO: bump to 3.6
- python: 3.6
Copy link
Contributor

Choose a reason for hiding this comment

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

pep8 run under python2.7 and python3.6. I do not know if it is needed, but maybe there are different rules for those versions. It seems to be okey.

@PawelLipski PawelLipski merged commit 6862e29 into develop May 20, 2019
@PawelLipski PawelLipski deleted the refactor/python-3 branch May 20, 2019 20:21
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.

None yet

2 participants