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

Feature/kak/use python 3#922 #1135

Merged

Conversation

flibbertigibbet
Copy link
Contributor

@flibbertigibbet flibbertigibbet commented Aug 26, 2019

Overview

Use python 3 for the app VM, both when running ansible and to run the Django app.

Upgrades the Django app code for python 3, mostly by running the 2to3 conversion tool. The migration changes and __str__ method changes where manual.

Upgrades all VMs from Ubuntu 16.04 to 18.04 (the latest LTS) to have python 3.6 available as a system package (the latest is 3.7; Ubuntu 16.04 is on 3.5.)

Notes

This PR is against a new branch django2 just created from develop as a long-running feature branch for the changes necessary to upgrade to Django 2.x.

The database VM cannot be upgraded to use python 3 because the postgresql-support role still depends on python 2.

The OTP VM makes little use of python, but cannot be upgraded to python 3 because the transit feed validator library doesn't yet support it: google/transitfeed#412. After removing the currently unused feed validator from the OTP VM, it no longer needs pip/python, and provisions with ansible using the system python 3.6.

Testing Instructions

  • Destroy and recreate VMs
  • VMs should build and app should serve and function as expected
  • app Django server should be running on python 3.6

Closes #922

Switch to using python3 on app VM.
Database needs python 2 for PostgreSQL library support, which still defaults to 2,
and OTP uses a transit feed validator not upgraded for python 3 support.
Run python 2to3 library to upgrade for python 3 support.
Fix migrations for python 3 support.
When calling Django to get static files during JS build, use python3.
Replace string representations for Django python 3 upgrade.
No longer using phantomjs, so bzip2 unneeded.
Also remove python/pip install, as they are no longer needed.
Use system python 3 to run ansible.
Copy link
Contributor

@KlaasH KlaasH left a comment

Choose a reason for hiding this comment

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

👍 Looks good!

Co-Authored-By: Klaas Hoekema <khoekema@azavea.com>
@flibbertigibbet flibbertigibbet merged commit 77ecab7 into azavea:django2 Aug 27, 2019
@flibbertigibbet flibbertigibbet deleted the feature/kak/use-python-3#922 branch August 27, 2019 20:03
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