Skip to content

Commit

Permalink
Merge pull request #1356 from XAI-Demonstrator/fix/update-tracking-de…
Browse files Browse the repository at this point in the history
…pendencies

fix: bump experiment-tracker dependencies
  • Loading branch information
ionicsolutions committed Sep 10, 2023
2 parents b368438 + 4d70912 commit 2d7a7e1
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 32 deletions.
1 change: 1 addition & 0 deletions common/backend-utils/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ install_requires =
aiofiles
fastapi
pydantic
pydantic-settings
werkzeug
python_requires = >= 3.7
2 changes: 1 addition & 1 deletion common/backend-utils/xaidemo/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.1"
__version__ = "0.6.0"
2 changes: 1 addition & 1 deletion common/backend-utils/xaidemo/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from opentelemetry.instrumentation.aiohttp_client import (
AioHttpClientInstrumentor
)
from pydantic import BaseSettings
from pydantic_settings import BaseSettings


__all__ = ["set_up", "AioHttpClientSession"]
Expand Down
2 changes: 1 addition & 1 deletion common/backend-utils/xaidemo/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
from opentelemetry.sdk.trace import TracerProvider
from pydantic import BaseSettings
from pydantic_settings import BaseSettings

from . import __version__

Expand Down
7 changes: 4 additions & 3 deletions common/backend-utils/xaidemo/tracking/config.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
from typing import Optional

from pydantic import BaseSettings, root_validator
from pydantic import root_validator
from pydantic_settings import BaseSettings


class TrackingSettings(BaseSettings):
experiment: bool = False
service_name: str
collector_url: Optional[str]
collector_url: Optional[str] = None
collector_timeout: int = 60

@root_validator
@root_validator(skip_on_failure=True)
def experiment_requires_collector(cls, values):
if values.get("experiment"):
if not values.get("collector_url", False):
Expand Down
2 changes: 1 addition & 1 deletion experiment-tracker/data-collector/collector/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import BaseSettings
from pydantic_settings import BaseSettings


class Settings(BaseSettings):
Expand Down
2 changes: 1 addition & 1 deletion experiment-tracker/data-collector/collector/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def record(partial_record_request: PartialRecordRequest):
partial_record = create_partial_record(partial_record_request)
repo[partial_record_request.id] = Record(id=partial_record_request.id,
service=partial_record_request.source.service,
data=partial_record).dict()
data=partial_record).model_dump()
return # return early to allow the logical "else" to be outside the lock context
# else
update_record(partial_record_request)
Expand Down
1 change: 1 addition & 0 deletions experiment-tracker/data-collector/requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ pytest
pytest-env
pytest-cov
coveralls
httpx
9 changes: 5 additions & 4 deletions experiment-tracker/data-collector/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
fastapi==0.82.0
pydantic==1.10.2
fastapi==0.103.1
pydantic==2.3.0
pydantic-settings==2.0.3
couchdb==1.2
uvicorn==0.18.3
uvicorn==0.23.2

git+https://github.com/xai-demonstrator/xai-demonstrator.git@cddb9fe42c002cf44252228781ca67b61f89181d#egg=xaidemo&subdirectory=common/backend-utils
git+https://github.com/xai-demonstrator/xai-demonstrator.git@023887732c1fc325acaf4a2b0b4c4a1a1664e1ce#egg=xaidemo&subdirectory=common/backend-utils
2 changes: 1 addition & 1 deletion experiment-tracker/experiment-proxy/proxy/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import BaseSettings
from pydantic_settings import BaseSettings


class ProxySettings(BaseSettings):
Expand Down
14 changes: 7 additions & 7 deletions experiment-tracker/experiment-proxy/proxy/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@


class RequestData(BaseModel):
raw: Optional[str]
content_type: Optional[str]
decoded: Optional[dict]
raw: Optional[str] = None
content_type: Optional[str] = None
decoded: Optional[dict] = None

@root_validator
@root_validator(skip_on_failure=True)
def all_or_nothing(cls, values):
entries = [values.get("raw"), values.get("content_type"), values.get("decoded")]
is_none = [(entry is None or not entry) for entry in entries]
Expand All @@ -21,11 +21,11 @@ def all_or_nothing(cls, values):


class ResponseData(BaseModel):
raw: Optional[str]
raw: Optional[str] = None
status_code: int
decoded: Optional[dict]
decoded: Optional[dict] = None

@root_validator
@root_validator(skip_on_failure=True)
def all_or_nothing(cls, values):
entries = [values.get("raw"), values.get("decoded")]
is_none = [(entry is None or not entry) for entry in entries]
Expand Down
7 changes: 4 additions & 3 deletions experiment-tracker/experiment-proxy/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
pytest
pytest-asyncio==0.19.0
pytest-env==0.6.2
pytest-asyncio==0.21.1
pytest-env==1.0.1
pytest-cov
coveralls
aioresponses==0.7.3
aioresponses==0.7.4
pypng
httpx
13 changes: 7 additions & 6 deletions experiment-tracker/experiment-proxy/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
fastapi==0.82.0
pydantic==1.10.2
python-multipart==0.0.5
aiohttp==3.8.1
uvicorn==0.18.3
fastapi==0.103.1
pydantic==2.3.0
pydantic-settings==2.0.3
python-multipart==0.0.6
aiohttp==3.8.5
uvicorn==0.23.2

git+https://github.com/xai-demonstrator/xai-demonstrator.git@cddb9fe42c002cf44252228781ca67b61f89181d#egg=xaidemo&subdirectory=common/backend-utils
git+https://github.com/xai-demonstrator/xai-demonstrator.git@023887732c1fc325acaf4a2b0b4c4a1a1664e1ce#egg=xaidemo&subdirectory=common/backend-utils
2 changes: 1 addition & 1 deletion experiment-tracker/tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import png
import pytest
from pydantic import BaseSettings
from pydantic_settings import BaseSettings


class TestSettings(BaseSettings):
Expand Down
3 changes: 2 additions & 1 deletion experiment-tracker/tests/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pytest
pydantic
pydantic-settings
pypng
aiohttp
pytest-asyncio
Expand All @@ -9,4 +10,4 @@ opentelemetry-sdk
opentelemetry-instrumentation-requests
requests

git+https://github.com/xai-demonstrator/xai-demonstrator.git@cddb9fe42c002cf44252228781ca67b61f89181d#egg=xaidemo&subdirectory=common/backend-utils
git+https://github.com/xai-demonstrator/xai-demonstrator.git@023887732c1fc325acaf4a2b0b4c4a1a1664e1ce#egg=xaidemo&subdirectory=common/backend-utils
2 changes: 1 addition & 1 deletion experiment-tracker/tests/test-service/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ fastapi
uvicorn
python-multipart

git+https://github.com/xai-demonstrator/xai-demonstrator.git@cddb9fe42c002cf44252228781ca67b61f89181d#egg=xaidemo&subdirectory=common/backend-utils
git+https://github.com/xai-demonstrator/xai-demonstrator.git@023887732c1fc325acaf4a2b0b4c4a1a1664e1ce#egg=xaidemo&subdirectory=common/backend-utils

0 comments on commit 2d7a7e1

Please sign in to comment.