From cb518912edf783cab4070c27cca1c079ce811f09 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 17:04:06 +0000 Subject: [PATCH 01/25] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.3.7 → v0.4.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.7...v0.4.3) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b942eca9..b5f943f6b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.7 + rev: v0.4.3 hooks: - id: ruff args: [--fix, --show-fixes, --output-format, grouped] From 3397464ab84235f3cd370106292a5f0b8294288d Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Tue, 9 Apr 2024 13:21:18 +0200 Subject: [PATCH 02/25] Update to setuptools>=61 I don't know anything about setuptools_scm, but a failed CI run output this in the log: ERROR: setuptools==59.6.0 is used in combination with setuptools_scm>=8.x Your build configuration is incomplete and previously worked by accident! setuptools_scm requires setuptools>=61 Suggested workaround if applicable: - migrating from the deprecated setup_requires mechanism to pep517/518 and using a pyproject.toml to declare build dependencies which are reliably pre-installed before running the build tools so require setuptools>=61 and setuptools_scm >=8. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1cfdaeba6..62f024e4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] +requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=8"] [tool.setuptools_scm] write_to = "cubedash/_version.py" From 441c2efebe86cfdc538f6a33da39bfb27c8d215a Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Mon, 8 Apr 2024 22:18:02 +0200 Subject: [PATCH 03/25] Dockerfile: remove git after use I shifted some things around to simplify before pushing, but missed that the check on ENVIRONMENT ended up before the declaration of the argument. Even the deployment container needs git since setuptools_scm requires it, so remove git and git-man after the installation has completed. This avoids CVE-2018-1000021. --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b2e26b482..a4c897d8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,18 +28,17 @@ ENV DEBIAN_FRONTEND=noninteractive \ PYTHONFAULTHANDLER=1 # Apt installation +# git: required by setuptools_scm. RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ + git \ # For Psycopg2 libpq5 \ tini \ postgresql-client \ python3-pip \ - && ([ "$ENVIRONMENT" = "deployment" ] || \ - apt-get install -y --no-install-recommends \ - git) && \ - apt-get autoclean && \ + && apt-get autoclean && \ apt-get autoremove && \ rm -rf /var/lib/{apt,dpkg,cache,log} @@ -73,6 +72,8 @@ RUN if [ "$ENVIRONMENT" = "deployment" ] ; then\ pip freeze && \ ([ "$ENVIRONMENT" != "deployment" ] || \ apt-get remove -y \ + git \ + git-man \ python3-pip) ENTRYPOINT ["/bin/tini", "--"] From ecb03f40a6d6f07f0c1e7f84f88ad7b5fbecf372 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 17:01:57 +0000 Subject: [PATCH 04/25] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.3 → v0.4.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.3...v0.4.4) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b5f943f6b..2fdc14b42 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.3 + rev: v0.4.4 hooks: - id: ruff args: [--fix, --show-fixes, --output-format, grouped] From a90072bcaf1dc3e248ca910a7dcb0eeed2c5905a Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Thu, 16 May 2024 06:51:25 +0000 Subject: [PATCH 05/25] restrict search to indexed fields --- cubedash/_filters.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cubedash/_filters.py b/cubedash/_filters.py index f9182a834..6f245f8a4 100644 --- a/cubedash/_filters.py +++ b/cubedash/_filters.py @@ -11,7 +11,7 @@ import flask import pytz from datacube.index.fields import Field -from datacube.model import Dataset, DatasetType, Range +from datacube.model import Dataset, Product, Range from dateutil import tz from flask import Blueprint from markupsafe import Markup, escape @@ -226,7 +226,7 @@ def _max_val(ls): @bp.app_template_filter("product_license_link") -def _product_license(product: DatasetType): +def _product_license(product: Product): license_ = _utils.product_license(product) if license_ is None: @@ -244,7 +244,7 @@ def _product_license(product: DatasetType): @bp.app_template_filter("searchable_fields") -def _searchable_fields(product: DatasetType): +def _searchable_fields(product: Product): """Searchable field names for a product""" # No point searching fields that are fixed for this product @@ -254,12 +254,12 @@ def _searchable_fields(product: DatasetType): return sorted( (key, field) for key, field in product.metadata_type.dataset_fields.items() - if key not in skippable_product_keys and key != "product" + if key not in skippable_product_keys and key != "product" and field.indexed ) @bp.app_template_filter("searchable_fields_keys") -def _searchable_fields_keys(product: DatasetType): +def _searchable_fields_keys(product: Product): """List of keys of searchable field names for a product""" fields = _searchable_fields(product) return [k for k, _ in fields] From 714eee209c91f378c150d0e7343656564d7c7718 Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Fri, 17 May 2024 06:39:33 +0000 Subject: [PATCH 06/25] update searchable fields in mdtype for consistency --- cubedash/templates/metadata-type.html | 47 ++++++--- docs/rtd-requirements.txt | 138 ++++++++++++++------------ integration_tests/test_page_loads.py | 10 +- 3 files changed, 110 insertions(+), 85 deletions(-) diff --git a/cubedash/templates/metadata-type.html b/cubedash/templates/metadata-type.html index 349086c93..a4d6f0c42 100644 --- a/cubedash/templates/metadata-type.html +++ b/cubedash/templates/metadata-type.html @@ -46,19 +46,42 @@

+ + + +
+

+ Additional Fields + {{ hanchor('additional-fields') }} +

+
diff --git a/docs/rtd-requirements.txt b/docs/rtd-requirements.txt index 86485c7c0..2ee35ac4e 100644 --- a/docs/rtd-requirements.txt +++ b/docs/rtd-requirements.txt @@ -1,41 +1,43 @@ # -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: # # pip-compile setup.py # -affine==2.3.1 +affine==2.4.0 # via # datacube # eodatasets3 # rasterio -attrs==22.1.0 +attrs==22.2.0 # via # cattrs + # datacube # eodatasets3 # fiona # jsonschema # rasterio + # referencing blinker==1.5 # via sentry-sdk boltons==21.0.0 # via eodatasets3 -boto3==1.26.2 +boto3==1.26.62 # via eodatasets3 -botocore==1.29.2 +botocore==1.29.62 # via # boto3 # eodatasets3 # s3transfer cachelib==0.9.0 # via flask-caching -cachetools==5.2.0 +cachetools==5.3.0 # via # datacube # datacube-explorer (setup.py) cattrs==22.2.0 # via eodatasets3 -certifi==2022.9.24 +certifi==2022.12.7 # via # fiona # pyproj @@ -44,9 +46,9 @@ certifi==2022.9.24 # sentry-sdk cftime==1.6.2 # via netcdf4 -charset-normalizer==2.1.1 +charset-normalizer==3.0.1 # via requests -ciso8601==2.2.0 +ciso8601==2.3.0 # via eodatasets3 click==8.1.3 # via @@ -68,29 +70,29 @@ cligj==0.7.2 # via # fiona # rasterio -cloudpickle==2.2.0 +cloudpickle==2.2.1 # via # dask # datacube # distributed -dask[array]==2022.10.2 +dask[array]==2023.1.1 # via # datacube # distributed -datacube==1.8.6 +datacube==1.8.10 # via # datacube-explorer (setup.py) # eodatasets3 defusedxml==0.7.1 # via eodatasets3 -distributed==2022.10.2 +distributed==2023.1.1 # via datacube -eodatasets3==0.29.5 - # via datacube-explorer (setup.py) -exceptiongroup==1.0.0 - # via cattrs -fiona==1.8.22 +eodatasets3==0.30.1 # via datacube-explorer (setup.py) +fiona==1.9.0 + # via + # datacube-explorer (setup.py) + # eodatasets3 flask==2.1.3 # via # datacube-explorer (setup.py) @@ -98,28 +100,28 @@ flask==2.1.3 # flask-cors # flask-themer # sentry-sdk -flask-caching==2.0.1 +flask-caching==2.0.2 # via datacube-explorer (setup.py) flask-cors==3.0.10 # via datacube-explorer (setup.py) flask-themer==1.4.3 # via datacube-explorer (setup.py) -fsspec==2022.10.0 +fsspec==2023.1.0 # via dask -geoalchemy2==0.12.5 - # via datacube-explorer (setup.py) +geoalchemy2==0.13.1 + # via + # datacube + # datacube-explorer (setup.py) geographiclib==2.0 # via datacube-explorer (setup.py) -greenlet==2.0.0.post0 +greenlet==2.0.2 # via sqlalchemy +h5py==3.10.0 + # via eodatasets3 heapdict==1.0.1 # via zict idna==3.4 # via requests -importlib-metadata==5.0.0 - # via flask -importlib-resources==5.10.0 - # via jsonschema itsdangerous==2.1.2 # via flask jinja2==3.1.2 @@ -131,17 +133,19 @@ jmespath==1.0.1 # via # boto3 # botocore -jsonschema==4.17.0 +jsonschema==4.20.0 # via # datacube # eodatasets3 -lark-parser==0.12.0 +jsonschema-specifications==2023.12.1 + # via jsonschema +lark==0.12.0 # via datacube locket==1.0.0 # via # distributed # partd -markupsafe==2.1.1 +markupsafe==2.1.2 # via # datacube-explorer (setup.py) # jinja2 @@ -150,56 +154,55 @@ msgpack==1.0.4 # via distributed munch==2.5.0 # via fiona -netcdf4==1.6.1 +netcdf4==1.6.2 # via datacube -numpy==1.23.4 +numpy==1.24.1 # via # cftime # dask # datacube # eodatasets3 + # h5py # netcdf4 # pandas # pyorbital # rasterio # scipy + # shapely # snuggs # xarray -orjson==3.8.1 +orjson==3.8.5 # via datacube-explorer (setup.py) -packaging==21.3 +packaging==23.0 # via # dask + # datacube # distributed # geoalchemy2 # xarray -pandas==1.5.1 +pandas==1.5.3 # via # datacube # xarray partd==1.3.0 # via dask -pkgutil-resolve-name==1.3.10 - # via jsonschema -psutil==5.9.3 +psutil==5.9.4 # via distributed psycopg2==2.9.5 # via datacube pyorbital==1.7.3 # via datacube-explorer (setup.py) pyparsing==3.0.9 - # via - # packaging - # snuggs -pyproj==3.4.0 + # via snuggs +pyproj==3.4.1 # via # datacube # datacube-explorer (setup.py) # eodatasets3 -pyrsistent==0.19.2 - # via jsonschema -pystac==1.6.1 - # via eodatasets3 +pystac==1.9.0 + # via + # datacube-explorer (setup.py) + # eodatasets3 python-dateutil==2.8.2 # via # botocore @@ -209,7 +212,7 @@ python-dateutil==2.8.2 # pystac python-rapidjson==1.9 # via eodatasets3 -pytz==2022.6 +pytz==2022.7.1 # via # datacube-explorer (setup.py) # pandas @@ -218,25 +221,33 @@ pyyaml==6.0 # dask # datacube # distributed -rasterio==1.3.3 +rasterio==1.3.5 # via # datacube # eodatasets3 -requests==2.28.1 +referencing==0.32.0 + # via + # jsonschema + # jsonschema-specifications +requests==2.28.2 # via pyorbital +rpds-py==0.16.2 + # via + # jsonschema + # referencing ruamel-yaml==0.17.21 - # via eodatasets3 -ruamel-yaml-clib==0.2.7 - # via ruamel-yaml + # via + # datacube + # eodatasets3 s3transfer==0.6.0 # via boto3 -scipy==1.9.3 +scipy==1.10.0 # via # eodatasets3 # pyorbital -sentry-sdk[flask]==1.10.1 +sentry-sdk[flask]==1.14.0 # via datacube-explorer (setup.py) -shapely==1.8.5.post1 +shapely==2.0.1 # via # datacube # datacube-explorer (setup.py) @@ -245,7 +256,6 @@ simplekml==1.3.6 # via datacube-explorer (setup.py) six==1.16.0 # via - # fiona # flask-cors # munch # python-dateutil @@ -253,12 +263,12 @@ snuggs==1.4.7 # via rasterio sortedcontainers==2.4.0 # via distributed -sqlalchemy==1.4.42 +sqlalchemy==1.4.46 # via # datacube # datacube-explorer (setup.py) # geoalchemy2 -structlog==22.1.0 +structlog==22.3.0 # via # datacube-explorer (setup.py) # eodatasets3 @@ -270,9 +280,9 @@ toolz==0.12.0 # datacube # distributed # partd -tornado==6.1 +tornado==6.2 # via distributed -urllib3==1.26.12 +urllib3==1.26.14 # via # botocore # distributed @@ -280,16 +290,12 @@ urllib3==1.26.12 # sentry-sdk werkzeug==2.2.2 # via flask -xarray==2022.10.0 +xarray==2023.1.0 # via # datacube # eodatasets3 zict==2.2.0 # via distributed -zipp==3.10.0 - # via - # importlib-metadata - # importlib-resources # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/integration_tests/test_page_loads.py b/integration_tests/test_page_loads.py index c4f4ebe3d..744718f44 100644 --- a/integration_tests/test_page_loads.py +++ b/integration_tests/test_page_loads.py @@ -525,13 +525,9 @@ def test_search_time_completion(client: FlaskClient): assert len(search_results) == 4 # if not provided as a span, it should become a span of one day - html = get_html(client, "/datasets/ga_ls8c_ard_3?creation_time=2022-02-14") - assert ( - one_element(html, "#search-creation_time-before").attrs["value"] == "2022-02-14" - ) - assert ( - one_element(html, "#search-creation_time-after").attrs["value"] == "2022-02-15" - ) + html = get_html(client, "/datasets/ga_ls8c_ard_3?time=2022-02-14") + assert one_element(html, "#search-time-before").attrs["value"] == "2022-02-14" + assert one_element(html, "#search-time-after").attrs["value"] == "2022-02-15" search_results = html.find(".search-result a") assert len(search_results) == 2 From 6173d9245bb3041a11421e3c89a08c11202b8c4f Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Tue, 21 May 2024 07:52:33 +0000 Subject: [PATCH 07/25] fix test --- integration_tests/test_page_loads.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration_tests/test_page_loads.py b/integration_tests/test_page_loads.py index 744718f44..1e92f2c14 100644 --- a/integration_tests/test_page_loads.py +++ b/integration_tests/test_page_loads.py @@ -525,9 +525,9 @@ def test_search_time_completion(client: FlaskClient): assert len(search_results) == 4 # if not provided as a span, it should become a span of one day - html = get_html(client, "/datasets/ga_ls8c_ard_3?time=2022-02-14") - assert one_element(html, "#search-time-before").attrs["value"] == "2022-02-14" - assert one_element(html, "#search-time-after").attrs["value"] == "2022-02-15" + html = get_html(client, "/datasets/ga_ls8c_ard_3?time=2022-07-18") + assert one_element(html, "#search-time-before").attrs["value"] == "2022-07-18" + assert one_element(html, "#search-time-after").attrs["value"] == "2022-07-18" search_results = html.find(".search-result a") assert len(search_results) == 2 From 6aa640635f31b81c53ffe8b89e5a774ca7be8c10 Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Tue, 21 May 2024 08:03:02 +0000 Subject: [PATCH 08/25] actually fix test --- cubedash/testutils/database.py | 2 +- integration_tests/test_page_loads.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cubedash/testutils/database.py b/cubedash/testutils/database.py index 8fb3b537c..aa35ff22b 100644 --- a/cubedash/testutils/database.py +++ b/cubedash/testutils/database.py @@ -40,7 +40,7 @@ def postgresql_server(): else: client = docker.from_env() container = client.containers.run( - "postgis/postgis:14-3.3-alpine", + "postgis/postgis:16-3.4", auto_remove=True, remove=True, detach=True, diff --git a/integration_tests/test_page_loads.py b/integration_tests/test_page_loads.py index 1e92f2c14..0ddc95f9b 100644 --- a/integration_tests/test_page_loads.py +++ b/integration_tests/test_page_loads.py @@ -527,7 +527,7 @@ def test_search_time_completion(client: FlaskClient): # if not provided as a span, it should become a span of one day html = get_html(client, "/datasets/ga_ls8c_ard_3?time=2022-07-18") assert one_element(html, "#search-time-before").attrs["value"] == "2022-07-18" - assert one_element(html, "#search-time-after").attrs["value"] == "2022-07-18" + assert one_element(html, "#search-time-after").attrs["value"] == "2022-07-19" search_results = html.find(".search-result a") assert len(search_results) == 2 From 7f62a9fc017dee5d2fcc992cdfdb61ce6d0eaebc Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 02:34:25 +0000 Subject: [PATCH 09/25] update reqs --- docs/rtd-requirements.txt | 6 +++++- setup.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/rtd-requirements.txt b/docs/rtd-requirements.txt index 2ee35ac4e..3de1a536a 100644 --- a/docs/rtd-requirements.txt +++ b/docs/rtd-requirements.txt @@ -79,12 +79,14 @@ dask[array]==2023.1.1 # via # datacube # distributed -datacube==1.8.10 +datacube==1.8.18 # via # datacube-explorer (setup.py) # eodatasets3 defusedxml==0.7.1 # via eodatasets3 +deprecat==2.1.1 + # via datacube distributed==2023.1.1 # via datacube eodatasets3==0.30.1 @@ -290,6 +292,8 @@ urllib3==1.26.14 # sentry-sdk werkzeug==2.2.2 # via flask +wrapt==1.16.0 + # via deprecat xarray==2023.1.0 # via # datacube diff --git a/setup.py b/setup.py index f893df8b5..a6b7d4253 100755 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ install_requires=[ "cachetools", "click", - "datacube>=1.8.10", + "datacube>=1.8.18", "eodatasets3>=0.30.1", "fiona", "flask", From 33cb6e793f03a870e101b2edef75712a090be746 Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 02:52:09 +0000 Subject: [PATCH 10/25] bump min python version --- pyproject.toml | 2 +- setup.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 62f024e4a..58930e1cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ write_to = "cubedash/_version.py" [tool.black] line-length = 88 -target_version = ['py36', 'py37', 'py38'] +target_version = ['py39', 'py310', 'py311', 'py312'] include = '\.pyi?$' exclude = ''' /( diff --git a/setup.py b/setup.py index a6b7d4253..308b79898 100755 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ long_description_content_type="text/markdown", use_scm_version=True, setup_requires=["setuptools_scm"], - python_requires=">=3.7", + python_requires=">=3.9", url="https://github.com/opendatacube/datacube-explorer", author="Geoscience Australia", author_email="earth.observation@ga.gov.au", @@ -64,8 +64,10 @@ classifiers=[ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", ], include_package_data=True, From 562728f96ceac580aac5edebf8d09aa5fc9d411e Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 03:56:41 +0000 Subject: [PATCH 11/25] update rtd build details --- .readthedocs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index fbf2cbae9..cc64abe2a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,9 +1,9 @@ --- version: 2 build: - os: ubuntu-20.04 + os: ubuntu-22.04 tools: - python: "3.8" + python: "3.9" apt_packages: - libgdal-dev - gdal-bin From 44d4805b425a1327436c1cc63c7d9fa982077cc4 Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 03:58:28 +0000 Subject: [PATCH 12/25] bump docker postgres image --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8fc7e9510..c37ee54b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: - postgres postgres: - image: postgis/postgis:13-3.4 + image: postgis/postgis:16-3.4 hostname: postgres environment: - POSTGRES_DB=opendatacube From 23c204f9d77fa95750f61233dd06827788acc04d Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 04:07:02 +0000 Subject: [PATCH 13/25] bump sphinx version --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 41a209a1c..80c5ac579 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,6 +2,6 @@ autodocsumm==0.2.9 beautifulsoup4==4.11.0 nbsphinx==0.8.9 pydata-sphinx-theme==0.9.0 -Sphinx==4.5.0 +Sphinx==7.2.7 sphinx-autodoc-typehints==1.19.0 sphinx-click==4.2.0 From 24c7d86cac0061518ae3cb29a28b935ea2b4b675 Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 04:10:19 +0000 Subject: [PATCH 14/25] bump sphinx version --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 80c5ac579..86d779138 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,6 +2,6 @@ autodocsumm==0.2.9 beautifulsoup4==4.11.0 nbsphinx==0.8.9 pydata-sphinx-theme==0.9.0 -Sphinx==7.2.7 +Sphinx==7.3.7 sphinx-autodoc-typehints==1.19.0 sphinx-click==4.2.0 From 36bd0f6dc35ac547a70822af2315612a190aa464 Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 04:19:08 +0000 Subject: [PATCH 15/25] bump other rtd reqs --- docs/requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 86d779138..2b34df397 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ -autodocsumm==0.2.9 -beautifulsoup4==4.11.0 -nbsphinx==0.8.9 -pydata-sphinx-theme==0.9.0 +autodocsumm==0.2.12 +beautifulsoup4==4.12.3 +nbsphinx==0.9.4 +pydata-sphinx-theme==0.15.2 Sphinx==7.3.7 -sphinx-autodoc-typehints==1.19.0 -sphinx-click==4.2.0 +sphinx-autodoc-typehints==2.1.0 +sphinx-click==6.0.0 From b66db9461640acee3d3e1edfad076ca78f59f11c Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 04:30:16 +0000 Subject: [PATCH 16/25] hopefully resolve deps --- docs/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 2b34df397..20a310754 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,6 +2,6 @@ autodocsumm==0.2.12 beautifulsoup4==4.12.3 nbsphinx==0.9.4 pydata-sphinx-theme==0.15.2 -Sphinx==7.3.7 -sphinx-autodoc-typehints==2.1.0 +Sphinx==5.0.0 +sphinx-autodoc-typehints==1.19.0 sphinx-click==6.0.0 From 9a8685ba958b52638eda21d9db9933b89af35900 Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 05:07:10 +0000 Subject: [PATCH 17/25] try rtd with python 3.10 --- .readthedocs.yaml | 2 +- docs/requirements.txt | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index cc64abe2a..4f58331cc 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.9" + python: "3.10" apt_packages: - libgdal-dev - gdal-bin diff --git a/docs/requirements.txt b/docs/requirements.txt index 20a310754..41a209a1c 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ -autodocsumm==0.2.12 -beautifulsoup4==4.12.3 -nbsphinx==0.9.4 -pydata-sphinx-theme==0.15.2 -Sphinx==5.0.0 +autodocsumm==0.2.9 +beautifulsoup4==4.11.0 +nbsphinx==0.8.9 +pydata-sphinx-theme==0.9.0 +Sphinx==4.5.0 sphinx-autodoc-typehints==1.19.0 -sphinx-click==6.0.0 +sphinx-click==4.2.0 From 1c597babf5e4e500460625d73e854cd42d08458a Mon Sep 17 00:00:00 2001 From: Ariana Barzinpour Date: Wed, 22 May 2024 05:17:24 +0000 Subject: [PATCH 18/25] sphinx 5.0 --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 41a209a1c..7c3a31aae 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,6 +2,6 @@ autodocsumm==0.2.9 beautifulsoup4==4.11.0 nbsphinx==0.8.9 pydata-sphinx-theme==0.9.0 -Sphinx==4.5.0 +Sphinx==5.0.0 sphinx-autodoc-typehints==1.19.0 sphinx-click==4.2.0 From a098eda88e73d69dc087beff98c57b960fc50c56 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sat, 11 May 2024 11:59:48 +0200 Subject: [PATCH 19/25] Add .dockerignore This avoids bringing in various local files into the docker build context, so the docker cache will be tainted less often, improving the performance of image rebuilds. If the docker cache gets in the way, one can still use docker build --no-cache. --- .dockerignore | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..5bfc93d2f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,43 @@ +# Byte-compiled / optimized / DLL files +**/__pycache__/ +**/.pytest_cache/ + +# Unit test / coverage reports +**/htmlcov/ +**/.tox/ +**/.coverage +**/.coverage.* +**/.cache +**/nosetests.xml +**/coverage.xml +**/*.cover +**/.hypothesis + +# Translations +**/*.mo +**/*.pot + +# Django stuff: +**/*.log + +# Sphinx documentation +**/docs/_build/ + +# PyBuilder +**/target/ +**/.idea/ + +# iPython Notebook +**/.ipynb_checkpoints + +# Mac OS X +**/.DS_Store + +# Environment-specific templates +**/*.env.html +**/settings.env.py + +# Ignore vscode +**/.vscode + +.dockerignore From 9d9a1636464ceb20405ccb4d06ad36846790dab5 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sat, 11 May 2024 12:02:43 +0200 Subject: [PATCH 20/25] gitignore: fix typo The comma looks like it is meant to be a period. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 88f46bb98..be5ba52a0 100644 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,7 @@ htmlcov/ .cache nosetests.xml coverage.xml -*,cover +*.cover .hypothesis # Translations From 7f74dfe9890d54b3f6645bbb5fa5808d2d7d4ac9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 17:02:24 +0000 Subject: [PATCH 21/25] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.4.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.4...v0.4.5) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2fdc14b42..46eebaca4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.4 + rev: v0.4.5 hooks: - id: ruff args: [--fix, --show-fixes, --output-format, grouped] From d438c484a2f6d651e3afb8642ec813579af233db Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:05:33 +0000 Subject: [PATCH 22/25] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.5 → v0.4.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.5...v0.4.8) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46eebaca4..d4ee6f433 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.5 + rev: v0.4.8 hooks: - id: ruff args: [--fix, --show-fixes, --output-format, grouped] From 60d364348711350def1e5cfe37e6a6971a7bed7d Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sat, 11 May 2024 11:29:51 +0200 Subject: [PATCH 23/25] Dockerfile: merge two layers Combine the RUN statements into a single statement. The Docker cache behavior remains the same, but there is one layer less in the produced image. --- Dockerfile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index a4c897d8f..fde29b0a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,11 @@ ENV DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ PYTHONFAULTHANDLER=1 +# Environment can be whatever is supported by setup.py +# so, either deployment, test +ARG ENVIRONMENT=deployment +# ARG ENVIRONMENT=test + # Apt installation # git: required by setuptools_scm. RUN apt-get update && \ @@ -40,16 +45,10 @@ RUN apt-get update && \ python3-pip \ && apt-get autoclean && \ apt-get autoremove && \ - rm -rf /var/lib/{apt,dpkg,cache,log} - -# Environment can be whatever is supported by setup.py -# so, either deployment, test -ARG ENVIRONMENT=deployment -# ARG ENVIRONMENT=test - -RUN echo "Environment is: $ENVIRONMENT" && \ - [ "$ENVIRONMENT" = "deployment" ] || \ - pip install --disable-pip-version-check pip-tools pytest-cov + rm -rf /var/lib/{apt,dpkg,cache,log} && \ + echo "Environment is: $ENVIRONMENT" && \ + ([ "$ENVIRONMENT" = "deployment" ] || \ + pip install --disable-pip-version-check pip-tools pytest-cov) # Set up a nice workdir and add the live code ENV APPDIR=/code From e61893e0d55256e22a3cd07d428f7e3bab873c79 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sat, 11 May 2024 11:36:50 +0200 Subject: [PATCH 24/25] Dockerfile: merge two more layers Combine the RUN statements into a single statement. The Docker cache behavior remains the same, but there is one layer less in the produced image. --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index fde29b0a1..7df7ec46f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,14 +55,13 @@ ENV APPDIR=/code WORKDIR $APPDIR COPY . $APPDIR -COPY --from=builder --link /build/*.whl ./ -RUN python3.10 -m pip --disable-pip-version-check -q install *.whl && \ - rm *.whl - # These ENVIRONMENT flags make this a bit complex, but basically, if we are in dev # then we want to link the source (with the -e flag) and if we're in prod, we # want to delete the stuff in the /code folder to keep it simple. -RUN if [ "$ENVIRONMENT" = "deployment" ] ; then\ +COPY --from=builder --link /build/*.whl ./ +RUN python3.10 -m pip --disable-pip-version-check -q install *.whl && \ + rm *.whl && \ + if [ "$ENVIRONMENT" = "deployment" ] ; then\ pip --no-cache-dir --disable-pip-version-check install .[$ENVIRONMENT]; \ rm -rf /code/* /code/.git* ; \ else \ From e3bc7880998cfcd7399296be9d61d0778f4a3275 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sat, 11 May 2024 11:39:59 +0200 Subject: [PATCH 25/25] Dockerfile: fail on errors Rewrite the if-then-else into short-circuiting tests followed by commands chained together with &&. This makes building the image fail if something is wrong, instead of giving strange errors when running the tests. --- Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7df7ec46f..0cf231c1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,12 +61,11 @@ COPY . $APPDIR COPY --from=builder --link /build/*.whl ./ RUN python3.10 -m pip --disable-pip-version-check -q install *.whl && \ rm *.whl && \ - if [ "$ENVIRONMENT" = "deployment" ] ; then\ - pip --no-cache-dir --disable-pip-version-check install .[$ENVIRONMENT]; \ - rm -rf /code/* /code/.git* ; \ - else \ - pip --disable-pip-version-check install --editable .[$ENVIRONMENT]; \ - fi && \ + ([ "$ENVIRONMENT" = "deployment" ] || \ + pip --disable-pip-version-check install --editable .[$ENVIRONMENT]) && \ + ([ "$ENVIRONMENT" != "deployment" ] || \ + (pip --no-cache-dir --disable-pip-version-check install .[$ENVIRONMENT] && \ + rm -rf /code/* /code/.git*)) && \ pip freeze && \ ([ "$ENVIRONMENT" != "deployment" ] || \ apt-get remove -y \