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

Added Python3 support (reliant on futures module) #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

initialed85
Copy link

@initialed85 initialed85 commented Apr 25, 2018

This PR refers to the following issue:

Consider adding Python3 support

It is to add Python3 support (while retaining Python2 support).

It relies on the "future" Python module and all unit tests pass under Python2.7, Python3.6, PyPy 5.10 and PyPy3 5.10.1.

Manual end-to-end testing against an actual Windows server seems fine under both Python2.7 and Python3.5 in an Ubuntu Docker container.

"sh",
'mock==2.0.0',
'sh==1.12.14',
'future==0.16.0',
Copy link
Owner

Choose a reason for hiding this comment

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

why not __future__?

Copy link
Author

@initialed85 initialed85 Apr 25, 2018

Choose a reason for hiding this comment

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

See other comment about the "future" tool- it should mix in __future__ where required (in each Python file). I don't think you can install __future__ as a package, I believe it's a builtin.

tests/tests.py Outdated
import unittest
import mock
from builtins import *
Copy link
Owner

Choose a reason for hiding this comment

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

What's going on here? from builtins import * deserves an explanatory comment.

Copy link
Author

Choose a reason for hiding this comment

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

That's a byproduct of the "future" module- I should have explained the process a bit more.

It comes with a tool "futurize" that I've used across the code base (with the command futurize -0 -u -w -n -a) that places a lot of this stuff at the top of each file; I haven't really questioned this, I can look at what's used and minimise the imports if you like.

@initialed85 initialed85 force-pushed the issue-12-consider-adding-python-3-support branch from fd965da to 1840238 Compare April 25, 2018 11:51
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.

2 participants