Hi all!

When developing qgis plugins I have usually created a python virtual
environment for each plugin project in which I have installed all the
necessary linting, formatting and testing tools.

Now I'm facing issues with new/next gen/testing osgeo4w based QGIS installs
that are using python 3.9. I have installed `pre-commit` to my venv but it
cannot run because it needs sqlite3 and it cannot be imported on the
virtual environment. ImportError is raised saying that dlls cannot be
found. I think that must be because Python changed the way DLLs are loaded
on py38. Those are not loaded any more from PATH directories. Dll search
paths are fixed in qgis.__init__.py but of course pre-commit is not aware
that before importing any libraries one should import qgis first.

I have created the virtual environment with command `python-qgis.bat -m
venv --system-site-packages env`. That is using python.exe from
apps/Python39/ and not from bin/. Therefore python doesn't find dlls from
bin/.
Is there some other way to make virtual env aware of dlls in the
osgeo4w/bin/ folder?

Does this way of using a virtual environment during development sound
reasonable anyhow?
What is your way of developing plugins?


Thanks,

-Lauri
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to