Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnisbet committed Oct 11, 2024
1 parent 5ec7c25 commit fc407a2
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 40 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ VERSION = `cat VERSION`
.PHONY: build run daemon test run-local black black-check update-requirements

build:
docker build --no-cache --tag opentopodata:$(VERSION) --file docker/Dockerfile .
docker build --tag opentopodata:$(VERSION) --file docker/Dockerfile .

build-m1:
docker build --tag opentopodata:$(VERSION) --file docker/apple-silicon.Dockerfile .

rebuild:
docker build --no-cache --tag opentopodata:$(VERSION) --file docker/Dockerfile .

rebuild-m1-no-cache:
docker build --tag opentopodata:$(VERSION) --file docker/apple-silicon.Dockerfile .

run:
docker run --rm -it --volume "$(shell pwd)/data:/app/data:ro" -p 5000:5000 opentopodata:$(VERSION)

Expand All @@ -23,10 +29,10 @@ run-local:
FLASK_APP=opentopodata/api.py FLASK_DEBUG=1 flask run --port 5000

black:
black --target-version py39 tests opentopodata
black --target-version py311 tests opentopodata

black-check:
docker run --rm opentopodata:$(VERSION) python -m black --check --target-version py39 tests opentopodata
docker run --rm opentopodata:$(VERSION) python -m black --check --target-version py311 tests opentopodata

update-requirements: build
# pip-compile gets confused if there's already a requirements.txt file, and
Expand Down
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Container for packages that need to be built from source but have massive dev dependencies.
FROM python:3.11.8-slim-bookworm as builder
FROM python:3.11.10-slim-bookworm as builder
RUN set -e && \
apt-get update && \
apt-get install -y --no-install-recommends \
gcc \
python3.11-dev

RUN pip config set global.disable-pip-version-check true && \
pip wheel --wheel-dir=/root/wheels uwsgi==2.0.20 && \
pip wheel --wheel-dir=/root/wheels regex==2023.12.25
pip wheel --wheel-dir=/root/wheels uwsgi==2.0.27 && \
pip wheel --wheel-dir=/root/wheels regex==2024.9.11

# The actual container.
FROM python:3.11.8-slim-bookworm
FROM python:3.11.10-slim-bookworm
RUN set -e && \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This is a list of changes to Open Topo Data between each release.

## Version 1.10.0 (11 Oct 2024)
* Minior dependency upgrades
*


## Version 1.9.0 (19 Feb 2024)
* Dependency upgrades, including python to 3.11 and rasterio to 1.3.9
Expand Down
8 changes: 7 additions & 1 deletion opentopodata/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ def _get_elevation_from_path(lats, lons, path, interpolation):
oob_indices = _validate_points_lie_within_raster(
xs, ys, lats, lons, f.bounds, f.res
)
rows, cols = tuple(f.index(xs, ys, op=_noop))
print(f"{xs=}")
print(f"{ys=}")
tmp = f.index(xs.tolist(), ys.tolist(), op=_noop)
print(f"{tmp=}")
rows, cols = tuple(tmp)

# rows, cols = tuple(f.index(xs, ys, op=_noop))

# Different versions of rasterio may or may not collapse single
# f.index() lookups into scalars. We want to always have an
Expand Down
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
black
Flask>=2.2.2 # Some flask 2.0 deprecations got real.
Flask>=2.2.2 # Flask 2.0 deprecations were enforced.
flask-caching
geographiclib
numpy
Expand All @@ -11,5 +11,5 @@ pytest
pytest-cov
pytest-timeout
PyYAML
rasterio>=1.3.8 # Avoid memory leak https://github.com/ajnisbet/opentopodata/issues/68
rasterio>=1.3.8,<1.4.0 # 1.3.8+ avoids memory leak https://github.com/ajnisbet/opentopodata/issues/68; 1.4.0 introduces some bugs in rowcol/xy (as of 2024-10-11).
requests
60 changes: 30 additions & 30 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
#
affine==2.4.0
# via rasterio
attrs==23.2.0
attrs==24.2.0
# via rasterio
black==24.2.0
black==24.10.0
# via -r requirements.in
blinker==1.7.0
blinker==1.8.2
# via flask
build==1.0.3
build==1.2.2.post1
# via pip-tools
cachelib==0.9.0
# via flask-caching
certifi==2024.2.2
certifi==2024.8.30
# via
# pyproj
# rasterio
# requests
charset-normalizer==3.3.2
charset-normalizer==3.4.0
# via requests
click==8.1.7
# via
Expand All @@ -35,82 +35,82 @@ click-plugins==1.1.1
# via rasterio
cligj==0.7.2
# via rasterio
coverage[toml]==7.4.1
coverage[toml]==7.6.2
# via pytest-cov
flask==3.0.2
flask==3.0.3
# via
# -r requirements.in
# flask-caching
flask-caching==2.1.0
flask-caching==2.3.0
# via -r requirements.in
geographiclib==2.0
# via -r requirements.in
idna==3.6
idna==3.10
# via requests
iniconfig==2.0.0
# via pytest
itsdangerous==2.1.2
itsdangerous==2.2.0
# via flask
jinja2==3.1.3
jinja2==3.1.4
# via flask
markupsafe==2.1.5
markupsafe==3.0.1
# via
# jinja2
# werkzeug
mypy-extensions==1.0.0
# via black
numpy==1.26.4
numpy==2.1.2
# via
# -r requirements.in
# rasterio
# snuggs
packaging==23.2
packaging==24.1
# via
# black
# build
# pytest
pathspec==0.12.1
# via black
pip-tools==7.4.0
pip-tools==7.4.1
# via -r requirements.in
platformdirs==4.2.0
platformdirs==4.3.6
# via black
pluggy==1.4.0
pluggy==1.5.0
# via pytest
polyline==2.0.2
# via -r requirements.in
pylibmc==1.6.3
# via -r requirements.in
pyparsing==3.1.1
pyparsing==3.1.4
# via snuggs
pyproj==3.6.1
pyproj==3.7.0
# via -r requirements.in
pyproject-hooks==1.0.0
pyproject-hooks==1.2.0
# via
# build
# pip-tools
pytest==8.0.1
pytest==8.3.3
# via
# -r requirements.in
# pytest-cov
# pytest-timeout
pytest-cov==4.1.0
pytest-cov==5.0.0
# via -r requirements.in
pytest-timeout==2.2.0
pytest-timeout==2.3.1
# via -r requirements.in
pyyaml==6.0.1
pyyaml==6.0.2
# via -r requirements.in
rasterio==1.3.9
rasterio==1.3.11
# via -r requirements.in
requests==2.31.0
requests==2.32.3
# via -r requirements.in
snuggs==1.4.7
# via rasterio
urllib3==2.2.1
urllib3==2.2.3
# via requests
werkzeug==3.0.1
werkzeug==3.0.4
# via flask
wheel==0.42.0
wheel==0.44.0
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
Expand Down

0 comments on commit fc407a2

Please sign in to comment.