arup-group/osmox

Support Python 3.11

mfitz opened this issue · 0 comments

mfitz commented

OSMOX does not currently pip install successfully in a Python 3.11 environment on Ubuntu.

I was able to make pip install succeed by:

  • Upgrading the following dependencies in requirements.txt:
$ diff requirements.txt requirements-3.11.txt

< osmium==3.1.0
---
> osmium==3.5.0

< pyproj==3.1.0
---
> pyproj==3.4.1
  • Installing the native cmake library required by the upgraded osmium version (this will need documenting in README and adding to both Dockerfile and the CI build workflow):
sudo apt-get install cmake

We will need to upgrade library versions as necessary, but we should also try to find a set of dependencies that work in both Python 3.7 and Python 3.11. If we cannot do that, we will need to clearly flag the new Python version dependency, make a pre-upgrade release of OSMOX, merge the upgrade changes, then make a post-upgrade release. I would regard these two releases as differing major versions in semver terms.

If the unit test performance is anything to go by (and it may not be), we could potentially see a performance improvement in 3.11:

(osmox-3.7.6) arup@workbox-michael:~/osmox$ loops 5 ./scripts/code-coverage.sh | grep "passed, "
======================= 48 passed, 66 warnings in 3.48s ========================
======================= 48 passed, 66 warnings in 3.52s ========================
======================= 48 passed, 66 warnings in 3.54s ========================
======================= 48 passed, 66 warnings in 3.57s ========================
======================= 48 passed, 66 warnings in 3.60s ========================


(osmox-3.11.0) arup@workbox-michael:~/osmox$ loops 5 ./scripts/code-coverage.sh | grep "passed in"
============================== 48 passed in 1.50s ==============================
============================== 48 passed in 1.50s ==============================
============================== 48 passed in 1.52s ==============================
============================== 48 passed in 1.52s ==============================
============================== 48 passed in 1.51s ==============================