Skip to content

Commit

Permalink
Merge branch 'master' into feature/power-to-the-socket
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Oct 15, 2024
2 parents cdaf00f + 3c85620 commit b844f92
Show file tree
Hide file tree
Showing 101 changed files with 398 additions and 349 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ help: ## help on rule's targets


test_python_version: ## Check Python version, throw error if compilation would fail with the installed version
python ./scripts/test_python_version.py
# Checking python version
@.venv/bin/python ./scripts/test_python_version.py


## DOCKER BUILD -------------------------------
Expand Down Expand Up @@ -482,7 +483,7 @@ push-version: tag-version

.venv: .check-uv-installed
@uv venv $@
## upgrading tools to latest version in $(shell python3 --version)
@echo "# upgrading tools to latest version in" && $@/bin/python --version
@uv pip --quiet install --upgrade \
pip~=24.0 \
wheel \
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-library/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via -r requirements/../../../requirements/devenv.txt
mypy-extensions==1.0.0
# via
Expand Down
1 change: 1 addition & 0 deletions packages/aws-library/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt

# installs this repo's packages
pytest-simcore @ ../pytest-simcore
Expand Down
2 changes: 1 addition & 1 deletion packages/dask-task-models-library/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via -r requirements/../../../requirements/devenv.txt
mypy-extensions==1.0.0
# via
Expand Down
1 change: 1 addition & 0 deletions packages/dask-task-models-library/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt

# installs this repo's packages
pytest-simcore @ ../pytest-simcore
Expand Down
2 changes: 1 addition & 1 deletion packages/models-library/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mccabe==0.7.0
# via pylint
mdurl==0.1.2
# via markdown-it-py
mypy==1.11.2
mypy==1.12.0
# via -r requirements/../../../requirements/devenv.txt
mypy-extensions==1.0.0
# via
Expand Down
1 change: 1 addition & 0 deletions packages/models-library/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt

# installs this repo's packages
simcore-postgres-database[migration] @ ../postgres-database/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# pylint: disable-all

#
# wget https://raw.githubusercontent.com/tiangolo/fastapi/master/fastapi/encoders.py --output-document=_original_fastapi_encoders
#
Expand Down Expand Up @@ -75,7 +76,7 @@ def jsonable_encoder(
sqlalchemy_safe=sqlalchemy_safe,
)
if dataclasses.is_dataclass(obj):
obj_dict = dataclasses.asdict(obj) # type: ignore[call-overload]
obj_dict = dataclasses.asdict(obj) # type: ignore[arg-type]
return jsonable_encoder(
obj_dict,
include=include,
Expand Down
2 changes: 1 addition & 1 deletion packages/notifications-library/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ idna==3.10
# requests
iniconfig==2.0.0
# via pytest
mypy==1.11.2
mypy==1.12.0
# via sqlalchemy
mypy-extensions==1.0.0
# via mypy
Expand Down
2 changes: 1 addition & 1 deletion packages/notifications-library/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via
# -c requirements/_test.txt
# -r requirements/../../../requirements/devenv.txt
Expand Down
1 change: 1 addition & 0 deletions packages/notifications-library/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt

# installs this repo's packages
simcore-models-library @ ../models-library/
Expand Down
2 changes: 1 addition & 1 deletion packages/postgres-database/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ greenlet==3.1.1
# sqlalchemy
iniconfig==2.0.0
# via pytest
mypy==1.11.2
mypy==1.12.0
# via sqlalchemy
mypy-extensions==1.0.0
# via mypy
Expand Down
2 changes: 1 addition & 1 deletion packages/postgres-database/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via
# -c requirements/_test.txt
# -r requirements/../../../requirements/devenv.txt
Expand Down
1 change: 1 addition & 0 deletions packages/postgres-database/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
--requirement _base.txt
--requirement _migration.txt
--requirement _test.txt
--requirement _tools.txt

# installs this repo's packages
pytest-simcore @ ../../packages/pytest-simcore/
Expand Down
2 changes: 1 addition & 1 deletion packages/service-integration/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via -r requirements/../../../requirements/devenv.txt
mypy-extensions==1.0.0
# via
Expand Down
1 change: 1 addition & 0 deletions packages/service-integration/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt

simcore-models-library @ ../models-library
pytest-simcore @ ../pytest-simcore
Expand Down
2 changes: 1 addition & 1 deletion packages/service-library/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ multidict==6.1.0
# -c requirements/_base.txt
# aiohttp
# yarl
mypy==1.11.2
mypy==1.12.0
# via sqlalchemy
mypy-extensions==1.0.0
# via mypy
Expand Down
2 changes: 1 addition & 1 deletion packages/service-library/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via
# -c requirements/_test.txt
# -r requirements/../../../requirements/devenv.txt
Expand Down
1 change: 1 addition & 0 deletions packages/service-library/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt

# installs this repo's packages
simcore-models-library @ ../models-library
Expand Down
9 changes: 4 additions & 5 deletions packages/service-library/src/servicelib/logging_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
from datetime import datetime
from inspect import getframeinfo, stack
from pathlib import Path
from pprint import pformat
from typing import Any, TypeAlias, TypedDict, TypeVar

from models_library.utils.json_serialization import json_dumps

from .error_codes import ErrorCodeStr
from .utils_secrets import mask_sensitive_data

Expand Down Expand Up @@ -348,7 +347,7 @@ def get_log_record_extra(

def create_troubleshotting_log_message(
message_to_user: str,
error: BaseException,
error: BaseException | None,
error_code: ErrorCodeStr,
error_context: dict[str, Any] | None = None,
tip: str | None = None,
Expand All @@ -362,11 +361,11 @@ def create_troubleshotting_log_message(
error_context -- Additional context surrounding the exception, such as environment variables or function-specific data. This can be derived from exc.error_context() (relevant when using the OsparcErrorMixin)
tip -- Helpful suggestions or possible solutions explaining why the error may have occurred and how it could potentially be resolved
"""
debug_data = json_dumps(
debug_data = pformat(
{
"exception_details": f"{error}",
"error_code": error_code,
"context": error_context,
"context": pformat(error_context, indent=1),
"tip": tip,
},
indent=1,
Expand Down
10 changes: 6 additions & 4 deletions packages/service-library/src/servicelib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ async def limited_as_completed(
*,
limit: int = _DEFAULT_LIMITED_CONCURRENCY,
tasks_group_prefix: str | None = None,
) -> AsyncGenerator[asyncio.Future[T], None]:
) -> AsyncGenerator[asyncio.Task[T], None]:
"""Runs awaitables using limited concurrent tasks and returns
result futures unordered.
Expand All @@ -214,7 +214,7 @@ async def limited_as_completed(
nothing
Yields:
Future[T]: the future of the awaitables as they appear.
task[T]: the future of the awaitables as they appear.
"""
Expand All @@ -227,7 +227,7 @@ async def limited_as_completed(
is_async = False

completed_all_awaitables = False
pending_futures: set[asyncio.Future] = set()
pending_futures: set[asyncio.Task] = set()

try:
while pending_futures or not completed_all_awaitables:
Expand All @@ -240,10 +240,11 @@ async def limited_as_completed(
if is_async
else next(awaitable_iterator) # type: ignore[call-overload]
)
future = asyncio.ensure_future(aw)
future: asyncio.Task = asyncio.ensure_future(aw)
if tasks_group_prefix:
future.set_name(f"{tasks_group_prefix}-{future.get_name()}")
pending_futures.add(future)

except (StopIteration, StopAsyncIteration): # noqa: PERF203
completed_all_awaitables = True
if not pending_futures:
Expand All @@ -254,6 +255,7 @@ async def limited_as_completed(

for future in done:
yield future

except asyncio.CancelledError:
for future in pending_futures:
future.cancel()
Expand Down
6 changes: 3 additions & 3 deletions packages/service-library/src/servicelib/utils_secrets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import secrets
import string
from typing import Final
from typing import Any, Final

from pydantic import StrictInt, validate_arguments

Expand Down Expand Up @@ -68,7 +68,7 @@ def _is_possibly_sensitive(name: str, sensitive_keywords: set[str]) -> bool:


def mask_sensitive_data(
data: dict, *, extra_sensitive_keywords: set[str] | None = None
data: dict[str, Any], *, extra_sensitive_keywords: set[str] | None = None
) -> dict:
"""Replaces the sensitive values in the dict with a placeholder before logging
Expand All @@ -79,7 +79,7 @@ def mask_sensitive_data(
sensitive_keywords = _DEFAULT_SENSITIVE_KEYWORDS | (
extra_sensitive_keywords or set()
)
masked_data = {}
masked_data: dict[str, Any] = {}
for key, value in data.items():
if isinstance(value, dict):
masked_data[key] = mask_sensitive_data(
Expand Down
2 changes: 1 addition & 1 deletion packages/settings-library/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via -r requirements/../../../requirements/devenv.txt
mypy-extensions==1.0.0
# via
Expand Down
1 change: 1 addition & 0 deletions packages/settings-library/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt

# installs this repo's packages
pytest-simcore @ ../pytest-simcore
Expand Down
2 changes: 1 addition & 1 deletion packages/simcore-sdk/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ multidict==6.1.0
# -c requirements/_base.txt
# aiohttp
# yarl
mypy==1.11.2
mypy==1.12.0
# via sqlalchemy
mypy-extensions==1.0.0
# via mypy
Expand Down
2 changes: 1 addition & 1 deletion packages/simcore-sdk/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via
# -c requirements/_test.txt
# -r requirements/../../../requirements/devenv.txt
Expand Down
3 changes: 3 additions & 0 deletions packages/simcore-sdk/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt
--requirement _tools.txt
--requirement _tools.txt

# installs this repo's packages
simcore-postgres-database @ ../postgres-database
Expand Down
2 changes: 2 additions & 0 deletions services/agent/requirements/_base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ referencing==0.29.3
# -c requirements/../../../packages/service-library/requirements/./constraints.txt
# jsonschema
# jsonschema-specifications
repro-zipfile==0.3.1
# via -r requirements/../../../packages/service-library/requirements/_base.in
requests==2.32.3
# via opentelemetry-exporter-otlp-proto-http
rich==13.8.1
Expand Down
2 changes: 1 addition & 1 deletion services/agent/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via -r requirements/../../../requirements/devenv.txt
mypy-extensions==1.0.0
# via
Expand Down
1 change: 1 addition & 0 deletions services/agent/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt

# installs this repo's packages
simcore-models-library @ ../../packages/models-library
Expand Down
2 changes: 1 addition & 1 deletion services/api-server/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ multidict==6.0.5
# -c requirements/_base.txt
# aiohttp
# yarl
mypy==1.11.2
mypy==1.12.0
# via sqlalchemy
mypy-extensions==1.0.0
# via mypy
Expand Down
2 changes: 1 addition & 1 deletion services/api-server/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ markupsafe==2.1.5
# jinja2
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via
# -c requirements/_test.txt
# -r requirements/../../../requirements/devenv.txt
Expand Down
1 change: 1 addition & 0 deletions services/api-server/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# installs base + tests requirements
--requirement _base.txt
--requirement _test.txt
--requirement _tools.txt

# installs this repo's packages
simcore-models-library @ ../../packages/models-library
Expand Down
2 changes: 1 addition & 1 deletion services/autoscaling/requirements/_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ isort==5.13.2
# pylint
mccabe==0.7.0
# via pylint
mypy==1.11.2
mypy==1.12.0
# via -r requirements/../../../requirements/devenv.txt
mypy-extensions==1.0.0
# via
Expand Down
Loading

0 comments on commit b844f92

Please sign in to comment.