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

Python3 support #1031

Merged
merged 6 commits into from
Dec 2, 2018
Merged

Python3 support #1031

merged 6 commits into from
Dec 2, 2018

Conversation

swalkinshaw
Copy link
Member

This makes Trellis compatible with both Python 2 and 3. To use Python 3 though, Ansible >= 2.5 is required. However, since we already tell people to avoid 2.5.0, let's just say use 2.5.3 at minimum.

@swalkinshaw swalkinshaw mentioned this pull request Nov 25, 2018
@fullyint
Copy link
Contributor

I haven't reviewed yet. There may be some ideas in the old python-3-compat branch, e.g., in 9e83883

Here are some hastily pasted related notes I had from months ago...

I'll try to make time to review my old PY3 to-do notes and add them here.

@swalkinshaw
Copy link
Member Author

Oh thanks, either I never knew about or forgot 😳

Looks like those changes are basically split 50/50 between Python on local and remote. This PR is definitely only for Python 3 on local machine.

Most of the changes are similar in concept, but my branch didn't seem to need a lot of them? Keep in mind I didn't test deploys yet.

@swalkinshaw
Copy link
Member Author

Going to merge this as is. We'll finish Ubuntu 18.04 separately this is useful on its own.

@fullyint feel free to post any other notes you may have.

Support both 2 and 3 but check for Ansible version
It no longer exists in Python 3. We can use `items()` which both have
and pipe to `list` in Jinja.
Old version was using `iteritems()` which doesnt work in Python 3
@swalkinshaw swalkinshaw merged commit d71840a into master Dec 2, 2018
@swalkinshaw swalkinshaw deleted the python3-support branch December 2, 2018 01:17
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