Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Setup and Start shell scripts for a virtual Python environment on Linux, add EOX with 2021 images as provider #248

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JT8D-17
Copy link

@JT8D-17 JT8D-17 commented May 2, 2024

This adds:

  • A bash script to create a virtual Python environment in the O4XP folder. This is intended for some Linux distros like Arch Linux that are already using Python 3.12 by default and to work around current scikit-fmm versioning issues. The script will install all required PIP packages and download, compile and install scikit-fmm from a branch that works in 3.12.
  • A bash script that will start O4XP in said virtual Linux environment.
  • A modified requirements.txt that is not version locked.
  • A new provider file for the superior 2021 imagery from EOX (as opposed to the default 2018 ones supplied by EOX2), see https://s2maps.eu/

@JT8D-17 JT8D-17 changed the title Add EOX with 2021 images as provider Add Setup and Start shell scripts for a virtual Python environment on Linux, add EOX with 2021 images as provider May 2, 2024
@w8sl
Copy link

w8sl commented May 6, 2024

Self contained O4XP install is a genial idea, especially when running and testing several versions of O4XP - thank you!

System GDAL is not visible in venv.
pip install gdal==$(gdal-config --version) works within Python 3.12 venv on macOS and GDAL 3.9
gdal_array, used by O4XP, works correctly only in venv created with "--system-site-packages" option with GDAL 3.8.5

$PWD is a bit different on Arch
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) works on all Unix based systems.
path=PATH on macOS, it is better to use different name, like "venv_path"

idna, charset-normalizer, urllib, certifi are installed automatically by pip, as dependency of requests. Chardet is deprecated, if I understand correctly (replaced by charset-normalizer)

w8sl added a commit to w8sl/Ortho4XP that referenced this pull request May 8, 2024
2 scripts with complete install of Ortho4XP 1.40 for macOS. Python 11 and Python 12 version.
w8sl added a commit to w8sl/Ortho4XP that referenced this pull request May 9, 2024
Works also on Ubuntu, with system packages installed as per Install_Instructions.txt

# 4. Download scikit-fmm's "meson" branch, compile and install it

git clone --branch meson https://github.com/scikit-fmm/scikit-fmm.git $path/scikit-fmm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary as there is a package on pypi that seems to do the trick.

I've just been looking at making the local process a bit more self contained but stumbled across your PR as I was about to submit one.

Via Python 3.11, here's the list of requirements that I was going to submit in a PR. Note that Rtree has been updated as the version referenced by Ortho4XP doesn't include a required DLL. sckit-fmm is also referenced.

certifi==2024.2.2
chardet==5.2.0
charset-normalizer==3.3.2
idna==3.7
numpy==1.26.4
pillow==10.3.0
pyproj==3.6.1
requests==2.31.0
Rtree==1.2.0
scikit-fmm==2023.4.2
shapely==2.0.4
urllib3==2.2.1

Copy link
Author

@JT8D-17 JT8D-17 May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is absoluttely necessary on Python 3.12 on Arch and one of the very reasons why I wrote the script in the first place.

@@ -0,0 +1,11 @@
certifi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on the thoughts of the developer/maintainer, I think it's best to version lock this and to replace the existing requirements file as otherwise both files will have to be maintained. This file will eventually fall out of sync as soon as a package makes a breaking change.

Copy link
Author

@JT8D-17 JT8D-17 May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm against version locking by default. If a package makes a breaking change, the particular requirement can still be version locked. Besides, I don't see no harm in two requirements files.

But I'm not trying to get the entire PR merged anyway. It's just here for Oscar's consideration and cherry picking changes.

w8sl added a commit to w8sl/Ortho4XP that referenced this pull request May 25, 2024
@w8sl
Copy link

w8sl commented May 29, 2024

scikit-fmm for python 3.12 has been released. Use: pip install scikit-fmm.
On macOS, Arch, Ubuntu 24 it is only possible in venv (tested), as global pip/pip3 install has been disabled with Python 12.

@w8sl
Copy link

w8sl commented May 30, 2024

If I understand correctly, it is still compiled from source - by pip install.

@JT8D-17
Copy link
Author

JT8D-17 commented May 31, 2024

Scikit-fmm installs from pip without issues for me now. I've updated the script and requirements accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants