OpenTreeMap / otm-core

OpenTreeMap is a collaborative platform for crowdsourced tree inventory, ecosystem services calculations, urban forestry analysis, and community engagement.
www.opentreemap.org
Other
186 stars 88 forks source link

Update requirements for Python 3 compatibility #3283

Closed jwalgran closed 4 years ago

jwalgran commented 4 years ago

Overview

Update requirements for Python 3 compatibility

This PR is targeted at a python3 branch rather than develop. This will be the first in a set of PRs that convert the application to run exclusively under Python 3. Merging this PR will break the application until it is updated to use Python 3 syntax.

Required by https://github.com/OpenTreeMap/otm-cloud/pull/501 Connects https://github.com/OpenTreeMap/otm-cloud/issues/500

Notes

Django 1.11.17 is the minimum version required to run under Python 3. https://docs.djangoproject.com/en/1.11/faq/install/#what-python-version-can-i-use-with-django

functools32 was a backport of a Python 3 included library.

The 4.2.0 version of kombu fixes a syntax error under Python 3. https://github.com/celery/kombu/issues/841

wsgiref is part of the Python 3 standard library.

Testing Instructions

This should be tested as part of https://github.com/OpenTreeMap/otm-cloud/pull/501

Checklist

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 83.784% when pulling 6a292667f4eba68c6d39a08ece8846e1c93f50b3 on feature/provision-py3 into 053e5c17322719a80ee93c190c05df285890bc58 on python3.

jwalgran commented 4 years ago

@rbreslow Requesting a review from you because of your involvement on previous Python 3 transitions.

jwalgran commented 4 years ago

I just pushed a fixup that replaces a Python 2 backport in requirements.txt with the main version of the library that supports Python 3.

https://github.com/OpenTreeMap/otm-core/pull/3283/commits/fcd6fb6bb8523e53f787feed6c980d28f36ef0dc

fungjj92 commented 4 years ago

Do we plan on upgrading to the latest versions of all requirements either in this PR or a followup?

In initial research on dependencies, I had checked py3 version compatibility in their latest releases. To test our current versions with this PR I ran caniusepython3 on the 3 requirements files and we're golden for py3 on all current versions, but not necessarily 3.7. For example, for django-contrib-comments we are on 1.8.0 which includes testing through py3.5 but not for py3.7 until the latest version, 1.9.2.

jwalgran commented 4 years ago

Excellent question. I had focused this PR on just the things that were required to get the development provisioning working. I had planned that updating code and requirements would be the next steps we take in a follow up PR.