Skip to content

Commit

Permalink
attempt to only import jsonref in testing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgaard-itis committed Sep 6, 2023
1 parent e581999 commit 96025a4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
1 change: 0 additions & 1 deletion services/api-server/requirements/_base.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ cryptography
fastapi-pagination
fastapi[all]
httpx
jsonref
orjson
packaging
pydantic[dotenv]
Expand Down
24 changes: 17 additions & 7 deletions services/api-server/requirements/_base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,24 @@
#
aio-pika==9.1.2
# via
# -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/service-library/requirements/./../../../packages/models-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/service-library/requirements/./../../../packages/settings-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/service-library/requirements/./../../../requirements/constraints.txt
# -c requirements/../../../packages/service-library/requirements/./_base.in
# -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt
# -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt
# -c requirements/../../../requirements/constraints.txt
# -r requirements/../../../packages/service-library/requirements/_base.in
# -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in
aiocache==0.12.1
Expand Down Expand Up @@ -215,8 +232,6 @@ jinja2==3.1.2
# -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt
# -c requirements/../../../requirements/constraints.txt
# fastapi
jsonref==1.1.0
# via -r requirements/_base.in
jsonschema==3.2.0
# via
# -c requirements/./constraints.txt
Expand Down Expand Up @@ -259,11 +274,6 @@ multidict==6.0.4
# yarl
orjson==3.9.1
# via
# -r requirements/../../../packages/models-library/requirements/_base.in
# -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in
# -r requirements/../../../packages/service-library/requirements/./../../../packages/models-library/requirements/_base.in
# -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/_base.in
# -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in
# -r requirements/_base.in
# fastapi
packaging==23.1
Expand Down
1 change: 1 addition & 0 deletions services/api-server/requirements/_test.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ asgi_lifespan
click
docker
faker
jsonref
moto[server] # mock out tests based on AWS-S3
pytest
pytest-asyncio
Expand Down
2 changes: 2 additions & 0 deletions services/api-server/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ jsonpickle==3.0.2
# via jschema-to-python
jsonpointer==2.4
# via jsonpatch
jsonref==1.1.0
# via -r requirements/_test.in
jsonschema==3.2.0
# via
# -c requirements/./constraints.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
from contextlib import suppress
from dataclasses import dataclass
from pathlib import Path
Expand All @@ -12,6 +13,9 @@
from .http_calls_capture import get_captured_as_json
from .http_calls_capture_processing import CaptureProcessingException

if os.environ["API_SERVER_DEV_HTTP_CALLS_LOGS_PATH"]:
from .http_calls_capture import get_captured_as_json

_logger = logging.getLogger(__name__)


Expand Down

0 comments on commit 96025a4

Please sign in to comment.