Skip to content

Commit d461606

Browse files
authored
Revert "merge main to staging (#27)"
This reverts commit d026d4c.
1 parent d026d4c commit d461606

22 files changed

Lines changed: 1625 additions & 1268 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Set up Python
3333
uses: actions/setup-python@v2
3434
with:
35-
python-version: 3.9
35+
python-version: 3.8
3636

3737
- name: Create Config.yml
3838
uses: franzbischoff/replace_envs@v1
@@ -53,7 +53,7 @@ jobs:
5353
node-version: '16'
5454

5555
- name: Cache Node.js modules
56-
uses: actions/cache@v4
56+
uses: actions/cache@v2
5757
with:
5858
# npm cache files are stored in `~/.npm` on Linux/macOS
5959
path: ~/.npm
@@ -72,15 +72,15 @@ jobs:
7272
echo "::set-output name=dir::$(pip cache dir)"
7373
7474
- name: pip cache
75-
uses: actions/cache@v4
75+
uses: actions/cache@v2
7676
with:
7777
path: ${{ steps.pip-cache.outputs.dir }}
7878
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
7979
restore-keys: |
8080
${{ runner.os }}-pip-
8181
82-
- name: Install Node.js dependencies
83-
run: npm install
82+
- name: Install AWS CDK
83+
run: npm install -g cdk
8484

8585
- name: Install python packages
8686
run: |

.github/workflows/pr.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
pull_request:
44
branches:
55
- main
6+
schedule:
7+
- cron: '0 0 * * *' # daily
68

79
env:
810
STAC_API_URL: ""
@@ -28,7 +30,7 @@ jobs:
2830
- name: Set up Python
2931
uses: actions/setup-python@v2
3032
with:
31-
python-version: 3.9
33+
python-version: 3.8
3234

3335
- name: Create Config.yml
3436
uses: franzbischoff/replace_envs@v1
@@ -48,14 +50,13 @@ jobs:
4850
run: |
4951
python -m pip install -U pip
5052
python -m pip install .["dev,test"]
51-
python -m pip install --upgrade setuptools packaging virtualenv
5253
5354
- name: run pre-commit
5455
run: pre-commit run --all-files
5556

56-
# - name: Run safety dependency vulnerability check
57-
# # ignore some vulnerabilities in twisted and httplib2 that are already installed and can't be uninstalled
58-
# run: safety check -i 39557 -i 37040 -i 37209 -i 37554 -i 38085 -i 38368 -i 38303 -i 39608
57+
- name: Run safety dependency vulnerability check
58+
# ignore some vulnerabilities in twisted and httplib2 that are already installed and can't be uninstalled
59+
run: safety check -i 39557 -i 37040 -i 37209 -i 37554 -i 38085 -i 38368 -i 38303 -i 39608
5960

6061
- name: Run bandit static analysis check
6162
run: bandit -r dashboard_api
@@ -78,14 +79,14 @@ jobs:
7879
- name: Set up Python
7980
uses: actions/setup-python@v2
8081
with:
81-
python-version: 3.9
82+
python-version: 3.8
8283

8384
- uses: actions/setup-node@v2
8485
with:
85-
node-version: '16'
86+
node-version: '12'
8687

8788
- name: Cache Node.js modules
88-
uses: actions/cache@v4
89+
uses: actions/cache@v2
8990
with:
9091
# npm cache files are stored in `~/.npm` on Linux/macOS
9192
path: ~/.npm
@@ -109,8 +110,8 @@ jobs:
109110
to_file: 'stack/config.yml'
110111
commit: 'false'
111112

112-
- name: Install Node.js dependencies
113-
run: npm install
113+
- name: Install AWS CDK
114+
run: npm install -g
114115

115116
- name: Install python packages
116117
run: |

.pre-commit-config.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 24.10.0
3+
rev: 22.3.0
44
hooks:
55
- id: black
66
language_version: python
77

88
- repo: https://github.com/PyCQA/isort
9-
rev: 5.13.2
9+
rev: 5.4.2
1010
hooks:
1111
- id: isort
1212
language_version: python
1313

1414
- repo: https://github.com/PyCQA/flake8
15-
rev: 7.1.1
15+
rev: 3.8.3
1616
hooks:
1717
- id: flake8
1818
language_version: python
1919

2020
- repo: https://github.com/PyCQA/pydocstyle
21-
rev: 6.3.0
21+
rev: 5.1.1
2222
hooks:
2323
- id: pydocstyle
2424
language_version: python
2525

2626
- repo: https://github.com/pre-commit/mirrors-mypy
27-
rev: v1.13.0
27+
rev: v0.812
2828
hooks:
2929
- id: mypy
3030
language_version: python
31-
additional_dependencies:
32-
- types-PyYAML
33-
- types-requests
34-
- types-cachetools
35-
- types-mock

Dockerfiles/lambda/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN pip install . "mangum>=0.10.0" -t /asset --no-binary pydantic
1414
RUN cd /asset && find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[2-3][0-9]//'); cp $f $n; done;
1515
RUN cd /asset && find . -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
1616
RUN cd /asset && find . -type f -a -name '*.py' -print0 | xargs -0 rm -f
17-
# RUN rm -rdf /asset/numpy/doc/ /asset/boto3* /asset/botocore* /asset/bin /asset/geos_license /asset/Misc
17+
RUN rm -rdf /asset/numpy/doc/ /asset/boto3* /asset/botocore* /asset/bin /asset/geos_license /asset/Misc
1818

1919
RUN mkdir /asset/stack
2020
COPY stack/config.yml /asset/stack/config.yml

dashboard_api/api/api_v1/endpoints/datasets.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Dataset endpoints."""
2-
32
from fastapi import APIRouter, Depends, HTTPException, Response
43
from starlette.requests import Request
54

dashboard_api/api/api_v1/endpoints/tiles.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ def tile(
4141
x: int = Path(..., description="Mercator tiles's column"),
4242
y: int = Path(..., description="Mercator tiles's row"),
4343
# AssertionError: Cannot use `Query` for path param 'scale'
44-
scale: int = Path(
45-
..., gt=0, lt=4, description="Tile size scale. 1=256x256, 2=512x512..."
46-
),
47-
ext: ImageType = Path(..., description="Output image type. Default is auto."),
44+
# scale: int = Query(
45+
# 1, gt=0, lt=4, description="Tile size scale. 1=256x256, 2=512x512..."
46+
# ),
47+
# ext: ImageType = Query(None, description="Output image type. Default is auto."),
4848
url: str = Query(..., description="Cloud Optimized GeoTIFF URL."),
4949
bidx: Optional[str] = Query(None, description="Coma (',') delimited band indexes"),
5050
nodata: Optional[Union[str, int, float]] = Query(

dashboard_api/db/static/datasets/__init__.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
""" dashboard_api static datasets """
2-
32
import json
43
import os
5-
from typing import List, Optional
4+
from typing import List
65

76
import botocore
87

@@ -100,9 +99,7 @@ def list(self) -> List[str]:
10099
"""List all datasets"""
101100
return list(self._data().keys())
102101

103-
def _format_urls(
104-
self, tiles: List[str], api_url: str, spotlight_id: Optional[str] = None
105-
):
102+
def _format_urls(self, tiles: List[str], api_url: str, spotlight_id: str = None):
106103
if spotlight_id:
107104
[tile.replace("{spotlightId}", spotlight_id) for tile in tiles]
108105
return [
@@ -113,10 +110,7 @@ def _format_urls(
113110
]
114111

115112
def _process(
116-
self,
117-
datasets_domains_metadata: dict,
118-
api_url: str,
119-
spotlight_id: Optional[str] = None,
113+
self, datasets_domains_metadata: dict, api_url: str, spotlight_id: str = None
120114
):
121115
"""
122116
Processes datasets to be returned to the API consumer:

dashboard_api/db/static/products/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
""" dashboard_api static products """
2-
32
import json
43
import os
54
from typing import Optional

dashboard_api/db/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import csv
44
import json
55
from datetime import datetime
6-
from typing import Dict, List, Optional
6+
from typing import Dict, List
77

88
import boto3
99
from botocore import config
@@ -23,9 +23,7 @@
2323

2424

2525
def invoke_lambda(
26-
lambda_function_name: str,
27-
payload: Optional[dict] = None,
28-
invocation_type="RequestResponse",
26+
lambda_function_name: str, payload: dict = None, invocation_type="RequestResponse"
2927
):
3028
"""Invokes a lambda function using the boto3 lambda client.
3129

dashboard_api/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""dashboard_api app."""
2-
32
from typing import Any, Dict, Optional
43

54
from fastapi import FastAPI

0 commit comments

Comments
 (0)