Skip to content

Commit

Permalink
Merge pull request #545 from kubilus1/redep
Browse files Browse the repository at this point in the history
Update versions
  • Loading branch information
kubilus1 authored Oct 27, 2024
2 parents 1e81d5c + 6af4005 commit 93b41ec
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

- uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.12'

- name: Setup
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.12'

- name: Setup
run: |
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 \
Expand All @@ -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/ \
Expand All @@ -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/ \
Expand Down
8 changes: 4 additions & 4 deletions autoortho/autoortho_fuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 14 additions & 3 deletions autoortho/getortho.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,23 +261,32 @@ 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}",
"NAIP": f"http://naip.maptiles.arcgis.com/arcgis/rest/services/NAIP/MapServer/tile/{self.zoom}/{self.row}/{self.col}",
"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

Expand All @@ -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
Expand Down
22 changes: 12 additions & 10 deletions buildreqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements-build.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nuitka==1.6.6
nuitka==2.4.8
zstandard
ordered-set
6 changes: 3 additions & 3 deletions requirements-build.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
refuse
psutil
pysimplegui
pysimplegui<5.0.0
Flask
flask-socketio
eventlet
Expand Down
68 changes: 35 additions & 33 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 93b41ec

Please sign in to comment.