-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make redis and fakeredis optional dependencies #57
Open
emileten
wants to merge
22
commits into
developmentseed:dev
Choose a base branch
from
emileten:feat/optional-redis
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+187
−93
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e5ac905
make redis and fakeredis optional dependencies used only if enable_ca…
emileten 72d52e6
fake redis should also be in test deps
emileten 1dc22b0
typo
emileten 6350f55
optional caching in aws infra
emileten 51492fb
change defaults
emileten 7b1e7b1
fix import types
emileten d67fe5f
pin deps
emileten 828baff
refactor assert
vincentsarago d68c30b
fix req
vincentsarago 7e44466
fix req
vincentsarago 0388941
fix
emileten 194c1de
update ckd
emileten 1b01a88
update python cdk deps
emileten 546e089
fix req
vincentsarago c99afff
add back emile changes
vincentsarago b7f9c6e
remove python 3.8
vincentsarago f63dbee
remove python >3.10
vincentsarago aee15e5
merge
511c34e
bring back vincent changes
b2e83ec
propagate cache option to docker builds
69f351a
forgot to remove line
d4be8fb
change versions of rasterio and h5py, remove some stuff from the pack…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ repos: | |
exclude: tests/.* | ||
additional_dependencies: | ||
- types-attrs | ||
- types-redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ARG PYTHON_VERSION=3.10 | ||
|
||
FROM --platform=linux/amd64 public.ecr.aws/lambda/python:${PYTHON_VERSION} | ||
|
||
WORKDIR /tmp | ||
|
||
COPY pyproject.toml pyproject.toml | ||
COPY LICENSE LICENSE | ||
COPY README.md README.md | ||
COPY titiler/ titiler/ | ||
|
||
# Install dependencies | ||
# HACK: aiobotocore has a tight botocore dependency | ||
# https://github.com/aio-libs/aiobotocore/issues/862 | ||
# and becaise we NEED to remove both boto3 and botocore to save space for the package | ||
# we have to force using old package version that seems `almost` compatible with Lambda env botocore | ||
# https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html | ||
RUN pip install --upgrade pip | ||
|
||
RUN pip install ".[cache]" "mangum>=0.10.0" "botocore==1.29.76" "aiobotocore==2.5.0" -t /asset --no-binary pydantic; | ||
|
||
# Reduce package size and remove useless files | ||
RUN cd /asset && find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[0-9]*//'); cp $f $n; done; | ||
RUN cd /asset && find . -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf | ||
RUN cd /asset && find . -type f -a -name '*.py' -print0 | xargs -0 rm -f | ||
RUN find /asset -type d -a -name 'tests' -print0 | xargs -0 rm -rf | ||
RUN rm -rdf /asset/numpy/doc/ /asset/bin /asset/geos_license /asset/Misc | ||
RUN rm -rdf /asset/boto3* | ||
RUN rm -rdf /asset/botocore* | ||
RUN find /asset -type f -path '*LICENSE*' -delete | ||
RUN find /asset -type f -path '*README*' -delete | ||
RUN find /asset -type f -path '*AUTHORS*' -delete | ||
RUN find /asset -type f -path '*pyproject*' -delete | ||
RUN find /asset -type f -path '*setupcf*' -delete | ||
|
||
COPY infrastructure/aws/lambda/handler.py /asset/handler.py | ||
|
||
CMD ["echo", "hello world"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
aws-cdk-lib==2.76.0 | ||
aws_cdk-aws_apigatewayv2_alpha==2.76.0a0 | ||
aws_cdk-aws_apigatewayv2_integrations_alpha==2.76.0a0 | ||
aws-cdk-lib==2.138.0 | ||
aws_cdk-aws_apigatewayv2_alpha==2.114.1a0 | ||
aws_cdk-aws_apigatewayv2_integrations_alpha==2.114.1a0 | ||
constructs>=10.0.0 | ||
|
||
pydantic~=1.0 | ||
python-dotenv | ||
python-dotenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
name = "titiler.xarray" | ||
description = "TiTiler extension for xarray." | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
requires-python = ">=3.9" | ||
authors = [ | ||
{name = "Vincent Sarago", email = "[email protected]"}, | ||
] | ||
|
@@ -17,31 +17,31 @@ classifiers = [ | |
"Intended Audience :: Information Technology", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: MIT License", | ||
"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", | ||
"Topic :: Scientific/Engineering :: GIS", | ||
] | ||
dynamic = ["version"] | ||
dependencies = [ | ||
"cftime", | ||
"h5netcdf", | ||
"xarray", | ||
"rioxarray", | ||
"zarr", | ||
"fakeredis", | ||
"cftime==1.6.3", | ||
"h5netcdf==1.3.0", | ||
"xarray==2024.3.0", | ||
"rioxarray==0.15.0", | ||
"zarr==2.17.2", | ||
"h5py==3.10.0", | ||
"rasterio==1.3.9", | ||
"fsspec", | ||
"s3fs", | ||
"aiohttp", | ||
"requests", | ||
"requests==2.31.0", | ||
"pydantic==2.0.2", | ||
"titiler.core>=0.14.1,<0.15", | ||
"pydantic-settings~=2.0", | ||
"titiler.core==0.14.1", | ||
"pydantic-settings==2.0.3", | ||
"pandas==1.5.3", | ||
"redis", | ||
"fastapi>=0.100.0,<0.107.0", | ||
"starlette<0.28", | ||
"fastapi==0.106.0", | ||
"starlette==0.27.0", | ||
] | ||
|
||
[project.optional-dependencies] | ||
|
@@ -51,17 +51,21 @@ test = [ | |
"pytest-asyncio", | ||
"httpx", | ||
"yappi", | ||
"fakeredis" | ||
] | ||
dev = [ | ||
"pre-commit" | ||
"pre-commit", | ||
"fakeredis" | ||
] | ||
debug = [ | ||
"yappi" | ||
] | ||
server = [ | ||
"uvicorn" | ||
] | ||
|
||
cache = [ | ||
"redis==5.0.3" | ||
] | ||
[project.urls] | ||
Homepage = "https://github.com/developmentseed/titiler-xarray" | ||
Issues = "https://github.com/developmentseed/titiler-xarray/issues" | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this block up, so we don't have 2
settings.enable_cache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not-mandatory if you want to merge