Skip to content

Added Python3 support (reliant on futures module)#13

Open
initialed85 wants to merge 1 commit into
kanzure:masterfrom
ftpsolutions:issue-12-consider-adding-python-3-support
Open

Added Python3 support (reliant on futures module)#13
initialed85 wants to merge 1 commit into
kanzure:masterfrom
ftpsolutions:issue-12-consider-adding-python-3-support

Conversation

@initialed85
Copy link
Copy Markdown

@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.

Comment thread setup.py
"sh",
'mock==2.0.0',
'sh==1.12.14',
'future==0.16.0',
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread tests/tests.py Outdated
import os
import unittest
import mock
from builtins import *
Copy link
Copy Markdown
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
Copy Markdown
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