From 6a94f0f68aa94c587c1fc102127cea71f615a57a Mon Sep 17 00:00:00 2001 From: Matt Kubilus Date: Sun, 20 Oct 2024 11:59:57 -0400 Subject: [PATCH 1/5] Bump vers --- Makefile | 4 +-- buildreqs.sh | 22 +++++++------- requirements-build.in | 2 +- requirements-build.txt | 6 ++-- requirements.in | 2 +- requirements.txt | 68 ++++++++++++++++++++++-------------------- 6 files changed, 54 insertions(+), 50 deletions(-) diff --git a/Makefile b/Makefile index c672c4b7..376b205d 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ autoortho.pyz: lin_bin: autoortho_lin_$(VERSION).bin autoortho_lin_$(VERSION).bin: autoortho/*.py - docker run --rm -v `pwd`:/code ubuntu:focal /bin/bash -c "cd /code; ./buildreqs.sh; time make bin VERSION=$(VERSION)" + docker run --rm -v `pwd`:/code ubuntu:jammy /bin/bash -c "cd /code; ./buildreqs.sh; time make bin VERSION=$(VERSION)" mv autoortho_lin.bin $@ enter: @@ -19,7 +19,7 @@ autoortho/.version: echo "$(VERSION)" > $@ bin: autoortho/.version - python3.10 -m nuitka --verbose --verbose-output=nuitka.log \ + python3 -m nuitka --verbose --verbose-output=nuitka.log \ --linux-icon=autoortho/imgs/ao-icon.ico \ --enable-plugin=tk-inter \ --enable-plugin=eventlet \ diff --git a/buildreqs.sh b/buildreqs.sh index 7784aed8..8a192ac1 100755 --- a/buildreqs.sh +++ b/buildreqs.sh @@ -3,16 +3,18 @@ export DEBIAN_FRONTEND=noninteractive export TZ=America/New_York +#apt-get update +#apt-get install software-properties-common -y +#add-apt-repository ppa:deadsnakes/ppa -y apt-get update -apt-get install software-properties-common -y -add-apt-repository ppa:deadsnakes/ppa -y -apt-get update -apt-get install -y make curl patchelf python3.10 python3.10-tk zlib1g-dev \ - ccache python3.10-distutils python3.10-dev libjpeg-dev libturbojpeg0-dev build-essential +#apt-get install -y make curl patchelf python3.10 python3.10-tk zlib1g-dev \ +# ccache python3.10-distutils python3.10-dev libjpeg-dev libturbojpeg0-dev build-essential +apt-get install -y make curl patchelf python3-pip python3-tk zlib1g-dev \ + ccache python3-distutils python3-dev libjpeg-dev libturbojpeg0-dev build-essential -curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 +#curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 -python3.10 -m pip install -U pip -python3.10 -m pip install setuptools -python3.10 -m pip install -r requirements-build.txt --no-use-pep517 -python3.10 -m pip install -r requirements.txt +python3 -m pip install -U pip +python3 -m pip install setuptools +python3 -m pip install -r requirements-build.txt --no-use-pep517 +python3 -m pip install -r requirements.txt diff --git a/requirements-build.in b/requirements-build.in index 86df3f38..81bf5380 100644 --- a/requirements-build.in +++ b/requirements-build.in @@ -1,3 +1,3 @@ -nuitka==1.6.6 +nuitka==2.4.8 zstandard ordered-set diff --git a/requirements-build.txt b/requirements-build.txt index 52e9ad72..6af1055e 100644 --- a/requirements-build.txt +++ b/requirements-build.txt @@ -1,10 +1,10 @@ # -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: # # pip-compile requirements-build.in # -nuitka==1.6.6 +nuitka==2.4.8 # via -r requirements-build.in ordered-set==4.1.0 # via diff --git a/requirements.in b/requirements.in index 602f6b2c..0f2b9256 100644 --- a/requirements.in +++ b/requirements.in @@ -1,6 +1,6 @@ refuse psutil -pysimplegui +pysimplegui<5.0.0 Flask flask-socketio eventlet diff --git a/requirements.txt b/requirements.txt index e689829f..561eff87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,82 +1,84 @@ # -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: # # pip-compile requirements.in # -bidict==0.22.1 +bidict==0.23.1 # via python-socketio -certifi==2023.7.22 +blinker==1.8.2 + # via flask +certifi==2024.8.30 # via requests -charset-normalizer==3.2.0 +charset-normalizer==3.3.2 # via requests -click==8.1.3 +click==8.1.7 # via # flask # geocoder decorator==5.1.1 # via ratelim -dnspython==2.3.0 +dnspython==2.6.1 # via eventlet -eventlet==0.33.3 +eventlet==0.37.0 # via -r requirements.in -exceptiongroup==1.1.3 - # via pytest -flask==2.2.2 +flask==3.0.3 # via # -r requirements.in # flask-socketio -flask-socketio==5.3.4 +flask-socketio==5.3.7 # via -r requirements.in -future==0.18.3 +future==1.0.0 # via geocoder geocoder==1.38.1 # via -r requirements.in -greenlet==2.0.2 +greenlet==3.1.1 # via eventlet -idna==3.4 +h11==0.14.0 + # via wsproto +idna==3.10 # via requests iniconfig==2.0.0 # via pytest -itsdangerous==2.1.2 +itsdangerous==2.2.0 # via flask -jinja2==3.1.2 +jinja2==3.1.4 # via flask -markupsafe==2.1.1 +markupsafe==2.1.5 # via # jinja2 # werkzeug -packaging==23.1 +packaging==24.1 # via # -r requirements.in # pytest -pluggy==1.2.0 +pluggy==1.5.0 # via pytest -psutil==5.9.2 +psutil==6.0.0 # via -r requirements.in -pysimplegui==4.60.4 +pysimplegui==4.70.1 # via -r requirements.in -pytest==7.4.0 +pytest==8.3.3 # via -r requirements.in -python-engineio==4.4.1 +python-engineio==4.9.1 # via python-socketio -python-socketio==5.8.0 +python-socketio==5.11.4 # via flask-socketio ratelim==0.1.6 # via geocoder refuse==0.0.4 # via -r requirements.in -requests==2.31.0 +requests==2.32.3 # via # -r requirements.in # geocoder +simple-websocket==1.0.0 + # via python-engineio six==1.16.0 - # via - # eventlet - # geocoder -tomli==2.0.1 - # via pytest -urllib3==2.0.4 + # via geocoder +urllib3==2.2.3 # via requests -werkzeug==2.2.2 +werkzeug==3.0.4 # via flask +wsproto==1.2.0 + # via simple-websocket From 5e5d1d748c87bbaf789d3ee546e87fd477ce8acf Mon Sep 17 00:00:00 2001 From: Matt Kubilus Date: Sun, 20 Oct 2024 12:05:53 -0400 Subject: [PATCH 2/5] Up py ver --- .github/workflows/build_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index dbee89a3..fd389d3d 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -69,7 +69,7 @@ jobs: - uses: actions/setup-python@v3 with: - python-version: '3.10' + python-version: '3.12' - name: Setup run: | From 4613a784b8cf3905d2eed6b6deff7ece0abfbaf6 Mon Sep 17 00:00:00 2001 From: Matt Kubilus Date: Sun, 20 Oct 2024 12:12:59 -0400 Subject: [PATCH 3/5] Avoid '.' --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 376b205d..e3bbaa65 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ _autoortho_win.exe: autoortho/.version --enable-plugin=eventlet \ --windows-icon-from-ico=autoortho/imgs/ao-icon.ico \ --assume-yes-for-downloads \ - --include-data-file=./autoortho/.version*=. \ + --include-data-file=./autoortho/.version*=./ \ --include-data-file=./autoortho/templates/*.html=templates/ \ --include-data-file=./autoortho/lib/windows/*=lib/windows/ \ --include-data-file=./autoortho/aoimage/*.dll=aoimage/ \ @@ -56,7 +56,7 @@ __main__.dist: autoortho/.version --enable-plugin=eventlet \ --windows-icon-from-ico=autoortho/imgs/ao-icon.ico \ --assume-yes-for-downloads \ - --include-data-file=./autoortho/.version*=. \ + --include-data-file=./autoortho/.version*=./ \ --include-data-file=./autoortho/templates/*.html=templates/ \ --include-data-file=./autoortho/lib/windows/*=lib/windows/ \ --include-data-file=./autoortho/aoimage/*.dll=aoimage/ \ From 4e353dce6f38ea3e858ee0f6fcae0eace3212702 Mon Sep 17 00:00:00 2001 From: Matt Kubilus Date: Sat, 26 Oct 2024 16:44:59 -0400 Subject: [PATCH 4/5] Fix tests --- autoortho/autoortho_fuse.py | 8 ++++---- autoortho/getortho.py | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/autoortho/autoortho_fuse.py b/autoortho/autoortho_fuse.py index 3f518cd4..12b66f56 100644 --- a/autoortho/autoortho_fuse.py +++ b/autoortho/autoortho_fuse.py @@ -82,10 +82,10 @@ class AutoOrtho(Operations): def __init__(self, root, cache_dir='.cache'): log.info(f"ROOT: {root}") - self.dds_re = re.compile(".*/(\d+)[-_](\d+)[-_]((?!ZL)\S*)(\d{2}).dds") - self.ktx2_re = re.compile(".*/(\d+)[-_](\d+)[-_]((?!ZL)\D*)(\d+).ktx2") - self.dsf_re = re.compile(".*/[-+]\d+[-+]\d+.dsf") - self.ter_re = re.compile(".*/\d+[-_]\d+[-_](\D*)(\d+).ter") + self.dds_re = re.compile(r".*/(\d+)[-_](\d+)[-_]((?!ZL)\S*)(\d{2}).dds") + self.ktx2_re = re.compile(r".*/(\d+)[-_](\d+)[-_]((?!ZL)\D*)(\d+).ktx2") + self.dsf_re = re.compile(r".*/[-+]\d+[-+]\d+.dsf") + self.ter_re = re.compile(r".*/\d+[-_]\d+[-_](\D*)(\d+).ter") self.root = os.path.abspath(root) self.cache_dir = cache_dir diff --git a/autoortho/getortho.py b/autoortho/getortho.py index 76072b42..5e27f4be 100644 --- a/autoortho/getortho.py +++ b/autoortho/getortho.py @@ -261,10 +261,10 @@ def get(self, idx=0, session=requests): # Hack override maptype #maptype = "ARC" - MAPID = "s2cloudless-2020_3857" + MAPID = "s2cloudless-2023_3857" MATRIXSET = "g" MAPTYPES = { - "EOX": f"https://{server}.s2maps-tiles.eu/wmts/?layer={MAPID}&style=default&tilematrixset={MATRIXSET}&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix={self.zoom}&TileCol={self.col}&TileRow={self.row}", + "EOX": f"https://{server}.s2maps-tiles.eu/wmts?layer={MAPID}&style=default&tilematrixset={MATRIXSET}&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix={self.zoom}&TileCol={self.col}&TileRow={self.row}", "BI": f"https://ecn.t{server_num}.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=13816", "GO2": f"http://khms{server_num}.google.com/kh/v=934?x={self.col}&y={self.row}&z={self.zoom}", "ARC": f"http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{self.zoom}/{self.row}/{self.col}", @@ -272,12 +272,21 @@ def get(self, idx=0, session=requests): "USGS": f"https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{self.zoom}/{self.row}/{self.col}", "FIREFLY": f"https://fly.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Firefly/MapServer/tile/{self.zoom}/{self.row}/{self.col}" } + + + #if self.maptype.upper() == "EOX": + # session.headers.update({'referer': 'https://s2maps.eu/'}) + + self.url = MAPTYPES[self.maptype.upper()] #log.debug(f"{self} getting {url}") header = { "user-agent": "curl/7.68.0" } - + if self.maptype.upper() == "EOX": + log.info("EOX DETECTED") + header.update({'referer': 'https://s2maps.eu/'}) + time.sleep((self.attempt/10)) self.attempt += 1 @@ -288,6 +297,8 @@ def get(self, idx=0, session=requests): resp = 0 try: if use_requests: + # FIXME: Not the best way to set headers + session.headers = header #resp = session.get(self.url, stream=True) resp = session.get(self.url) status_code = resp.status_code From 6af4005601fc98bae3d84df88c9fa40dc00a696b Mon Sep 17 00:00:00 2001 From: Matt Kubilus Date: Sun, 27 Oct 2024 11:36:03 -0400 Subject: [PATCH 5/5] py 3.12 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ebc6071..3cab9225 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/setup-python@v3 with: - python-version: '3.10' + python-version: '3.12' - name: Setup run: |