natcap / invest

InVEST®: models that map and value the goods and services from nature that sustain and fulfill human life.
Apache License 2.0
166 stars 68 forks source link

Support python 3.8 #1

Closed phargogh closed 3 years ago

phargogh commented 4 years ago

Python 3.8 is the most recently-released version of python and we should make sure that the package supports it.

phargogh commented 4 years ago

~This is probably worth waiting to tackle until we finish migrated InVEST over to github.~

Actually, this is probably worth doing before the 3.8 release.

phargogh commented 4 years ago

This has been created on bitbucket at https://bitbucket.org/natcap/invest/issues/3948/support-python-38

phargogh commented 4 years ago

We ended up doing the 3.8 release just with python 3.8 support. See below for @dcdenu4 's comment on the original bitbucket issue:

Unfortunately golhke does not have a built GDAL 2.4.1 with Python 3.8.
There is a GDAL 3.0 with Python 3.8, so without compiling our own version of
GDAL, it might make sense to add support GDAL 3.0 and then support Python
3.8 with that version of GDAL…
dcdenu4 commented 4 years ago

Python 3.8 is dependent on GDAL 3... so waiting for that to make it through the pipeline

dcdenu4 commented 4 years ago

It looks like Pyinstaller does not support Python 3.8... https://github.com/pyinstaller/pyinstaller/issues/4311.

phargogh commented 4 years ago

@dcdenu4 do we need to upgrade the pyinstaller part of the build process to python 3.8 as well? Since release/3.9 requires GDAL3, couldn't we just stick with python 3.7 for the time being? It looks like Gohlke has a GDAL build for python3.7/GDAL3+.

dcdenu4 commented 4 years ago

@phargogh Ohhh, interesting. Yes, definitely can stick with Python 3.7 for the builds. I confused myself in what was doing what.

dcdenu4 commented 4 years ago

I have been testing this out as of late and discovered the following:

Bump version as is:

Use Conda to handle Windows build and tests:

phargogh commented 4 years ago

@dcdenu4 it looks like pyinstaller may have recently merged python 3.8 support on their develop branch (https://github.com/pyinstaller/pyinstaller/issues/4311) but have not yet officially released that change. It could be interesting to try building against their develop branch and see how well it works for InVEST.

dcdenu4 commented 4 years ago

Update on supporting Python 3.8. There is a change between Python 3.7, 3.8, and 3.8.4 that effects src/natcap/invest/ui/model.py. Specifically the __setattr__ function implementation with: object.__setattr__(self, name, value). For python 3.8 this works: super().__setattr__(name, value), however python 3.7 fails with this implementation: TypeError: can't apply this __setattr__ to object object

dcdenu4 commented 3 years ago

I think this issue is good to go. There's another issue mentioning Pyinstaller and waiting on a release for 3.8.