Skip to content

Commit

Permalink
Pin FastAPI to avoid OpenAPI docs rendering issues (#246)
Browse files Browse the repository at this point in the history
* Reorder install order in docker build; remove tiles from extension

titiler depends on an earlier version of FastAPI and doesn't allow the
dockerized server to have the FastAPI version dictated by the
stac-fastapi setup.

* Pin fastapi in stac_fastapi.types; remove from other packages.

This pins fastapi to 0.67.* in stac_fastapi.types, and has all other
packages rely on that dependency to pull in the correct version. This
also adds a missing dependency on stac_fastapi.types in
stac_fastapi.api.

Fixes #242

* Remove tiler tests.

This breaks the dockerized tests as titiler isn't installed in the
docker image anymore. Based on the outcome of #245, these (and ideally
more robust tests) can be re-added, or the tiles extension will be
dropped completely.

* Add changelog entry

* Install types first in CI, as it's the base subpackage

* Remove stac_fastapi.extensions[tiles] from test install.

I do not know why, but installing the tiles extra re-installs
stac-fastapi.types in a way that breaks an import.
  • Loading branch information
lossyrob authored Aug 27, 2021
1 parent b29d171 commit a68d280
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 87 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ jobs:
run: |
python -m pip install --upgrade pipenv wheel
- name: Install core api
run: |
pip install ./stac_fastapi/api[dev]
- name: Install types
run: |
pip install ./stac_fastapi/types[dev]
- name: Install core api
run: |
pip install ./stac_fastapi/api[dev]
- name: Install Extensions
run: |
pip install ./stac_fastapi/extensions[dev,tiles]
pip install ./stac_fastapi/extensions[dev]
- name: Install sqlalchemy stac-fastapi
run: |
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Fixed

* Pin FastAPI to 0.67 to avoid issues with rendering OpenAPI documentation ([#246](https://github.com/stac-utils/stac-fastapi/pull/246))

## [2.1.0]

### Added
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ COPY . /app
ENV PATH=$PATH:/install/bin

RUN mkdir -p /install && \
pip install -e ./stac_fastapi/api[dev] && \
pip install -e ./stac_fastapi/types[dev] && \
pip install -e ./stac_fastapi/extensions[dev,tiles] && \
pip install -e ./stac_fastapi/api[dev] && \
pip install -e ./stac_fastapi/extensions[dev] && \
pip install -e ./stac_fastapi/sqlalchemy[dev,server] && \
pip install -e ./stac_fastapi/pgstac[dev,server]
2 changes: 1 addition & 1 deletion stac_fastapi/api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
desc = f.read()

install_requires = [
"fastapi",
"attrs",
"pydantic[dotenv]",
"stac_pydantic==2.0.*",
"brotli_asgi",
"stac-fastapi.types",
]

extra_reqs = {
Expand Down
1 change: 0 additions & 1 deletion stac_fastapi/extensions/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
desc = f.read()

install_requires = [
"fastapi",
"attrs",
"pydantic[dotenv]",
"stac_pydantic==2.0.*",
Expand Down
1 change: 0 additions & 1 deletion stac_fastapi/pgstac/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
desc = f.read()

install_requires = [
"fastapi",
"attrs",
"orjson",
"pydantic[dotenv]",
Expand Down
1 change: 0 additions & 1 deletion stac_fastapi/sqlalchemy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
desc = f.read()

install_requires = [
"fastapi",
"attrs",
"pydantic[dotenv]",
"stac_pydantic==2.0.*",
Expand Down
75 changes: 0 additions & 75 deletions stac_fastapi/sqlalchemy/tests/features/test_tiles_extension.py

This file was deleted.

4 changes: 3 additions & 1 deletion stac_fastapi/types/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
desc = f.read()

install_requires = [
"fastapi",
# We need to pin fastapi for the openapi schema
# See https://github.com/stac-utils/stac-fastapi/issues/242
"fastapi==0.67.*",
"attrs",
"pydantic[dotenv]",
"stac_pydantic==2.0.*",
Expand Down

0 comments on commit a68d280

Please sign in to comment.