learning-unlimited / ESP-Website

A website to help manage the logistics of large, short-term educational programs
82 stars 57 forks source link

Upgrade to Python 3 #2576

Open benjaminjkraft opened 6 years ago

benjaminjkraft commented 6 years ago

I realized we don't have an issue to track this! Python 2 hits end of support on Jan 1, 2020, and Django 1.11 will be the last series to support it. Also, python 3 is great and has lots of nice things in it. This issue is to track our upgrade path.

hwatheod commented 5 years ago

For a start, I checked our dependency status with caniusepython3

Running caniusepython3 -r requirements.txt gives the following output

[WARNING] Skipping u'git+https://github.com/luac/django-argcache.git@0.1 ': could not parse requirement Finding and checking dependencies ...

You need 2 projects to transition to Python 3. Of those 2 projects, 2 have no direct dependencies blocking their transition:

django-selenium pydns

hwatheod commented 5 years ago

The argcache dependency was specified in a different format so the tool couldn't parse it. But it looks like it was written by LU people so we should be able to find out if it's Python 3 ready. Of the other two blocking dependencies mentioned above,

django-selenium: The requirements file says "Runs selenium tests which probably don't work anymore". Are they working? Can we get rid of it?

pydns: This is used for validating email addresses entered by users. While a nice feature, it's not absolutely critical.

milescalabresi commented 4 years ago

Doing some reading, we'll want to use the six and modernize/futurize packages. Some useful checklists:

willgearty commented 3 years ago

pydns: This is used for validating email addresses entered by users. While a nice feature, it's not absolutely critical.

Looks like there is a python 3 version: py3DNS

willgearty commented 3 years ago

There's also the 2to3 tool: https://docs.python.org/2/library/2to3.html And django has its own Python 3 upgrade docs: https://docs.djangoproject.com/en/1.11/topics/python3/

willgearty commented 3 years ago

django-selenium: The requirements file says "Runs selenium tests which probably don't work anymore". Are they working? Can we get rid of it?

Looks like you don't even need this package anymore as of Django > 1.5 (source):

This library is not needed for Django > 1.5, please use built-in functionality

milescalabresi commented 4 months ago

Fixed by #3616