Closed phargogh closed 3 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.
This has been created on bitbucket at https://bitbucket.org/natcap/invest/issues/3948/support-python-38
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…
Python 3.8 is dependent on GDAL 3... so waiting for that to make it through the pipeline
It looks like Pyinstaller does not support Python 3.8... https://github.com/pyinstaller/pyinstaller/issues/4311.
@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+.
@phargogh Ohhh, interesting. Yes, definitely can stick with Python 3.7 for the builds. I confused myself in what was doing what.
I have been testing this out as of late and discovered the following:
Bump version as is:
Collecting Shapely<1.7.0,>=1.6.4
Downloading Shapely-1.6.4.post2.tar.gz (225 kB)
ERROR: Command errored out with exit status 1:
command: 'C:\hostedtoolcache\windows\Python\3.8.3\x64\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pip-install-wckwi6py\\Shapely\\setup.py'"'"'; __file__='"'"'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pip-install-wckwi6py\\Shapely\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\runneradmin\AppData\Local\Temp\pip-pip-egg-info-1c_9vynb'
cwd: C:\Users\runneradmin\AppData\Local\Temp\pip-install-wckwi6py\Shapely\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\runneradmin\AppData\Local\Temp\pip-install-wckwi6py\Shapely\setup.py", line 80, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "C:\Users\runneradmin\AppData\Local\Temp\pip-install-wckwi6py\Shapely\shapely\_buildcfg.py", line 200, in <module>
lgeos = CDLL("geos_c.dll")
File "C:\hostedtoolcache\windows\Python\3.8.3\x64\lib\ctypes\__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Traceback (most recent call last):
File "setup.py", line 15, in <module>
import Cython.Build
ModuleNotFoundError: No module named 'Cython'
Use Conda to handle Windows build and tests:
@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.
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
I think this issue is good to go. There's another issue mentioning Pyinstaller and waiting on a release for 3.8.
Python 3.8 is the most recently-released version of python and we should make sure that the package supports it.