diff --git a/.github/workflows/ci-testing-deploy.yml b/.github/workflows/ci-testing-deploy.yml index a780ceaf519..27691663d22 100644 --- a/.github/workflows/ci-testing-deploy.yml +++ b/.github/workflows/ci-testing-deploy.yml @@ -308,6 +308,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/web/server/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install webserver @@ -350,6 +357,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/web/server/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install webserver @@ -386,6 +400,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/web/server/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install webserver @@ -422,6 +443,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/storage/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -463,6 +491,13 @@ jobs: cache-dependency-path: "services/agent/requirements/ci.txt" - name: install rclone run: sudo ./ci/github/helpers/install_rclone.bash + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -502,6 +537,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "api/tests/requirements.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install api @@ -535,6 +577,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/api-server/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -577,6 +626,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/autoscaling/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -616,6 +672,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/catalog/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -661,6 +724,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/clusters-keeper/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -710,6 +780,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/datcore-adapter/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -757,6 +834,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/director/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -793,6 +877,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/director-v2/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -838,6 +929,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "packages/aws-library/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -877,6 +975,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "packages/dask-task-models-library/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -916,6 +1021,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/dask-sidecar/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -955,6 +1067,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/osparc-gateway-server/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1004,6 +1123,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/payments/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1043,6 +1169,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/dynamic-scheduler/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1082,6 +1215,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/resource-usage-tracker/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1131,6 +1271,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/dynamic-sidecar/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1168,6 +1315,13 @@ jobs: with: node-version: ${{ matrix.node }} cache: "npm" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1201,6 +1355,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "packages/service-library/requirements/_test.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1234,6 +1395,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "packages/postgres-database/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1273,6 +1441,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "services/invitations/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1312,6 +1487,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "packages/service-integration/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1351,6 +1533,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "packages/service-library/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1390,6 +1579,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "packages/settings-library/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1429,6 +1625,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "packages/models-library/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1469,6 +1672,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "packages/simcore-sdk/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1567,6 +1777,13 @@ jobs: attempt_delay: 1000 - name: load docker images run: make load-images local-src=/${{ runner.temp }}/build + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1626,6 +1843,13 @@ jobs: attempt_delay: 1000 - name: load docker images run: make load-images local-src=/${{ runner.temp }}/build + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1685,6 +1909,13 @@ jobs: attempt_delay: 1000 - name: load docker images run: make load-images local-src=/${{ runner.temp }}/build + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1748,6 +1979,13 @@ jobs: run: make load-images local-src=/${{ runner.temp }}/build - name: install rclone run: sudo ./ci/github/helpers/install_rclone.bash + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1809,6 +2047,13 @@ jobs: run: make load-images local-src=/${{ runner.temp }}/build - name: install rclone run: sudo ./ci/github/helpers/install_rclone.bash + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1869,6 +2114,13 @@ jobs: attempt_delay: 1000 - name: load docker images run: make load-images local-src=/${{ runner.temp }}/build + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -1942,6 +2194,13 @@ jobs: attempt_delay: 1000 - name: load docker images run: make load-images local-src=/${{ runner.temp }}/build + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -2025,6 +2284,13 @@ jobs: attempt_delay: 1000 - name: load docker images run: make load-images local-src=/${{ runner.temp }}/build + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -2083,6 +2349,13 @@ jobs: attempt_delay: 1000 - name: load docker images run: make load-images local-src=/${{ runner.temp }}/build + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install @@ -2152,6 +2425,13 @@ jobs: attempt_delay: 1000 - name: load docker images run: make load-images local-src=/${{ runner.temp }}/build + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: setup @@ -2213,6 +2493,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "tests/e2e-playwright/requirements/dev.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: expose github runtime for buildx uses: crazy-max/ghaction-github-runtime@v3 - name: download docker images @@ -2274,6 +2561,13 @@ jobs: python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: "tests/environment-setup/requirements/ci.txt" + - name: install uv + uses: yezz123/setup-uv@v1 + - uses: actions/cache@v4 + id: cache-uv + with: + path: ~/.cache/uv + key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv - name: show system version run: ./ci/helpers/show_system_versions.bash - name: install diff --git a/Makefile b/Makefile index 3fead2f3ede..98f67bdd91d 100644 --- a/Makefile +++ b/Makefile @@ -451,18 +451,31 @@ push-version: tag-version .PHONY: devenv devenv-all node-env -.venv: - @python3 --version - python3 -m venv $@ +.check-uv-installed: + @echo "Checking if 'uv' is installed..." + @if ! command -v uv >/dev/null 2>&1; then \ + printf "\033[31mError: 'uv' is not installed.\033[0m\n"; \ + printf "To install 'uv', run the following command:\n"; \ + printf "\033[34mcurl -LsSf https://astral.sh/uv/install.sh | sh\033[0m\n"; \ + exit 1; \ + else \ + printf "\033[32m'uv' is installed. Version: \033[0m"; \ + uv --version; \ + fi + + +.venv: .check-uv-installed + @uv venv $@ ## upgrading tools to latest version in $(shell python3 --version) - $@/bin/pip3 --quiet install --upgrade \ + @uv pip --quiet install --upgrade \ pip~=24.0 \ wheel \ - setuptools - @$@/bin/pip3 list --verbose + setuptools \ + uv + @$@/bin/pip list --verbose devenv: .venv .vscode/settings.json .vscode/launch.json ## create a development environment (configs, virtual-env, hooks, ...) - $/dev/null 2>&1 && pwd)" REQUIREMENTS=packages/service-library/requirements/_tools.txt PYLINT_VERSION="$(grep pylint== $REQUIREMENTS | awk '{print $1}')" -pip3 install "$PYLINT_VERSION" +uv pip install "$PYLINT_VERSION" # Minimal packages to pass linter -pip install -r "$CURDIR/requirements.txt" +uv pip install -r "$CURDIR/requirements.txt" echo "INFO:" "$(pylint --version)" "@" "$(command -v pylint)" diff --git a/ci/helpers/show_system_versions.bash b/ci/helpers/show_system_versions.bash index d52f18166b3..f8e076066fc 100755 --- a/ci/helpers/show_system_versions.bash +++ b/ci/helpers/show_system_versions.bash @@ -14,30 +14,44 @@ lsb_release -a echo "------------------------------ python -----------------------------------" if command -v python; then - python --version + python --version fi echo "------------------------------ python3 -----------------------------------" if command -v python3; then - python3 --version + python3 --version +fi + +echo "------------------------------ pip -----------------------------------" +if command -v pip; then + pip --version + echo "cache location:" + pip cache dir +fi + +echo "------------------------------ uv -----------------------------------" +if command -v uv; then + uv --version + echo "cache location:" + uv cache dir fi echo "------------------------------ docker -----------------------------------" if command -v docker; then - docker version + docker version fi echo "------------------------------ docker buildx-----------------------------------" if command -v docker; then - docker buildx version + docker buildx version fi echo "------------------------------ docker-compose -----------------------------------" if command -v docker-compose; then - docker-compose version + docker-compose version fi echo "------------------------------ docker compose -----------------------------------" if command -v docker; then - docker compose version + docker compose version fi diff --git a/packages/aws-library/Makefile b/packages/aws-library/Makefile index d7bf9225383..5d51eae37f1 100644 --- a/packages/aws-library/Makefile +++ b/packages/aws-library/Makefile @@ -12,7 +12,7 @@ requirements: ## compiles pip requirements (.in -> .txt) .PHONY: install-dev install-prod install-ci install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: tests tests-ci diff --git a/packages/aws-library/requirements/ci.txt b/packages/aws-library/requirements/ci.txt index 0672404f4ca..89277c22256 100644 --- a/packages/aws-library/requirements/ci.txt +++ b/packages/aws-library/requirements/ci.txt @@ -12,10 +12,10 @@ --requirement _tools.txt # installs this repo's packages -../pytest-simcore/ -../models-library/ -../service-library/ -../settings-library/ +pytest-simcore @ ../pytest-simcore +simcore-models-library @ ../models-library +simcore-service-library @ ../service-library/ +simcore-settings-library @ ../settings-library/ # current module -. +simcore-aws-library @ . diff --git a/packages/aws-library/requirements/dev.txt b/packages/aws-library/requirements/dev.txt index 9017cb30880..09052e9a264 100644 --- a/packages/aws-library/requirements/dev.txt +++ b/packages/aws-library/requirements/dev.txt @@ -12,7 +12,7 @@ --requirement _tools.txt # installs this repo's packages ---editable ../pytest-simcore/ +pytest-simcore @ ../pytest-simcore --editable ../models-library/ --editable ../service-library/ --editable ../settings-library/ diff --git a/packages/aws-library/src/aws_library/__init__.py b/packages/aws-library/src/aws_library/__init__.py index 8abb76e0ad2..4f4d58a4a0a 100644 --- a/packages/aws-library/src/aws_library/__init__.py +++ b/packages/aws-library/src/aws_library/__init__.py @@ -1,3 +1,3 @@ -import pkg_resources +from importlib.metadata import version -__version__: str = pkg_resources.get_distribution("simcore-aws-library").version +__version__: str = version("simcore-aws-library") diff --git a/packages/dask-task-models-library/Makefile b/packages/dask-task-models-library/Makefile index a8fff267681..35965b4e07a 100644 --- a/packages/dask-task-models-library/Makefile +++ b/packages/dask-task-models-library/Makefile @@ -12,7 +12,7 @@ requirements: ## compiles pip requirements (.in -> .txt) .PHONY: install-dev install-prod install-ci install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: tests tests-ci diff --git a/packages/dask-task-models-library/requirements/ci.txt b/packages/dask-task-models-library/requirements/ci.txt index b8e5d4577dc..562a0c1c642 100644 --- a/packages/dask-task-models-library/requirements/ci.txt +++ b/packages/dask-task-models-library/requirements/ci.txt @@ -12,9 +12,9 @@ --requirement _tools.txt # installs this repo's packages -../pytest-simcore/ -../models-library/ -../settings-library/ +pytest-simcore @ ../pytest-simcore +simcore-models-library @ ../models-library +simcore-settings-library @ ../settings-library/ # current module -. +simcore-dask-task-models-library @ . diff --git a/packages/dask-task-models-library/src/dask_task_models_library/__init__.py b/packages/dask-task-models-library/src/dask_task_models_library/__init__.py index 6a7f93bb57b..c5eb71c445e 100644 --- a/packages/dask-task-models-library/src/dask_task_models_library/__init__.py +++ b/packages/dask-task-models-library/src/dask_task_models_library/__init__.py @@ -1,5 +1,3 @@ -import pkg_resources +from importlib.metadata import version -__version__: str = pkg_resources.get_distribution( - "simcore-dask-task-models-library" -).version +__version__: str = version("simcore-dask-task-models-library") diff --git a/packages/models-library/Makefile b/packages/models-library/Makefile index 0279fbedfa8..82988966676 100644 --- a/packages/models-library/Makefile +++ b/packages/models-library/Makefile @@ -12,7 +12,7 @@ requirements: ## compiles pip requirements (.in -> .txt) .PHONY: install-dev install-prod install-ci install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: tests tests-ci @@ -84,7 +84,7 @@ docker_rest_api.py: ## auto-generates pydantic models for Docker REST API models .PHONY: _erdantic _erdantic: _check_venv_active # ensures erdantic installed - @python3 -c "import erdantic" 2>/dev/null || pip install erdantic + @python3 -c "import erdantic" 2>/dev/null || uv pip install erdantic erd-Project.svg: _erdantic erdantic models_library.projects.Project \ @@ -112,7 +112,7 @@ DOWNLOADED_TEST_DATA_DIR = "$(CURDIR)/tests/data/.downloaded-ignore" .PHONY: _httpx _httpx: _check_venv_active # ensures requirements installed - @python3 -c "import httpx" 2>/dev/null || pip install httpx + @python3 -c "import httpx" 2>/dev/null || uv pip install httpx PHONY: pull_test_data pull_test_data: $(DOT_ENV_FILE) _httpx ## downloads tests data from registry (this can take some time!) diff --git a/packages/models-library/requirements/ci.txt b/packages/models-library/requirements/ci.txt index 4a217c5215d..e8e9fd2aeab 100644 --- a/packages/models-library/requirements/ci.txt +++ b/packages/models-library/requirements/ci.txt @@ -11,8 +11,8 @@ --requirement _test.txt # installs this repo's packages -../postgres-database/[migration] -../pytest-simcore/ +simcore-postgres-database[migration] @ ../postgres-database/ +pytest-simcore @ ../pytest-simcore # current module -. +simcore-models-library @ . diff --git a/packages/models-library/src/models_library/__init__.py b/packages/models-library/src/models_library/__init__.py index 767abb3e3d1..94f1dfccf3c 100644 --- a/packages/models-library/src/models_library/__init__.py +++ b/packages/models-library/src/models_library/__init__.py @@ -1,11 +1,12 @@ """ osparc's service models library """ + # # NOTE: # - "examples" = [ ...] keyword and NOT "example". See https://json-schema.org/understanding-json-schema/reference/generic.html#annotations # -import pkg_resources +from importlib.metadata import version -__version__: str = pkg_resources.get_distribution("simcore-models-library").version +__version__: str = version("simcore-models-library") diff --git a/packages/models-library/tests/test_clusters.py b/packages/models-library/tests/test_clusters.py index 842b5929236..258bdc006f4 100644 --- a/packages/models-library/tests/test_clusters.py +++ b/packages/models-library/tests/test_clusters.py @@ -9,10 +9,8 @@ CLUSTER_USER_RIGHTS, DEFAULT_CLUSTER_ID, Cluster, - ClusterTypeInModel, ) from pydantic import BaseModel, ValidationError -from simcore_postgres_database.models.clusters import ClusterType @pytest.mark.parametrize( @@ -90,23 +88,3 @@ def test_cluster_fails_when_owner_has_no_user_rights_if_default_cluster( modified_example["access_rights"][owner_gid] = CLUSTER_ADMIN_RIGHTS with pytest.raises(ValidationError): model_cls(**modified_example) - - -def test_cluster_type_in_model_includes_postgres_database_model(): - models_library_cluster_types_names: set[str] = { - t.name for t in set(ClusterTypeInModel) - } - postgres_library_cluster_types_names: set[str] = {t.name for t in set(ClusterType)} - assert postgres_library_cluster_types_names.issubset( - models_library_cluster_types_names - ) - - models_library_cluster_types_values: set[str] = { - t.value for t in set(ClusterTypeInModel) - } # type: ignore - postgres_library_cluster_types_values: set[str] = { - t.value for t in set(ClusterType) - } - assert postgres_library_cluster_types_values.issubset( - models_library_cluster_types_values - ) diff --git a/packages/models-library/tests/test_projects.py b/packages/models-library/tests/test_projects.py index ecd6533ea83..6ed0c877f13 100644 --- a/packages/models-library/tests/test_projects.py +++ b/packages/models-library/tests/test_projects.py @@ -40,13 +40,3 @@ def test_project_with_thumbnail_as_empty_string(minimal_project: dict[str, Any]) assert project assert project.thumbnail is None - - -def test_project_type_in_models_package_same_as_in_postgres_database_package(): - from models_library.projects import ProjectType as ml_project_type - from simcore_postgres_database.models.projects import ProjectType as pg_project_type - - # pylint: disable=no-member - assert ( - ml_project_type.__members__.keys() == pg_project_type.__members__.keys() - ), f"The enum in models_library package and postgres package shall have the same values. models_pck: {ml_project_type.__members__}, postgres_pck: {pg_project_type.__members__}" diff --git a/packages/postgres-database/Makefile b/packages/postgres-database/Makefile index 3e76e88d0d0..46338c5dc27 100644 --- a/packages/postgres-database/Makefile +++ b/packages/postgres-database/Makefile @@ -13,7 +13,7 @@ requirements: ## compiles pip requirements (.in -> .txt) .PHONY: install-dev install-prod install-ci install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: tests tests-ci diff --git a/packages/postgres-database/doc/database-models.md b/packages/postgres-database/doc/database-models.md index 48b61ea4dbd..e7bbe4eaf48 100644 --- a/packages/postgres-database/doc/database-models.md +++ b/packages/postgres-database/doc/database-models.md @@ -25,6 +25,6 @@ cd packages/postgres-database make install-dev cd scripts -pip install eralchemy +uv pip install eralchemy python create_erd.py ``` diff --git a/packages/postgres-database/docker/Dockerfile b/packages/postgres-database/docker/Dockerfile index 017f277618b..9ef018fdc89 100644 --- a/packages/postgres-database/docker/Dockerfile +++ b/packages/postgres-database/docker/Dockerfile @@ -22,12 +22,15 @@ RUN apt-get update \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -36,7 +39,7 @@ ARG GIT_BRANCH ARG GIT_REPOSITORY RUN git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOSITORY} osparc-simcore\ - && pip install osparc-simcore/packages/postgres-database[migration] + && uv pip install osparc-simcore/packages/postgres-database[migration] FROM base as production diff --git a/packages/postgres-database/requirements/ci.txt b/packages/postgres-database/requirements/ci.txt index b12bf394c2e..b901feff8e4 100644 --- a/packages/postgres-database/requirements/ci.txt +++ b/packages/postgres-database/requirements/ci.txt @@ -12,7 +12,7 @@ --requirement _test.txt # installs this repo's packages ---editable ../../packages/pytest-simcore/ +pytest-simcore @ ../../packages/pytest-simcore/ # current module -. +simcore-postgres-database @ . diff --git a/packages/postgres-database/requirements/prod.txt b/packages/postgres-database/requirements/prod.txt index 20e0f06f33c..c4567926c6d 100644 --- a/packages/postgres-database/requirements/prod.txt +++ b/packages/postgres-database/requirements/prod.txt @@ -8,4 +8,4 @@ --requirement _base.txt --requirement _migration.txt -. +simcore-postgres-database @ . diff --git a/packages/postgres-database/src/simcore_postgres_database/__init__.py b/packages/postgres-database/src/simcore_postgres_database/__init__.py index 897be83b3ed..9a34ac80a31 100644 --- a/packages/postgres-database/src/simcore_postgres_database/__init__.py +++ b/packages/postgres-database/src/simcore_postgres_database/__init__.py @@ -1,9 +1,9 @@ -import pkg_resources +from importlib.metadata import version from . import storage_models, webserver_models from .models.base import metadata -__version__: str = pkg_resources.get_distribution("simcore-postgres-database").version +__version__: str = version("simcore-postgres-database") __all__: tuple[str, ...] = ( "metadata", diff --git a/packages/pytest-simcore/setup.py b/packages/pytest-simcore/setup.py index b9ee764e695..aeeaca60b0e 100644 --- a/packages/pytest-simcore/setup.py +++ b/packages/pytest-simcore/setup.py @@ -5,21 +5,21 @@ CURRENT_DIR = Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent -SETUP = dict( - name="pytest-simcore", - version=Path(CURRENT_DIR / "VERSION").read_text().strip(), - author=", ".join( +SETUP = { + "name": "pytest-simcore", + "version": Path(CURRENT_DIR / "VERSION").read_text().strip(), + "author": ", ".join( ( "Pedro Crespo-Valero (pcrespov)", "Sylvain Anderegg (sanderegg)", ) ), - description="pytest plugin with fixtures and test helpers for osparc-simcore repo modules", - py_modules=["pytest_simcore"], + "description": "pytest plugin with fixtures and test helpers for osparc-simcore repo modules", + "py_modules": ["pytest_simcore"], # WARNING: this is used in frozen services as well !!!! - python_requires=">=3.6", - install_requires=["pytest>=3.5.0"], - extras_require={ + "python_requires": ">=3.6", + "install_requires": ["pytest>=3.5.0"], + "extras_require": { "all": [ "aio-pika", "aiohttp", @@ -33,9 +33,9 @@ "yarl", ], }, - packages=find_packages(where="src"), - package_dir={"": "src"}, - classifiers=[ + "packages": find_packages(where="src"), + "package_dir": {"": "src"}, + "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Pytest", "Intended Audience :: Developers", @@ -43,8 +43,8 @@ "Operating System :: OS Independent", "License :: OSI Approved :: MIT License", ], - entry_points={"pytest11": ["simcore = pytest_simcore"]}, -) + "entry_points": {"pytest11": ["simcore = pytest_simcore"]}, +} if __name__ == "__main__": diff --git a/packages/pytest-simcore/src/pytest_simcore/__init__.py b/packages/pytest-simcore/src/pytest_simcore/__init__.py index faa4c7bcd8f..79d0b268b64 100644 --- a/packages/pytest-simcore/src/pytest_simcore/__init__.py +++ b/packages/pytest-simcore/src/pytest_simcore/__init__.py @@ -1,8 +1,9 @@ # Collection of tests fixtures for integration testing -import pkg_resources +from importlib.metadata import version + import pytest -__version__: str = pkg_resources.get_distribution("pytest-simcore").version +__version__: str = version("pytest-simcore") def pytest_addoption(parser): diff --git a/packages/pytest-simcore/src/pytest_simcore/helpers/utils_tokens.py b/packages/pytest-simcore/src/pytest_simcore/helpers/utils_tokens.py index 10be35bdfbc..cce4b12710e 100644 --- a/packages/pytest-simcore/src/pytest_simcore/helpers/utils_tokens.py +++ b/packages/pytest-simcore/src/pytest_simcore/helpers/utils_tokens.py @@ -6,8 +6,8 @@ import sqlalchemy as sa from servicelib.common_aiopg_utils import DSN +from servicelib.utils_secrets import generate_password from simcore_service_webserver.db.models import metadata, tokens, users -from simcore_service_webserver.login.utils import get_random_string from sqlalchemy import JSON, String, cast from sqlalchemy.sql import and_ # , or_, not_ @@ -24,10 +24,10 @@ async def create_token_in_db(engine, **data): # TODO change by faker? params = { "user_id": random.randint(0, 3), - "token_service": get_random_string(5), + "token_service": generate_password(5), "token_data": { - "token_secret": get_random_string(3), - "token_key": get_random_string(4), + "token_secret": generate_password(3), + "token_key": generate_password(4), }, } params.update(data) diff --git a/packages/service-integration/Dockerfile b/packages/service-integration/Dockerfile index bf1bf6df21e..ccba22a10ae 100644 --- a/packages/service-integration/Dockerfile +++ b/packages/service-integration/Dockerfile @@ -4,11 +4,16 @@ FROM python:${PYTHON_VERSION}-slim-buster as base LABEL maintainer=pcrespov -RUN set -eux \ +# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/] +RUN rm -f /etc/apt/apt.conf.d/docker-clean && \ + echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache +RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ + --mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \ + set -eux \ && apt-get update \ - && apt-get install -y \ + && apt-get install -y --no-install-recommends \ git \ - && rm -rf /var/lib/apt/lists/* \ + && apt-get clean -y \ # verify that the binary works && git --version @@ -29,9 +34,11 @@ RUN adduser \ # Sets utf-8 encoding for Python et al ENV LANG=C.UTF-8 + # Turns off writing .pyc files; superfluous on an ephemeral container. ENV PYTHONDONTWRITEBYTECODE=1 \ VIRTUAL_ENV=/home/scu/.venv + # Ensures that the python and pip executables used # in the image will be those from our virtualenv. ENV PATH="${VIRTUAL_ENV}/bin:$PATH" @@ -41,35 +48,36 @@ ENV PATH="${VIRTUAL_ENV}/bin:$PATH" FROM base as build -RUN apt-get update \ +RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ + --mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \ + set -eux \ + apt-get update \ && apt-get install -y --no-install-recommends \ - build-essential \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools -WORKDIR /build +WORKDIR /build/packages/service-integration -COPY --chown=scu:scu packages/models-library packages/models-library -COPY --chown=scu:scu packages/service-integration packages/service-integration - - -# WARNING: keep synced with `make install-prod` (did not use it directly because if would require copying scripts/common.Makefile and other parts of the repo) -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - cd packages/service-integration \ - && pip install -r requirements/_base.txt \ - && pip install ../models-library/ \ - && pip install . +RUN \ + --mount=type=bind,source=packages,target=/build/packages,rw \ + --mount=type=bind,source=packages/service-integration,target=/build/packages/service-integration,rw \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ + --requirement requirements/prod.txt \ + && pip list -v # -------------------------- Build stage ------------------- @@ -78,6 +86,12 @@ FROM base as development # NOTE: this is necessary to allow to build development images but is the same as production here FROM base as production +ENV PYTHONOPTIMIZE=TRUE + +WORKDIR /home/scu +# ensure home folder is read/writable for user scu +RUN chown -R scu /home/scu + USER scu COPY --from=build --chown=scu:scu ${VIRTUAL_ENV} ${VIRTUAL_ENV} diff --git a/packages/service-integration/Makefile b/packages/service-integration/Makefile index ad12089fa46..d1f4b125f7a 100644 --- a/packages/service-integration/Makefile +++ b/packages/service-integration/Makefile @@ -13,7 +13,7 @@ requirements: ## compiles pip requirements (.in -> .txt) .PHONY: install-dev install-prod install-ci install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: tests tests-ci diff --git a/packages/service-integration/requirements/ci.txt b/packages/service-integration/requirements/ci.txt index a15da8728f7..9b4e9f16e2b 100644 --- a/packages/service-integration/requirements/ci.txt +++ b/packages/service-integration/requirements/ci.txt @@ -10,8 +10,8 @@ --requirement _base.txt --requirement _test.txt -../models-library/ -../pytest-simcore/ +simcore-models-library @ ../models-library +pytest-simcore @ ../pytest-simcore # current module -. +simcore-service-integration @ . diff --git a/packages/service-integration/requirements/prod.txt b/packages/service-integration/requirements/prod.txt index 3009f906b50..deb20913395 100644 --- a/packages/service-integration/requirements/prod.txt +++ b/packages/service-integration/requirements/prod.txt @@ -9,7 +9,7 @@ # installs base + tests requirements --requirement _base.txt -../models-library/ +simcore-models-library @ ../models-library # current module -. +simcore-service-integration @ . diff --git a/packages/service-integration/setup.py b/packages/service-integration/setup.py index 579bae96f75..45675738a90 100644 --- a/packages/service-integration/setup.py +++ b/packages/service-integration/setup.py @@ -43,10 +43,10 @@ def read_reqs(reqs_path: Path) -> set[str]: ) # STRICT requirements -SETUP = dict( - name="simcore-service-integration", - version=Path(CURRENT_DIR / "VERSION").read_text().strip(), - author=", ".join( +SETUP = { + "name": "simcore-service-integration", + "version": Path(CURRENT_DIR / "VERSION").read_text().strip(), + "author": ", ".join( ( "Pedro Crespo-Valero (pcrespov)", "Sylvain Anderegg (sanderegg)", @@ -54,8 +54,8 @@ def read_reqs(reqs_path: Path) -> set[str]: "Andrei Neagu (GitHK)", ) ), - description="Toolkit for service integration", - classifiers=[ + "description": "Toolkit for service integration", + "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", @@ -63,24 +63,24 @@ def read_reqs(reqs_path: Path) -> set[str]: "Programming Language :: Python :: 3.10", "Framework :: Pytest", ], - long_description=Path(CURRENT_DIR / "README.md").read_text(), - python_requires=">=3.6", - license="MIT license", - install_requires=INSTALL_REQUIREMENTS, - packages=find_packages(where="src"), - package_dir={"": "src"}, - include_package_data=True, - package_data={ + "long_description": Path(CURRENT_DIR / "README.md").read_text(), + "python_requires": ">=3.6", + "license": "MIT license", + "install_requires": INSTALL_REQUIREMENTS, + "packages": find_packages(where="src"), + "package_dir": {"": "src"}, + "include_package_data": True, + "package_data": { "": [ "service/tests/**/*.py", "service/tests/unit/*.py", ] }, - test_suite="tests", - tests_require=TEST_REQUIREMENTS, - extras_require={}, - zip_safe=False, - entry_points={ + "test_suite": "tests", + "tests_require": TEST_REQUIREMENTS, + "extras_require": {}, + "zip_safe": False, + "entry_points": { "console_scripts": [ "ooil=service_integration.cli:app", "osparc-service-integrator=service_integration.cli:app", @@ -89,7 +89,7 @@ def read_reqs(reqs_path: Path) -> set[str]: ], "pytest11": ["simcore_service_integration=service_integration.pytest_plugin"], }, -) +} if __name__ == "__main__": diff --git a/packages/service-integration/src/service_integration/_meta.py b/packages/service-integration/src/service_integration/_meta.py index 5bb808b8a43..5ae5c009ccf 100644 --- a/packages/service-integration/src/service_integration/_meta.py +++ b/packages/service-integration/src/service_integration/_meta.py @@ -1,11 +1,10 @@ -import pkg_resources -from models_library.services import LATEST_INTEGRATION_VERSION +from importlib.metadata import distribution, version -# TODO: replace pkg_resources with https://importlib-metadata.readthedocs.io/en/latest/index.html which is backported from py3.7 and 3.8 +from models_library.services import LATEST_INTEGRATION_VERSION -current_distribution = pkg_resources.get_distribution("simcore-service-integration") -project_name: str = current_distribution.project_name -__version__ = current_distribution.version +current_distribution = distribution("simcore-service-integration") +project_name: str = current_distribution.metadata["Name"] +__version__ = version("simcore-service-integration") INTEGRATION_API_VERSION = "1.0.0" diff --git a/packages/service-library/Makefile b/packages/service-library/Makefile index 26c0740b96c..8e2c1a8b476 100644 --- a/packages/service-library/Makefile +++ b/packages/service-library/Makefile @@ -22,7 +22,7 @@ help: ## overwrites and calls common help function install-%: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt APP_PACKAGE_NAME=servicelib .PHONY: test-dev diff --git a/packages/service-library/requirements/ci.txt b/packages/service-library/requirements/ci.txt index ef456141c12..4d4dea58c9f 100644 --- a/packages/service-library/requirements/ci.txt +++ b/packages/service-library/requirements/ci.txt @@ -11,9 +11,9 @@ --requirement _test.txt # installs this repo's packages -../models-library/ -../settings-library/ -../pytest-simcore/ +simcore-models-library @ ../models-library +simcore-settings-library @ ../settings-library/ +pytest-simcore @ ../pytest-simcore # current module -. +simcore-service-library @ . diff --git a/packages/service-library/requirements/ci[aiohttp].txt b/packages/service-library/requirements/ci[aiohttp].txt index 999be8513b7..721950755b5 100644 --- a/packages/service-library/requirements/ci[aiohttp].txt +++ b/packages/service-library/requirements/ci[aiohttp].txt @@ -12,9 +12,9 @@ --requirement _test.txt # installs this repo's packages -../models-library/ -../settings-library/ -../pytest-simcore/ +simcore-models-library @ ../models-library +simcore-settings-library @ ../settings-library/ +pytest-simcore @ ../pytest-simcore # current module -.[aiohttp] +simcore-service-library[aiohttp] @ . diff --git a/packages/service-library/requirements/ci[all].txt b/packages/service-library/requirements/ci[all].txt index e1577366746..f7610e97111 100644 --- a/packages/service-library/requirements/ci[all].txt +++ b/packages/service-library/requirements/ci[all].txt @@ -13,9 +13,9 @@ --requirement _test.txt # installs this repo's packages -../models-library/ -../settings-library/ -../pytest-simcore/ +simcore-models-library @ ../models-library +simcore-settings-library @ ../settings-library/ +pytest-simcore @ ../pytest-simcore # current module -.[all] +simcore-service-library[all] @ . diff --git a/packages/service-library/requirements/ci[fastapi].txt b/packages/service-library/requirements/ci[fastapi].txt index 66004bb0a0d..c2c337fd4c0 100644 --- a/packages/service-library/requirements/ci[fastapi].txt +++ b/packages/service-library/requirements/ci[fastapi].txt @@ -12,9 +12,9 @@ --requirement _test.txt # installs this repo's packages -../models-library/ -../settings-library/ -../pytest-simcore/ +simcore-models-library @ ../models-library +simcore-settings-library @ ../settings-library/ +pytest-simcore @ ../pytest-simcore # current module -.[fastapi] +simcore-service-library[fastapi] @ . diff --git a/packages/service-library/requirements/dev[aiohttp].txt b/packages/service-library/requirements/dev[aiohttp].txt index 3fe16a99369..5e0ae847c64 100644 --- a/packages/service-library/requirements/dev[aiohttp].txt +++ b/packages/service-library/requirements/dev[aiohttp].txt @@ -18,4 +18,4 @@ --editable ../pytest-simcore/ # current module ---editable ."[aiohttp]" +--editable .[aiohttp] diff --git a/packages/service-library/requirements/dev[all].txt b/packages/service-library/requirements/dev[all].txt index 1f86df11a25..b372254b325 100644 --- a/packages/service-library/requirements/dev[all].txt +++ b/packages/service-library/requirements/dev[all].txt @@ -19,4 +19,4 @@ --editable ../pytest-simcore/ # current module ---editable ."[all]" +--editable .[all] diff --git a/packages/service-library/requirements/dev[fastapi].txt b/packages/service-library/requirements/dev[fastapi].txt index 6c5c5ccbe45..caea1c80fd5 100644 --- a/packages/service-library/requirements/dev[fastapi].txt +++ b/packages/service-library/requirements/dev[fastapi].txt @@ -18,4 +18,4 @@ --editable ../pytest-simcore/ # current module ---editable ."[fastapi]" +--editable .[fastapi] diff --git a/packages/service-library/setup.py b/packages/service-library/setup.py index b12985b1cd7..d853bc865fd 100644 --- a/packages/service-library/setup.py +++ b/packages/service-library/setup.py @@ -29,25 +29,25 @@ def read_reqs(reqs_path: Path) -> set[str]: TEST_REQUIREMENTS = read_reqs(CURRENT_DIR / "requirements" / "_test.txt") -SETUP = dict( - name="simcore-service-library", - version=Path(CURRENT_DIR / "VERSION").read_text().strip(), - author="Pedro Crespo-Valero (pcrespov)", - description="Core service library for simcore (or servicelib)", - license="MIT license", - python_requires="~=3.10", - install_requires=tuple(PROD_REQUIREMENTS), - packages=find_packages(where="src"), - package_dir={"": "src"}, - test_suite="tests", - tests_require=tuple(TEST_REQUIREMENTS), - extras_require={ - "test": tuple(TEST_REQUIREMENTS), +SETUP = { + "author": "Pedro Crespo-Valero (pcrespov)", + "description": "Core service library for simcore (or servicelib)", + "extras_require": { "aiohttp": tuple(AIOHTTP_REQUIREMENTS), - "fastapi": tuple(FASTAPI_REQUIREMENTS), "all": tuple(AIOHTTP_REQUIREMENTS | FASTAPI_REQUIREMENTS), + "fastapi": tuple(FASTAPI_REQUIREMENTS), + "test": tuple(TEST_REQUIREMENTS), }, -) + "install_requires": tuple(PROD_REQUIREMENTS), + "license": "MIT license", + "name": "simcore-service-library", + "package_dir": {"": "src"}, + "packages": find_packages(where="src"), + "python_requires": "~=3.10", + "test_suite": "tests", + "tests_require": tuple(TEST_REQUIREMENTS), + "version": Path(CURRENT_DIR / "VERSION").read_text().strip(), +} if __name__ == "__main__": diff --git a/packages/service-library/src/servicelib/__init__.py b/packages/service-library/src/servicelib/__init__.py index 073fcc30388..ee9e729caaf 100644 --- a/packages/service-library/src/servicelib/__init__.py +++ b/packages/service-library/src/servicelib/__init__.py @@ -2,6 +2,6 @@ """ -import pkg_resources +from importlib.metadata import version -__version__: str = pkg_resources.get_distribution("simcore-service-library").version +__version__: str = version("simcore-service-library") diff --git a/packages/service-library/src/servicelib/resources.py b/packages/service-library/src/servicelib/resources.py index df90b659afe..614434378d1 100644 --- a/packages/service-library/src/servicelib/resources.py +++ b/packages/service-library/src/servicelib/resources.py @@ -2,12 +2,12 @@ See https://setuptools.readthedocs.io/en/latest/pkg_resources.html """ + import pathlib from dataclasses import dataclass +from importlib.resources import files from pathlib import Path -import pkg_resources - @dataclass(frozen=True) class DataResourcesFacade: @@ -22,7 +22,9 @@ class DataResourcesFacade: distribution_name: str def exists(self, resource_name: str) -> bool: - return pkg_resources.resource_exists(self.package_name, resource_name) + path = self.get_path(resource_name) + + return path.exists() def get_path(self, resource_name: str) -> Path: """Returns a path to a resource @@ -30,9 +32,8 @@ def get_path(self, resource_name: str) -> Path: WARNING: existence of file is not guaranteed WARNING: resource files are supposed to be used as read-only! """ - return pathlib.Path( - pkg_resources.resource_filename(self.package_name, resource_name) - ) + ref = files(self.distribution_name.replace("-", "_")) / resource_name + return pathlib.Path(f"{ref}") # resources env keys diff --git a/packages/service-library/src/servicelib/utils_meta.py b/packages/service-library/src/servicelib/utils_meta.py index 7732081eced..e3f81ec0fb7 100644 --- a/packages/service-library/src/servicelib/utils_meta.py +++ b/packages/service-library/src/servicelib/utils_meta.py @@ -1,11 +1,10 @@ """ Utilities to implement _meta.py """ -from contextlib import suppress -import pkg_resources +from importlib.metadata import distribution + from packaging.version import Version -from pkg_resources import Distribution class PackageInfo: @@ -27,11 +26,11 @@ def __init__(self, package_name: str): """ package_name: as defined in 'setup.name' """ - self._distribution: Distribution = pkg_resources.get_distribution(package_name) + self._distribution = distribution(package_name) @property def project_name(self) -> str: - return self._distribution.project_name + return self._distribution.metadata["Name"] @property def version(self) -> Version: @@ -47,14 +46,7 @@ def api_prefix_path_tag(self) -> str: return f"v{self.version.major}" def get_summary(self) -> str: - with suppress(Exception): - try: - metadata = self._distribution.get_metadata_lines("METADATA") - except FileNotFoundError: - metadata = self._distribution.get_metadata_lines("PKG-INFO") - - return next(x.split(":") for x in metadata if x.startswith("Summary:"))[-1] - return "" + return self._distribution.metadata.get_all("Summary", [""])[-1] def get_finished_banner(self) -> str: return "{:=^100}".format( diff --git a/packages/settings-library/Makefile b/packages/settings-library/Makefile index 487c0fc825d..d7fd27a9195 100644 --- a/packages/settings-library/Makefile +++ b/packages/settings-library/Makefile @@ -12,7 +12,7 @@ requirements: ## compiles pip requirements (.in -> .txt) .PHONY: install-dev install-prod install-ci install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: tests tests-ci diff --git a/packages/settings-library/requirements/ci.txt b/packages/settings-library/requirements/ci.txt index 18b9cd124df..9feda17bfaa 100644 --- a/packages/settings-library/requirements/ci.txt +++ b/packages/settings-library/requirements/ci.txt @@ -11,7 +11,7 @@ --requirement _test.txt # installs this repo's packages -../pytest-simcore/ +pytest-simcore @ ../pytest-simcore # current module -. +simcore-settings-library @ . diff --git a/packages/settings-library/setup.py b/packages/settings-library/setup.py index 1855048feac..6c28626129d 100644 --- a/packages/settings-library/setup.py +++ b/packages/settings-library/setup.py @@ -30,14 +30,14 @@ def read_reqs(reqs_path: Path) -> set[str]: SETUP = { - "name": "simcore-settings-library", - "version": Path(CURRENT_DIR / "VERSION").read_text().strip(), "author": ", ".join( ( "Pedro Crespo-Valero (pcrespov)", "Sylvain Anderegg (sanderegg)", ) ), + "name": "simcore-settings-library", + "version": Path(CURRENT_DIR / "VERSION").read_text().strip(), "description": "Library with common pydantic settings", # SEE https://pypi.org/classifiers/ "classifiers": [ diff --git a/packages/settings-library/src/settings_library/__init__.py b/packages/settings-library/src/settings_library/__init__.py index 31a9a9f7576..f36b602b994 100644 --- a/packages/settings-library/src/settings_library/__init__.py +++ b/packages/settings-library/src/settings_library/__init__.py @@ -1,3 +1,3 @@ -import pkg_resources +from importlib.metadata import version -__version__: str = pkg_resources.get_distribution("simcore-settings-library").version +__version__: str = version("simcore-settings-library") diff --git a/packages/simcore-sdk/Makefile b/packages/simcore-sdk/Makefile index f05e85fd985..3e2ca6a7449 100644 --- a/packages/simcore-sdk/Makefile +++ b/packages/simcore-sdk/Makefile @@ -14,7 +14,7 @@ include ../../scripts/common-package.Makefile .PHONY: install-dev install-prod install-ci install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: tests-unit tests-unit-ci tests-integration tests-integration-ci tests tests-unit: ## runs unit tests diff --git a/packages/simcore-sdk/requirements/_test.txt b/packages/simcore-sdk/requirements/_test.txt index 9868041c80a..7c38a831075 100644 --- a/packages/simcore-sdk/requirements/_test.txt +++ b/packages/simcore-sdk/requirements/_test.txt @@ -9,9 +9,7 @@ aioboto3==9.6.0 # -c requirements/./constraints.txt # -r requirements/_test.in aiobotocore==2.3.0 - # via - # aioboto3 - # aiobotocore + # via aioboto3 aiohttp==3.8.6 # via # -c requirements/../../../requirements/constraints.txt @@ -21,7 +19,7 @@ aiohttp==3.8.6 # pytest-aiohttp aioitertools==0.11.0 # via aiobotocore -aioresponses==0.7.4 +aioresponses==0.7.6 # via -r requirements/_test.in aiosignal==1.3.1 # via @@ -272,9 +270,7 @@ python-dateutil==2.8.2 python-dotenv==1.0.0 # via -r requirements/_test.in python-jose==3.3.0 - # via - # moto - # python-jose + # via moto pyyaml==6.0.1 # via # -c requirements/../../../requirements/constraints.txt diff --git a/packages/simcore-sdk/requirements/ci.txt b/packages/simcore-sdk/requirements/ci.txt index 5b661d543e3..25fcdd73354 100644 --- a/packages/simcore-sdk/requirements/ci.txt +++ b/packages/simcore-sdk/requirements/ci.txt @@ -11,14 +11,12 @@ --requirement _test.txt # installs this repo's packages -../postgres-database -../pytest-simcore/ -../models-library/ -../settings-library/ - -# FIXME: these dependencies should be removed -../service-library/ +simcore-postgres-database @ ../postgres-database +pytest-simcore @ ../pytest-simcore +simcore-models-library @ ../models-library +simcore-settings-library @ ../settings-library/ +simcore-service-library @ ../service-library/ # installs current package -. +simcore-sdk @ . diff --git a/packages/simcore-sdk/src/simcore_sdk/__init__.py b/packages/simcore-sdk/src/simcore_sdk/__init__.py index 9faf154bb7e..cf884cf3d1d 100644 --- a/packages/simcore-sdk/src/simcore_sdk/__init__.py +++ b/packages/simcore-sdk/src/simcore_sdk/__init__.py @@ -2,6 +2,6 @@ """ -import pkg_resources +from importlib.metadata import version -__version__: str = pkg_resources.get_distribution("simcore-sdk").version +__version__: str = version("simcore-sdk") diff --git a/requirements/base.Makefile b/requirements/base.Makefile index fc33d5107b5..658099c0e47 100644 --- a/requirements/base.Makefile +++ b/requirements/base.Makefile @@ -21,8 +21,8 @@ touch: @$(foreach p,${objects},touch ${p};) -check: ## Checks whether pip-compile is installed - @which pip-compile > /dev/null +check: ## Checks whether uv is installed + @which uv > /dev/null clean: check ## Cleans all requirements/*.txt @@ -45,10 +45,7 @@ help: ## this colorful help # %.txt: %.in cd ..; \ - pip-compile $(UPGRADE_OPTION) \ - --build-isolation \ - --strip-extras \ - --resolver=backtracking \ + uv pip compile $(UPGRADE_OPTION) \ --output-file requirements/$@ requirements/$< _test.txt: _base.txt diff --git a/requirements/how-to-unify-versions.md b/requirements/how-to-unify-versions.md index 5dc99cd921b..37842e171dd 100644 --- a/requirements/how-to-unify-versions.md +++ b/requirements/how-to-unify-versions.md @@ -47,7 +47,7 @@ do done ``` -It would also be possible to upgrade them simultaneously by using ``--upgrade`` multiple times as ``pip-compile --upgrade X --upgrade Y ...`` +It would also be possible to upgrade them simultaneously by using ``--upgrade`` multiple times as ``uv pip compile --upgrade X --upgrade Y ...`` but we prefer to do it one by one and commit changes so that any issue can be tracked to the library upgrade diff --git a/requirements/tools/Dockerfile b/requirements/tools/Dockerfile index 0e255031603..f3798ad33ca 100644 --- a/requirements/tools/Dockerfile +++ b/requirements/tools/Dockerfile @@ -26,7 +26,8 @@ RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ pip install --upgrade \ pip~=24.0 \ wheel \ - setuptools + setuptools \ + uv # devenv diff --git a/requirements/tools/Makefile b/requirements/tools/Makefile index 6da04f61774..e1dd0c246ef 100644 --- a/requirements/tools/Makefile +++ b/requirements/tools/Makefile @@ -89,7 +89,7 @@ reqs-services: guard-UPGRADE_OPTION ## updates a give package on a service (e.g. reqs-ci: ## upgrades requirements for pylint recipe in CI cd $(REPODIR)/ci/helpers \ && rm requirements.txt \ - && pip-compile --resolver=backtracking --strip-extras requirements.in + && uv pip compile --resolver=backtracking --strip-extras requirements.in IMAGE_NAME:=local/python-devkit:${PYTHON_VERSION} diff --git a/scripts/common-service.Makefile b/scripts/common-service.Makefile index b57380c1c45..6dc787b8b79 100644 --- a/scripts/common-service.Makefile +++ b/scripts/common-service.Makefile @@ -37,7 +37,8 @@ export APP_VERSION install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # Installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt + .PHONY: test-dev-unit test-ci-unit test-dev-integration test-ci-integration test-dev diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index 2bfe2d5b444..27a7af3ce89 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -73,13 +73,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -90,8 +93,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/agent/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -110,8 +113,8 @@ WORKDIR /build/services/agent RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/agent,target=/build/services/agent,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/agent/docker/boot.sh b/services/agent/docker/boot.sh index 5d8d57650dd..956717e8544 100755 --- a/services/agent/docker/boot.sh +++ b/services/agent/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/agent || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' @@ -38,7 +39,6 @@ AGENT_SERVER_REMOTE_DEBUG_PORT=3000 SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') echo "$INFO" "Log-level app/server: $APP_LOG_LEVEL/$SERVER_LOG_LEVEL" - if [ "${SC_BOOT_MODE}" = "debug" ]; then reload_dir_packages=$(find /devel/packages -maxdepth 3 -type d -path "*/src/*" ! -path "*.*" -exec echo '--reload-dir {} \' \;) diff --git a/services/agent/requirements/ci.txt b/services/agent/requirements/ci.txt index 04bec253a17..9bb78c69f29 100644 --- a/services/agent/requirements/ci.txt +++ b/services/agent/requirements/ci.txt @@ -12,10 +12,10 @@ --requirement _tools.txt # installs this repo's packages -../../packages/models-library -../../packages/pytest-simcore -../../packages/service-library -../../packages/settings-library +simcore-models-library @ ../../packages/models-library +pytest-simcore @ ../../packages/pytest-simcore +simcore-service-library @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-agent @ . diff --git a/services/agent/requirements/prod.txt b/services/agent/requirements/prod.txt index acf5da3c628..26afb420d40 100644 --- a/services/agent/requirements/prod.txt +++ b/services/agent/requirements/prod.txt @@ -10,8 +10,8 @@ --requirement _base.txt # installs this repo's packages -../../packages/models-library -../../packages/service-library -../../packages/settings-library +simcore-models-library @ ../../packages/models-library +simcore-service-library @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-agent @ . diff --git a/services/agent/src/simcore_service_agent/_meta.py b/services/agent/src/simcore_service_agent/_meta.py index a4494809785..f7c328ab2aa 100644 --- a/services/agent/src/simcore_service_agent/_meta.py +++ b/services/agent/src/simcore_service_agent/_meta.py @@ -1,30 +1,23 @@ """ Application's metadata """ -from contextlib import suppress + +from importlib.metadata import distribution, version from typing import Final -import pkg_resources from packaging.version import Version -_current_distribution = pkg_resources.get_distribution("simcore-service-agent") -__version__: str = _current_distribution.version +_current_distribution = distribution("simcore-service-agent") +__version__: str = version("simcore-service-agent") -APP_NAME: Final[str] = _current_distribution.project_name +APP_NAME: Final[str] = _current_distribution.metadata["Name"] VERSION: Final[Version] = Version(__version__) API_VTAG: str = f"v{VERSION.major}" def get_summary() -> str: - with suppress(Exception): - try: - metadata = _current_distribution.get_metadata_lines("METADATA") - except FileNotFoundError: - metadata = _current_distribution.get_metadata_lines("PKG-INFO") - - return next(x.split(":") for x in metadata if x.startswith("Summary:"))[-1] - return "" + return _current_distribution.metadata.get_all("Summary", [""])[-1] SUMMARY: Final[str] = get_summary() diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index a70c63d5442..f11ed34e33a 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -69,13 +69,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -86,8 +89,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/api-server/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -106,8 +109,8 @@ WORKDIR /build/services/api-server RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/api-server,target=/build/services/api-server,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/api-server/docker/boot.sh b/services/api-server/docker/boot.sh index ae26203b4aa..e62bd5a3141 100755 --- a/services/api-server/docker/boot.sh +++ b/services/api-server/docker/boot.sh @@ -19,7 +19,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/api-server || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/api-server/requirements/_base.txt b/services/api-server/requirements/_base.txt index daabaf8147c..38b5efe80fb 100644 --- a/services/api-server/requirements/_base.txt +++ b/services/api-server/requirements/_base.txt @@ -291,9 +291,11 @@ pamqp==3.2.1 pint==0.22 # via -r requirements/../../../packages/simcore-sdk/requirements/_base.in prometheus-client==0.19.0 - # via prometheus-fastapi-instrumentator + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # prometheus-fastapi-instrumentator prometheus-fastapi-instrumentator==6.1.0 - # via -r requirements/_base.in + # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psycopg2-binary==2.9.6 # via # aiopg diff --git a/services/api-server/requirements/_test.txt b/services/api-server/requirements/_test.txt index f888675c18c..05908275cb2 100644 --- a/services/api-server/requirements/_test.txt +++ b/services/api-server/requirements/_test.txt @@ -9,7 +9,7 @@ aiohttp==3.8.5 # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aioresponses -aioresponses==0.7.5 +aioresponses==0.7.6 # via -r requirements/_test.in aiosignal==1.3.1 # via @@ -83,9 +83,7 @@ click==8.1.3 # -r requirements/_test.in # flask coverage==7.3.2 - # via - # coverage - # pytest-cov + # via pytest-cov cryptography==41.0.7 # via # -c requirements/../../../requirements/constraints.txt @@ -270,9 +268,7 @@ python-dateutil==2.8.2 # faker # moto python-jose==3.3.0 - # via - # moto - # python-jose + # via moto pytz==2023.3.post1 # via moto pyyaml==6.0.1 diff --git a/services/api-server/requirements/ci.txt b/services/api-server/requirements/ci.txt index 0f027a404fb..7ea96c9234e 100644 --- a/services/api-server/requirements/ci.txt +++ b/services/api-server/requirements/ci.txt @@ -11,12 +11,12 @@ --requirement _test.txt # installs this repo's packages -../../packages/models-library -../../packages/postgres-database/ -../../packages/pytest-simcore/ -../../packages/simcore-sdk -../../packages/service-library[fastapi] -../../packages/settings-library/ +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database/ +pytest-simcore @ ../../packages/pytest-simcore/ +simcore-sdk @ ../../packages/simcore-sdk +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ # installs current package -. +simcore-service-api-server @ . diff --git a/services/api-server/requirements/prod.txt b/services/api-server/requirements/prod.txt index 960f670e55b..a8fc2fb9e80 100644 --- a/services/api-server/requirements/prod.txt +++ b/services/api-server/requirements/prod.txt @@ -10,10 +10,10 @@ --requirement _base.txt # installs this repo's packages -../../packages/models-library -../../packages/postgres-database/ -../../packages/service-library -../../packages/settings-library/ -../../packages/simcore-sdk +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database/ +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ +simcore-sdk @ ../../packages/simcore-sdk # installs current package -. +simcore-service-api-server @ . diff --git a/services/autoscaling/Dockerfile b/services/autoscaling/Dockerfile index 948a7f5a6a3..c05adcbafb8 100644 --- a/services/autoscaling/Dockerfile +++ b/services/autoscaling/Dockerfile @@ -89,13 +89,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -106,8 +109,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/autoscaling/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -126,8 +129,8 @@ WORKDIR /build/services/autoscaling RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/autoscaling,target=/build/services/autoscaling,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/autoscaling/docker/boot.sh b/services/autoscaling/docker/boot.sh index 64c2c6c7c62..21f8e0648f1 100755 --- a/services/autoscaling/docker/boot.sh +++ b/services/autoscaling/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/autoscaling || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/autoscaling/requirements/ci.txt b/services/autoscaling/requirements/ci.txt index 4adf7f199a7..6ae3d42db4f 100644 --- a/services/autoscaling/requirements/ci.txt +++ b/services/autoscaling/requirements/ci.txt @@ -11,12 +11,12 @@ --requirement _test.txt # installs this repo's packages -../../packages/aws-library -../../packages/dask-task-models-library -../../packages/models-library -../../packages/pytest-simcore -../../packages/service-library[fastapi] -../../packages/settings-library +simcore-aws-library @ ../../packages/aws-library +simcore-dask-task-models-library @ ../../packages/dask-task-models-library +simcore-models-library @ ../../packages/models-library +pytest-simcore @ ../../packages/pytest-simcore +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-autoscaling @ . diff --git a/services/autoscaling/requirements/prod.txt b/services/autoscaling/requirements/prod.txt index 9452305726e..ee043c82eab 100644 --- a/services/autoscaling/requirements/prod.txt +++ b/services/autoscaling/requirements/prod.txt @@ -10,10 +10,10 @@ --requirement _base.txt # installs this repo's packages -../../packages/aws-library -../../packages/models-library -../../packages/service-library[fastapi] -../../packages/settings-library -../../packages/dask-task-models-library +simcore-aws-library @ ../../packages/aws-library +simcore-models-library @ ../../packages/models-library +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library +simcore-dask-task-models-library @ ../../packages/dask-task-models-library # installs current package -. +simcore-service-autoscaling @ . diff --git a/services/autoscaling/setup.py b/services/autoscaling/setup.py index 3d3d1786928..2cdde15f3ed 100755 --- a/services/autoscaling/setup.py +++ b/services/autoscaling/setup.py @@ -42,30 +42,30 @@ def read_reqs(reqs_path: Path) -> set[str]: TEST_REQUIREMENTS = tuple(read_reqs(CURRENT_DIR / "requirements" / "_test.txt")) -SETUP = dict( - name=NAME, - version=VERSION, - author=AUTHORS, - description=DESCRIPTION, - long_description=README, - license="MIT license", - python_requires="~=3.10", - packages=find_packages(where="src"), - package_dir={ +SETUP = { + "name": NAME, + "version": VERSION, + "author": AUTHORS, + "description": DESCRIPTION, + "long_description": README, + "license": "MIT license", + "python_requires": "~=3.10", + "packages": find_packages(where="src"), + "package_dir": { "": "src", }, - include_package_data=True, - install_requires=PROD_REQUIREMENTS, - test_suite="tests", - tests_require=TEST_REQUIREMENTS, - extras_require={"test": TEST_REQUIREMENTS}, - entry_points={ + "include_package_data": True, + "install_requires": PROD_REQUIREMENTS, + "test_suite": "tests", + "tests_require": TEST_REQUIREMENTS, + "extras_require": {"test": TEST_REQUIREMENTS}, + "entry_points": { "console_scripts": [ "simcore-service-autoscaling = simcore_service_autoscaling.cli:main", "simcore-service = simcore_service_autoscaling.cli:main", ], }, -) +} if __name__ == "__main__": setup(**SETUP) diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index 80c8127ac30..88bd6fb350e 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -70,12 +70,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 + # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -86,8 +90,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/catalog/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -106,8 +110,8 @@ WORKDIR /build/services/catalog RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/catalog,target=/build/services/catalog,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/catalog/docker/boot.sh b/services/catalog/docker/boot.sh index 361580acee4..4c9268e8d3f 100755 --- a/services/catalog/docker/boot.sh +++ b/services/catalog/docker/boot.sh @@ -19,13 +19,13 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/catalog || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' fi - # RUNNING application ---------------------------------------- APP_LOG_LEVEL=${CATALOG_LOGLEVEL:-${LOG_LEVEL:-${LOGLEVEL:-INFO}}} SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') diff --git a/services/catalog/requirements/_base.txt b/services/catalog/requirements/_base.txt index 2b809a5b424..5be13e22b66 100644 --- a/services/catalog/requirements/_base.txt +++ b/services/catalog/requirements/_base.txt @@ -110,6 +110,7 @@ fastapi==0.96.0 # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in + # prometheus-fastapi-instrumentator frozenlist==1.3.3 # via # aiohttp @@ -202,6 +203,12 @@ packaging==23.1 # via -r requirements/_base.in pamqp==3.2.1 # via aiormq +prometheus-client==0.20.0 + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # prometheus-fastapi-instrumentator +prometheus-fastapi-instrumentator==6.1.0 + # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psycopg2-binary==2.9.6 # via sqlalchemy pydantic==1.9.0 diff --git a/services/catalog/requirements/_test.txt b/services/catalog/requirements/_test.txt index fc7734635fe..4dad9071537 100644 --- a/services/catalog/requirements/_test.txt +++ b/services/catalog/requirements/_test.txt @@ -48,9 +48,7 @@ click==8.1.3 # -c requirements/_base.txt # -r requirements/_test.in coverage==7.3.2 - # via - # coverage - # pytest-cov + # via pytest-cov docker==6.1.3 # via -r requirements/_test.in exceptiongroup==1.1.3 diff --git a/services/catalog/requirements/ci.txt b/services/catalog/requirements/ci.txt index 5387291c154..246c4b290a4 100644 --- a/services/catalog/requirements/ci.txt +++ b/services/catalog/requirements/ci.txt @@ -11,11 +11,11 @@ --requirement _test.txt # installs this repo's packages -../../packages/models-library -../../packages/postgres-database -../../packages/pytest-simcore/ -../../packages/service-library[fastapi] -../../packages/settings-library +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database +pytest-simcore @ ../../packages/pytest-simcore/ +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-catalog @ . diff --git a/services/catalog/requirements/prod.txt b/services/catalog/requirements/prod.txt index a7ea4f35c59..a830c6815bd 100644 --- a/services/catalog/requirements/prod.txt +++ b/services/catalog/requirements/prod.txt @@ -10,10 +10,10 @@ --requirement _base.txt # installs this repo's packages -../../packages/models-library -../../packages/postgres-database/ -../../packages/service-library[fastapi] -../../packages/settings-library +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database/ +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-catalog @ . diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index f9d0e0fb9de..0f579450535 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -89,13 +89,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -106,8 +109,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/clusters-keeper/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -126,8 +129,8 @@ WORKDIR /build/services/clusters-keeper RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/clusters-keeper,target=/build/services/clusters-keeper,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/clusters-keeper/docker/boot.sh b/services/clusters-keeper/docker/boot.sh index d7a2865db75..64cc11529da 100755 --- a/services/clusters-keeper/docker/boot.sh +++ b/services/clusters-keeper/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/clusters-keeper || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/clusters-keeper/requirements/_base.txt b/services/clusters-keeper/requirements/_base.txt index 6d79fc94592..038b1f8e4eb 100644 --- a/services/clusters-keeper/requirements/_base.txt +++ b/services/clusters-keeper/requirements/_base.txt @@ -12,9 +12,7 @@ aio-pika==9.3.0 aioboto3==12.0.0 # via -r requirements/../../../packages/aws-library/requirements/_base.in aiobotocore==2.7.0 - # via - # aioboto3 - # aiobotocore + # via aioboto3 aiocache==0.12.2 # via -r requirements/../../../packages/aws-library/requirements/_base.in aiodebug==2.3.0 @@ -156,6 +154,7 @@ fastapi==0.99.1 # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in + # prometheus-fastapi-instrumentator frozenlist==1.4.0 # via # aiohttp @@ -270,6 +269,12 @@ partd==1.4.0 # via # -c requirements/../../../services/dask-sidecar/requirements/_dask-distributed.txt # dask +prometheus-client==0.20.0 + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # prometheus-fastapi-instrumentator +prometheus-fastapi-instrumentator==6.1.0 + # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psutil==5.9.5 # via # -c requirements/../../../services/dask-sidecar/requirements/_dask-distributed.txt @@ -448,6 +453,8 @@ types-aiobotocore==2.7.0 # via -r requirements/../../../packages/aws-library/requirements/_base.in types-aiobotocore-ec2==2.7.0 # via types-aiobotocore +types-aiobotocore-s3==2.7.0 + # via types-aiobotocore types-awscrt==0.19.8 # via botocore-stubs types-python-dateutil==2.8.19.14 @@ -461,6 +468,7 @@ typing-extensions==4.8.0 # typer # types-aiobotocore # types-aiobotocore-ec2 + # types-aiobotocore-s3 # uvicorn urllib3==1.26.16 # via diff --git a/services/clusters-keeper/requirements/_test.txt b/services/clusters-keeper/requirements/_test.txt index 187afad726e..201fd4578ba 100644 --- a/services/clusters-keeper/requirements/_test.txt +++ b/services/clusters-keeper/requirements/_test.txt @@ -264,9 +264,7 @@ python-dateutil==2.8.2 python-dotenv==1.0.0 # via -r requirements/_test.in python-jose==3.3.0 - # via - # moto - # python-jose + # via moto pyyaml==6.0.1 # via # -c requirements/../../../requirements/constraints.txt diff --git a/services/clusters-keeper/requirements/ci.txt b/services/clusters-keeper/requirements/ci.txt index 972b44964e6..750d3b3a3d3 100644 --- a/services/clusters-keeper/requirements/ci.txt +++ b/services/clusters-keeper/requirements/ci.txt @@ -11,11 +11,11 @@ --requirement _test.txt # installs this repo's packages -../../packages/aws-library -../../packages/models-library -../../packages/pytest-simcore -../../packages/service-library[fastapi] -../../packages/settings-library +simcore-aws-library @ ../../packages/aws-library +simcore-models-library @ ../../packages/models-library +pytest-simcore @ ../../packages/pytest-simcore +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-clusters-keeper @ . diff --git a/services/clusters-keeper/requirements/prod.txt b/services/clusters-keeper/requirements/prod.txt index f009eafa289..a6058884f33 100644 --- a/services/clusters-keeper/requirements/prod.txt +++ b/services/clusters-keeper/requirements/prod.txt @@ -10,9 +10,9 @@ --requirement _base.txt # installs this repo's packages -../../packages/aws-library -../../packages/models-library -../../packages/service-library[fastapi] -../../packages/settings-library +simcore-aws-library @ ../../packages/aws-library +simcore-models-library @ ../../packages/models-library +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-clusters-keeper @ . diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/_meta.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/_meta.py index 5a4051a982b..26c42ea2ca9 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/_meta.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/_meta.py @@ -1,23 +1,21 @@ """ Application's metadata """ -from contextlib import suppress + +from importlib.metadata import distribution, version +from importlib.resources import files from pathlib import Path from typing import Final -import pkg_resources from models_library.basic_types import VersionTag from packaging.version import Version from pydantic import parse_obj_as -_current_distribution = pkg_resources.get_distribution( - "simcore-service-clusters-keeper" -) - -__version__: str = _current_distribution.version +_current_distribution = distribution("simcore-service-clusters-keeper") +__version__: str = version("simcore-service-clusters-keeper") -APP_NAME: Final[str] = _current_distribution.project_name +APP_NAME: Final[str] = _current_distribution.metadata["Name"] API_VERSION: Final[str] = __version__ VERSION: Final[Version] = Version(__version__) API_VTAG: Final[VersionTag] = parse_obj_as(VersionTag, f"v{VERSION.major}") @@ -25,22 +23,11 @@ def get_summary() -> str: - with suppress(Exception): - try: - metadata = _current_distribution.get_metadata_lines("METADATA") - except FileNotFoundError: - metadata = _current_distribution.get_metadata_lines("PKG-INFO") - - return next(x.split(":") for x in metadata if x.startswith("Summary:"))[-1] - return "" # pragma: no cover + return _current_distribution.metadata.get_all("Summary", [""])[-1] SUMMARY: Final[str] = get_summary() -PACKAGE_DATA_FOLDER: Final[Path] = Path( - pkg_resources.resource_filename( - _current_distribution.project_name.replace("-", "_"), "data" - ) -) +PACKAGE_DATA_FOLDER: Final[Path] = Path(f'{files(APP_NAME.replace("-", "_")) / "data"}') # https://patorjk.com/software/taag/#p=testall&f=Avatar&t=clusters_keeper APP_STARTED_BANNER_MSG = r""" diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index e08b819ddfb..d9a3ea9a257 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -80,12 +80,15 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -95,8 +98,8 @@ WORKDIR /build # install base 3rd party dependencies (NOTE: this speeds up devel mode) RUN \ --mount=type=bind,source=services/dask-sidecar/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt # --------------------------Prod-depends-only stage ------------------- @@ -114,8 +117,8 @@ WORKDIR /build/services/dask-sidecar RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/dask-sidecar,target=/build/services/dask-sidecar,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/dask-sidecar/requirements/ci.txt b/services/dask-sidecar/requirements/ci.txt index 00a2f8f637d..63335c18529 100644 --- a/services/dask-sidecar/requirements/ci.txt +++ b/services/dask-sidecar/requirements/ci.txt @@ -11,11 +11,11 @@ --requirement _test.txt # installs this repo's packages -../../packages/dask-task-models-library/ -../../packages/models-library/ -../../packages/pytest-simcore/ -../../packages/service-library/ -../../packages/settings-library/ +simcore-dask-task-models-library @ ../../packages/dask-task-models-library/ +simcore-models-library @ ../../packages/models-library/ +pytest-simcore @ ../../packages/pytest-simcore/ +simcore-service-library @ ../../packages/service-library/ +simcore-settings-library @ ../../packages/settings-library/ # installs current package -. +simcore-service-dask-sidecar @ . diff --git a/services/dask-sidecar/requirements/prod.txt b/services/dask-sidecar/requirements/prod.txt index fd4759028c0..bc5b9b96a69 100644 --- a/services/dask-sidecar/requirements/prod.txt +++ b/services/dask-sidecar/requirements/prod.txt @@ -10,10 +10,10 @@ --requirement _base.txt # installs this repo's packages -../../packages/dask-task-models-library/ -../../packages/models-library/ -../../packages/service-library/ -../../packages/settings-library/ +simcore-dask-task-models-library @ ../../packages/dask-task-models-library/ +simcore-models-library @ ../../packages/models-library/ +simcore-service-library @ ../../packages/service-library/ +simcore-settings-library @ ../../packages/settings-library/ # installs current package -. +simcore-service-dask-sidecar @ . diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index 438dc8dfa50..06629d4e4ca 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -70,13 +70,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -87,8 +90,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/datcore-adapter/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -107,8 +110,8 @@ WORKDIR /build/services/datcore-adapter RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/datcore-adapter,target=/build/services/datcore-adapter,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/datcore-adapter/docker/boot.sh b/services/datcore-adapter/docker/boot.sh index 7048236c0ce..7f8a373f788 100755 --- a/services/datcore-adapter/docker/boot.sh +++ b/services/datcore-adapter/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/datcore-adapter || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/datcore-adapter/requirements/_base.txt b/services/datcore-adapter/requirements/_base.txt index eb652fa1842..7ebda201674 100644 --- a/services/datcore-adapter/requirements/_base.txt +++ b/services/datcore-adapter/requirements/_base.txt @@ -102,6 +102,7 @@ fastapi==0.96.0 # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # fastapi-pagination + # prometheus-fastapi-instrumentator fastapi-pagination==0.10.0 # via -r requirements/_base.in frozenlist==1.3.3 @@ -165,6 +166,12 @@ orjson==3.9.7 # -r requirements/../../../packages/service-library/requirements/./../../../packages/models-library/requirements/_base.in pamqp==3.2.1 # via aiormq +prometheus-client==0.20.0 + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # prometheus-fastapi-instrumentator +prometheus-fastapi-instrumentator==6.1.0 + # via -r requirements/../../../packages/service-library/requirements/_fastapi.in pydantic==1.10.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt diff --git a/services/datcore-adapter/requirements/ci.txt b/services/datcore-adapter/requirements/ci.txt index 65c18eea1ea..ddd345522ae 100644 --- a/services/datcore-adapter/requirements/ci.txt +++ b/services/datcore-adapter/requirements/ci.txt @@ -11,10 +11,10 @@ --requirement _test.txt # installs this repo's packages -../../packages/models-library -../../packages/pytest-simcore -../../packages/service-library[fastapi] -../../packages/settings-library/ +simcore-models-library @ ../../packages/models-library +pytest-simcore @ ../../packages/pytest-simcore +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ # installs current package -. +simcore-service-datcore-adapter @ . diff --git a/services/datcore-adapter/requirements/prod.txt b/services/datcore-adapter/requirements/prod.txt index 1b9fa94bd0f..84a2c86a0b9 100644 --- a/services/datcore-adapter/requirements/prod.txt +++ b/services/datcore-adapter/requirements/prod.txt @@ -10,9 +10,9 @@ --requirement _base.txt # installs this repo's packages -../../packages/models-library -../../packages/service-library[fastapi] -../../packages/settings-library/ +simcore-models-library @ ../../packages/models-library +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ # installs current package -. +simcore-service-datcore-adapter @ . diff --git a/services/datcore-adapter/src/simcore_service_datcore_adapter/_meta.py b/services/datcore-adapter/src/simcore_service_datcore_adapter/_meta.py index a88a68216fc..10a045ca855 100644 --- a/services/datcore-adapter/src/simcore_service_datcore_adapter/_meta.py +++ b/services/datcore-adapter/src/simcore_service_datcore_adapter/_meta.py @@ -1,30 +1,21 @@ """ Application's metadata """ -from contextlib import suppress -from typing import Final - -import pkg_resources -current_distribution = pkg_resources.get_distribution("simcore_service_datcore_adapter") +from importlib.metadata import distribution, version +from typing import Final -__version__ = current_distribution.version +current_distribution = distribution("simcore_service_datcore_adapter") +__version__ = version("simcore_service_datcore_adapter") API_VERSION: Final[str] = __version__ MAJOR, MINOR, PATCH = __version__.split(".") API_VTAG: Final[str] = f"v{MAJOR}" -PROJECT_NAME: Final[str] = current_distribution.project_name +PROJECT_NAME: Final[str] = current_distribution.metadata["Name"] def get_summary() -> str: - with suppress(Exception): - try: - metadata = current_distribution.get_metadata_lines("METADATA") - except FileNotFoundError: - metadata = current_distribution.get_metadata_lines("PKG-INFO") - - return next(x.split(":") for x in metadata if x.startswith("Summary:"))[-1] - return "" + return current_distribution.metadata.get_all("Summary", [""])[-1] summary: str = get_summary() diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index 34f2a0c7f40..3350fc9350b 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -70,13 +70,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -87,8 +90,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/director-v2/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -107,8 +110,8 @@ WORKDIR /build/services/director-v2 RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/director-v2,target=/build/services/director-v2,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/director-v2/docker/boot.sh b/services/director-v2/docker/boot.sh index 64d8dda50d6..56702c716f9 100755 --- a/services/director-v2/docker/boot.sh +++ b/services/director-v2/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/director-v2 || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' @@ -37,7 +38,6 @@ APP_LOG_LEVEL=${DIRECTOR_V2_LOGLEVEL:-${LOG_LEVEL:-${LOGLEVEL:-INFO}}} SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') echo "$INFO" "Log-level app/server: $APP_LOG_LEVEL/$SERVER_LOG_LEVEL" - if [ "${SC_BOOT_MODE}" = "debug" ]; then reload_dir_packages=$(find /devel/packages -maxdepth 3 -type d -path "*/src/*" ! -path "*.*" -exec echo '--reload-dir {} \' \;) diff --git a/services/director-v2/requirements/_base.txt b/services/director-v2/requirements/_base.txt index c768ddf2f95..cf1558c7b28 100644 --- a/services/director-v2/requirements/_base.txt +++ b/services/director-v2/requirements/_base.txt @@ -182,6 +182,7 @@ fastapi==0.99.1 # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in + # prometheus-fastapi-instrumentator frozenlist==1.4.0 # via # aiohttp @@ -352,6 +353,12 @@ partd==1.4.0 # dask pint==0.22 # via -r requirements/../../../packages/simcore-sdk/requirements/_base.in +prometheus-client==0.20.0 + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # prometheus-fastapi-instrumentator +prometheus-fastapi-instrumentator==6.1.0 + # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psutil==5.9.5 # via # -r requirements/../../../services/dask-sidecar/requirements/_dask-distributed.txt diff --git a/services/director-v2/requirements/_test.txt b/services/director-v2/requirements/_test.txt index 64539dae1e5..0613788d0b4 100644 --- a/services/director-v2/requirements/_test.txt +++ b/services/director-v2/requirements/_test.txt @@ -11,9 +11,7 @@ aio-pika==9.1.2 aioboto3==12.0.0 # via -r requirements/_test.in aiobotocore==2.7.0 - # via - # aioboto3 - # aiobotocore + # via aioboto3 aiohttp==3.8.5 # via # -c requirements/../../../requirements/constraints.txt @@ -88,9 +86,7 @@ cloudpickle==2.2.1 colorlog==6.7.0 # via dask-gateway-server coverage==7.3.2 - # via - # coverage - # pytest-cov + # via pytest-cov cryptography==41.0.7 # via # -c requirements/../../../requirements/constraints.txt diff --git a/services/director-v2/requirements/ci.txt b/services/director-v2/requirements/ci.txt index bb142c7d5cc..bda1da73082 100644 --- a/services/director-v2/requirements/ci.txt +++ b/services/director-v2/requirements/ci.txt @@ -12,14 +12,14 @@ --requirement _test.txt # installs this repo's packages -../../packages/dask-task-models-library/ -../../packages/models-library -../../packages/postgres-database -../../packages/pytest-simcore/ -../../packages/service-library[fastapi] -../../packages/settings-library/ -../../packages/simcore-sdk/ +simcore-dask-task-models-library @ ../../packages/dask-task-models-library/ +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database +pytest-simcore @ ../../packages/pytest-simcore/ +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ +simcore-sdk @ ../../packages/simcore-sdk/ # installs current package -. +simcore-service-director-v2 @ . diff --git a/services/director-v2/requirements/prod.txt b/services/director-v2/requirements/prod.txt index dd2894e17ef..db23e34b436 100644 --- a/services/director-v2/requirements/prod.txt +++ b/services/director-v2/requirements/prod.txt @@ -10,12 +10,12 @@ --requirement _base.txt # installs this repo's packages -../../packages/dask-task-models-library/ -../../packages/models-library -../../packages/postgres-database/ -../../packages/service-library[fastapi] -../../packages/settings-library/ -../../packages/simcore-sdk/ +simcore-dask-task-models-library @ ../../packages/dask-task-models-library/ +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database/ +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ +simcore-sdk @ ../../packages/simcore-sdk/ # installs current package -. +simcore-service-director-v2 @ . diff --git a/services/director-v2/tests/unit/test_models_clusters.py b/services/director-v2/tests/unit/test_models_clusters.py index 8628d76d706..0a5d29283bb 100644 --- a/services/director-v2/tests/unit/test_models_clusters.py +++ b/services/director-v2/tests/unit/test_models_clusters.py @@ -12,7 +12,9 @@ Worker, WorkerMetrics, ) +from models_library.clusters import ClusterTypeInModel from pydantic import BaseModel, parse_obj_as +from simcore_postgres_database.models.clusters import ClusterType @pytest.mark.parametrize( @@ -76,3 +78,23 @@ def test_worker_constructor_corrects_negative_used_resources(faker: Faker): ) assert worker assert worker.used_resources["CPU"] == 0 + + +def test_cluster_type_in_model_includes_postgres_database_model(): + models_library_cluster_types_names: set[str] = { + t.name for t in set(ClusterTypeInModel) + } + postgres_library_cluster_types_names: set[str] = {t.name for t in set(ClusterType)} + assert postgres_library_cluster_types_names.issubset( + models_library_cluster_types_names + ) + + models_library_cluster_types_values: set[str] = { + t.value for t in set(ClusterTypeInModel) + } # type: ignore + postgres_library_cluster_types_values: set[str] = { + t.value for t in set(ClusterType) + } + assert postgres_library_cluster_types_values.issubset( + models_library_cluster_types_values + ) diff --git a/services/director/Dockerfile b/services/director/Dockerfile index 57fc7f0e558..fbd6bf4b0c6 100644 --- a/services/director/Dockerfile +++ b/services/director/Dockerfile @@ -83,7 +83,7 @@ RUN --mount=type=cache,id=buildbasecache36,target=/var/cache/apt,mode=0755,shari # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN python -m venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ +RUN --mount=type=cache,id=pip36,mode=0755,target=/root/.cache/pip \ pip install --upgrade \ pip~=21.3 \ wheel \ @@ -93,7 +93,6 @@ RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/director,target=/build/services/director,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip \ pip install \ -r /build/services/director/requirements/_base.txt @@ -116,7 +115,6 @@ ENV SC_BUILD_TARGET=prod-only-deps RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/director,target=/build/services/director,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip \ pip install -r requirements/prod.txt # --------------------------Production stage ------------------- diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index 0a9554878e9..bad3d798862 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -69,13 +69,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -86,8 +89,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/dynamic-scheduler/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -107,8 +110,8 @@ WORKDIR /build/services/dynamic-scheduler RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/dynamic-scheduler,target=/build/services/dynamic-scheduler,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/dynamic-scheduler/docker/boot.sh b/services/dynamic-scheduler/docker/boot.sh index cfe6f122124..b398ad39634 100755 --- a/services/dynamic-scheduler/docker/boot.sh +++ b/services/dynamic-scheduler/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/dynamic-scheduler || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/dynamic-scheduler/requirements/_base.txt b/services/dynamic-scheduler/requirements/_base.txt index 86711966429..b7180d39e22 100644 --- a/services/dynamic-scheduler/requirements/_base.txt +++ b/services/dynamic-scheduler/requirements/_base.txt @@ -104,6 +104,7 @@ fastapi==0.99.1 # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in + # prometheus-fastapi-instrumentator frozenlist==1.4.0 # via # aiohttp @@ -177,6 +178,12 @@ packaging==23.2 # via -r requirements/_base.in pamqp==3.2.1 # via aiormq +prometheus-client==0.20.0 + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # prometheus-fastapi-instrumentator +prometheus-fastapi-instrumentator==6.1.0 + # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psycopg2-binary==2.9.9 # via sqlalchemy pydantic==1.10.13 diff --git a/services/dynamic-scheduler/requirements/ci.txt b/services/dynamic-scheduler/requirements/ci.txt index dfc16ddd32e..cfd40e964d9 100644 --- a/services/dynamic-scheduler/requirements/ci.txt +++ b/services/dynamic-scheduler/requirements/ci.txt @@ -11,10 +11,10 @@ --requirement _test.txt # installs this repo's packages -../../packages/models-library -../../packages/postgres-database -../../packages/pytest-simcore -../../packages/service-library[fastapi] -../../packages/settings-library +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database +pytest-simcore @ ../../packages/pytest-simcore +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-dynamic-scheduler @ . diff --git a/services/dynamic-scheduler/requirements/prod.txt b/services/dynamic-scheduler/requirements/prod.txt index fcb1eea4bfb..70d03a1a7c9 100644 --- a/services/dynamic-scheduler/requirements/prod.txt +++ b/services/dynamic-scheduler/requirements/prod.txt @@ -10,10 +10,10 @@ --requirement _base.txt # installs this repo's packages -../../packages/models-library -../../packages/postgres-database -../../packages/service-library[fastapi] -../../packages/settings-library +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-dynamic-scheduler @ . diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index f43f68c6bd1..16b80a87cc8 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -100,13 +100,17 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 + # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" \ +RUN uv venv "${VIRTUAL_ENV}" \ && mkdir -p "${DYNAMIC_SIDECAR_DY_VOLUMES_MOUNT_DIR}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -119,8 +123,7 @@ WORKDIR /build RUN \ --mount=type=bind,source=services/dynamic-sidecar/requirements/_base.txt,target=_base.txt \ --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install \ - --no-build-isolation \ + uv pip install \ --requirement _base.txt # copy utility devops scripts @@ -142,9 +145,8 @@ WORKDIR /build/services/dynamic-sidecar RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/dynamic-sidecar,target=/build/services/dynamic-sidecar,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ - --no-build-isolation \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/dynamic-sidecar/Makefile b/services/dynamic-sidecar/Makefile index 3750bab5d5e..47ce25200d5 100644 --- a/services/dynamic-sidecar/Makefile +++ b/services/dynamic-sidecar/Makefile @@ -27,9 +27,7 @@ openapi.json: .env ## Creates OAS document openapi.json run-github-action-locally: ## runs "unit-test-dynamic-sidecar" defined int github workflow locally @make github-workflow-job job=unit-test-dynamic-sidecar -# WARNING: tmp using --no-build-isolation due to: https://github.com/yaml/pyyaml/issues/724#issuecomment-1638636728 install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # Installing in $(subst install-,,$@) mode - pip-sync \ - --pip-args --no-build-isolation \ + @uv pip sync \ requirements/$(subst install-,,$@).txt diff --git a/services/dynamic-sidecar/docker/boot.sh b/services/dynamic-sidecar/docker/boot.sh index d037d9bb3f6..248b6716663 100755 --- a/services/dynamic-sidecar/docker/boot.sh +++ b/services/dynamic-sidecar/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/dynamic-sidecar || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/dynamic-sidecar/openapi.json b/services/dynamic-sidecar/openapi.json index e634d69fd4a..c7c0824e3de 100644 --- a/services/dynamic-sidecar/openapi.json +++ b/services/dynamic-sidecar/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "simcore-service-dynamic-sidecar", - "description": " Implements a sidecar service to manage user's dynamic/interactive services", + "description": "Implements a sidecar service to manage user's dynamic/interactive services", "version": "1.1.1" }, "servers": [ diff --git a/services/dynamic-sidecar/requirements/ci.txt b/services/dynamic-sidecar/requirements/ci.txt index dffd2697d65..9c8e7a5ca7a 100644 --- a/services/dynamic-sidecar/requirements/ci.txt +++ b/services/dynamic-sidecar/requirements/ci.txt @@ -12,12 +12,12 @@ --requirement _tools.txt # installs this repo's packages -../../packages/models-library/ -../../packages/postgres-database/ -../../packages/pytest-simcore/ -../../packages/simcore-sdk -../../packages/service-library[fastapi] -../../packages/settings-library/ +simcore-models-library @ ../../packages/models-library/ +simcore-postgres-database @ ../../packages/postgres-database/ +pytest-simcore @ ../../packages/pytest-simcore/ +simcore-sdk @ ../../packages/simcore-sdk +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ # installs current package -. +simcore-service-dynamic-sidecar @ . diff --git a/services/dynamic-sidecar/requirements/prod.txt b/services/dynamic-sidecar/requirements/prod.txt index a30978c96a0..90f40cf30d3 100644 --- a/services/dynamic-sidecar/requirements/prod.txt +++ b/services/dynamic-sidecar/requirements/prod.txt @@ -10,11 +10,11 @@ --requirement _base.txt # installs this repo's packages -../../packages/models-library/ -../../packages/postgres-database/ -../../packages/simcore-sdk -../../packages/service-library[fastapi] -../../packages/settings-library/ +simcore-models-library @ ../../packages/models-library/ +simcore-postgres-database @ ../../packages/postgres-database/ +simcore-sdk @ ../../packages/simcore-sdk +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ # installs current package -. +simcore-service-dynamic-sidecar @ . diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/_meta.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/_meta.py index 6ad0476a54a..2c9fb9d5c50 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/_meta.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/_meta.py @@ -1,32 +1,22 @@ """ Package Metadata """ -from contextlib import suppress -import pkg_resources +from importlib.metadata import distribution, version -_current_distribution = pkg_resources.get_distribution( - "simcore-service-dynamic-sidecar" -) +_current_distribution = distribution("simcore-service-dynamic-sidecar") -PROJECT_NAME: str = _current_distribution.project_name +PROJECT_NAME: str = _current_distribution.metadata["Name"] -API_VERSION: str = _current_distribution.version -MAJOR, MINOR, PATCH = _current_distribution.version.split(".") +API_VERSION: str = version("simcore-service-dynamic-sidecar") +MAJOR, MINOR, PATCH = API_VERSION.split(".") API_VTAG: str = f"v{MAJOR}" __version__ = _current_distribution.version def get_summary() -> str: - with suppress(Exception): - try: - metadata = _current_distribution.get_metadata_lines("METADATA") - except FileNotFoundError: - metadata = _current_distribution.get_metadata_lines("PKG-INFO") - - return next(x.split(":") for x in metadata if x.startswith("Summary:"))[-1] - return "" + return _current_distribution.metadata.get_all("Summary", [""])[-1] SUMMARY: str = get_summary() diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index c06116776fa..239cc2be909 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -69,13 +69,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -86,8 +89,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/invitations/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -107,8 +110,8 @@ WORKDIR /build/services/invitations RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/invitations,target=/build/services/invitations,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/invitations/docker/boot.sh b/services/invitations/docker/boot.sh index 5301fd05276..adbe01b6bf4 100755 --- a/services/invitations/docker/boot.sh +++ b/services/invitations/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/invitations || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/invitations/openapi.json b/services/invitations/openapi.json index a097a70b80f..96630799e46 100644 --- a/services/invitations/openapi.json +++ b/services/invitations/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "simcore-service-invitations web API", - "description": " Service that manages creation and validation of registration invitations", + "description": "Service that manages creation and validation of registration invitations", "version": "1.2.0" }, "paths": { diff --git a/services/invitations/requirements/_base.txt b/services/invitations/requirements/_base.txt index eca76d05678..f4b0934d96c 100644 --- a/services/invitations/requirements/_base.txt +++ b/services/invitations/requirements/_base.txt @@ -111,6 +111,7 @@ fastapi==0.99.1 # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in + # prometheus-fastapi-instrumentator frozenlist==1.4.0 # via # aiohttp @@ -165,6 +166,12 @@ packaging==23.2 # via -r requirements/_base.in pamqp==3.2.1 # via aiormq +prometheus-client==0.20.0 + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # prometheus-fastapi-instrumentator +prometheus-fastapi-instrumentator==6.1.0 + # via -r requirements/../../../packages/service-library/requirements/_fastapi.in pycparser==2.21 # via cffi pydantic==1.10.13 diff --git a/services/invitations/requirements/ci.txt b/services/invitations/requirements/ci.txt index 38a4d0441ba..bbc14fe4596 100644 --- a/services/invitations/requirements/ci.txt +++ b/services/invitations/requirements/ci.txt @@ -11,10 +11,10 @@ --requirement _test.txt # installs this repo's packages -../../packages/pytest-simcore -../../packages/service-library[fastapi] -../../packages/settings-library -../../packages/models-library +pytest-simcore @ ../../packages/pytest-simcore +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library +simcore-models-library @ ../../packages/models-library # installs current package -. +simcore-service-invitations @ . diff --git a/services/invitations/requirements/prod.txt b/services/invitations/requirements/prod.txt index 5ff788ade8d..d9d82ca6a03 100644 --- a/services/invitations/requirements/prod.txt +++ b/services/invitations/requirements/prod.txt @@ -10,8 +10,8 @@ --requirement _base.txt # installs this repo's packages -../../packages/service-library[fastapi] -../../packages/settings-library -../../packages/models-library +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library +simcore-models-library @ ../../packages/models-library # installs current package -. +simcore-service-invitations @ . diff --git a/services/migration/Dockerfile b/services/migration/Dockerfile index a7f17681f92..4d52609801b 100644 --- a/services/migration/Dockerfile +++ b/services/migration/Dockerfile @@ -43,12 +43,15 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential \ git +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -58,8 +61,8 @@ WORKDIR /build/packages/postgres-database # install only base 3rd party dependencies RUN \ --mount=type=bind,source=packages/postgres-database,target=/build/packages/postgres-database,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/migration/requirements/ci.txt b/services/migration/requirements/ci.txt index 5d9705fd64a..f27407610d3 100644 --- a/services/migration/requirements/ci.txt +++ b/services/migration/requirements/ci.txt @@ -13,4 +13,4 @@ --requirement _tools.txt # installs this repo's packages -../../packages/pytest-simcore/ +pytest-simcore @ ../../packages/pytest-simcore/ diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index ba28daf0339..dd040f4bf4e 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -72,11 +72,14 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ git \ golang-go +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN uv venv "${VIRTUAL_ENV}" +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -86,8 +89,8 @@ WORKDIR /build # install base 3rd party dependencies (NOTE: this speeds up devel mode) RUN \ --mount=type=bind,source=services/osparc-gateway-server/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt # in ARM64 mode there is a catch: the piwheels package does not contain the dask-gateway-proxy executable in 64-bit @@ -95,7 +98,7 @@ RUN dpkgArch="$(dpkg --print-architecture)";\ case "$dpkgArch" in \ arm64) git clone --depth 1 --branch 0.9.0 https://github.com/dask/dask-gateway.git \ && cd dask-gateway/osparc-gateway-server \ - && pip install .\ + && uv pip install .\ ;; \ esac; @@ -114,8 +117,8 @@ WORKDIR /build/services/osparc-gateway-server RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/osparc-gateway-server,target=/build/services/osparc-gateway-server,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt # --------------------------Production stage ------------------- diff --git a/services/osparc-gateway-server/requirements/ci.txt b/services/osparc-gateway-server/requirements/ci.txt index 62a403e8be1..52012f537ff 100644 --- a/services/osparc-gateway-server/requirements/ci.txt +++ b/services/osparc-gateway-server/requirements/ci.txt @@ -12,7 +12,7 @@ --requirement _test.txt # installs this repo's packages -../../packages/pytest-simcore/ +pytest-simcore @ ../../packages/pytest-simcore/ # installs current package -. +osparc-gateway-server @ . diff --git a/services/osparc-gateway-server/requirements/prod.txt b/services/osparc-gateway-server/requirements/prod.txt index fb384898a6a..45b869b18cf 100644 --- a/services/osparc-gateway-server/requirements/prod.txt +++ b/services/osparc-gateway-server/requirements/prod.txt @@ -12,4 +12,4 @@ # installs this repo's packages # installs current package -. +osparc-gateway-server @ . diff --git a/services/osparc-gateway-server/tests/system/Makefile b/services/osparc-gateway-server/tests/system/Makefile index c9bd237e523..fc9cd92a3f5 100644 --- a/services/osparc-gateway-server/tests/system/Makefile +++ b/services/osparc-gateway-server/tests/system/Makefile @@ -15,7 +15,7 @@ install: install-ci install-dev install-prod install-ci: _check_venv_active ## install requirements in dev/prod/ci mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: tests diff --git a/services/osparc-gateway-server/tests/system/requirements/ci.txt b/services/osparc-gateway-server/tests/system/requirements/ci.txt index 0c449f919a7..e7dffa997f3 100644 --- a/services/osparc-gateway-server/tests/system/requirements/ci.txt +++ b/services/osparc-gateway-server/tests/system/requirements/ci.txt @@ -10,4 +10,4 @@ --requirement _test.txt # installs this repo's packages -../../../../packages/pytest-simcore/ +pytest-simcore @ ../../../../packages/pytest-simcore/ diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index 891850f0713..9fc5999ea4a 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -69,13 +69,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -86,8 +89,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/payments/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -107,8 +110,8 @@ WORKDIR /build/services/payments RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/payments,target=/build/services/payments,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/payments/docker/boot.sh b/services/payments/docker/boot.sh index 4a93866f5af..ca87461de76 100755 --- a/services/payments/docker/boot.sh +++ b/services/payments/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/payments || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/payments/openapi.json b/services/payments/openapi.json index 0a0590edf31..1a98e0f98ae 100644 --- a/services/payments/openapi.json +++ b/services/payments/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "simcore-service-payments web API", - "description": " Service that manages creation and validation of registration payments", + "description": "Service that manages creation and validation of registration payments", "version": "1.4.0" }, "paths": { diff --git a/services/payments/requirements/ci.txt b/services/payments/requirements/ci.txt index f50016e3924..fb0d44c3a77 100644 --- a/services/payments/requirements/ci.txt +++ b/services/payments/requirements/ci.txt @@ -11,10 +11,10 @@ --requirement _test.txt # installs this repo's packages -../../packages/models-library -../../packages/postgres-database -../../packages/pytest-simcore -../../packages/service-library[fastapi] -../../packages/settings-library +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database +pytest-simcore @ ../../packages/pytest-simcore +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-payments @ . diff --git a/services/payments/requirements/prod.txt b/services/payments/requirements/prod.txt index fcb1eea4bfb..40cb40fdc64 100644 --- a/services/payments/requirements/prod.txt +++ b/services/payments/requirements/prod.txt @@ -10,10 +10,10 @@ --requirement _base.txt # installs this repo's packages -../../packages/models-library -../../packages/postgres-database -../../packages/service-library[fastapi] -../../packages/settings-library +simcore-models-library @ ../../packages/models-library +simcore-postgres-database @ ../../packages/postgres-database +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library # installs current package -. +simcore-service-payments @ . diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index 8fca041ba0b..3992dbe1c33 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -70,13 +70,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -87,8 +90,8 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/resource-usage-tracker/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt @@ -107,8 +110,8 @@ WORKDIR /build/services/resource-usage-tracker RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/resource-usage-tracker,target=/build/services/resource-usage-tracker,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/resource-usage-tracker/docker/boot.sh b/services/resource-usage-tracker/docker/boot.sh index f8daef19c96..7491c3b8b30 100755 --- a/services/resource-usage-tracker/docker/boot.sh +++ b/services/resource-usage-tracker/docker/boot.sh @@ -24,7 +24,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/resource-usage-tracker || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/resource-usage-tracker/openapi.json b/services/resource-usage-tracker/openapi.json index 7fba1c609d7..c1c88a2cfcb 100644 --- a/services/resource-usage-tracker/openapi.json +++ b/services/resource-usage-tracker/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.2", "info": { "title": "simcore-service-resource-usage-tracker web API", - "description": " Service that collects and stores computational resources usage used in osparc-simcore", + "description": "Service that collects and stores computational resources usage used in osparc-simcore", "version": "1.0.0" }, "paths": { diff --git a/services/resource-usage-tracker/requirements/ci.txt b/services/resource-usage-tracker/requirements/ci.txt index 75eecce1dbd..9cfb2df141d 100644 --- a/services/resource-usage-tracker/requirements/ci.txt +++ b/services/resource-usage-tracker/requirements/ci.txt @@ -11,12 +11,12 @@ --requirement _test.txt # installs this repo's packages -../../packages/aws-library -../../packages/models-library -../../packages/pytest-simcore -../../packages/service-library[fastapi] -../../packages/settings-library -../../packages/postgres-database +simcore-aws-library @ ../../packages/aws-library +simcore-models-library @ ../../packages/models-library +pytest-simcore @ ../../packages/pytest-simcore +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library +simcore-postgres-database @ ../../packages/postgres-database # installs current package -. +simcore-service-resource-usage-tracker @ . diff --git a/services/resource-usage-tracker/requirements/prod.txt b/services/resource-usage-tracker/requirements/prod.txt index 9ecf27e6f13..12f20069255 100644 --- a/services/resource-usage-tracker/requirements/prod.txt +++ b/services/resource-usage-tracker/requirements/prod.txt @@ -10,10 +10,10 @@ --requirement _base.txt # installs this repo's packages -../../packages/aws-library -../../packages/models-library -../../packages/service-library[fastapi] -../../packages/settings-library -../../packages/postgres-database +simcore-aws-library @ ../../packages/aws-library +simcore-models-library @ ../../packages/models-library +simcore-service-library[fastapi] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library +simcore-postgres-database @ ../../packages/postgres-database # installs current package -. +simcore-service-resource-usage-tracker @ . diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 8d69b81be24..b52bca35937 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -78,13 +78,16 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential \ git +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -94,8 +97,8 @@ WORKDIR /build # install only base 3rd party dependencies RUN \ --mount=type=bind,source=services/storage/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt # -------------------------- ------------------------------- @@ -119,8 +122,8 @@ WORKDIR /build/services/storage RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/storage,target=/build/services/storage,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v # -------------------------- ------------------------------- diff --git a/services/storage/docker/boot.sh b/services/storage/docker/boot.sh index c975105896a..5cddf1f3681 100755 --- a/services/storage/docker/boot.sh +++ b/services/storage/docker/boot.sh @@ -19,7 +19,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/storage || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/storage/requirements/_base.txt b/services/storage/requirements/_base.txt index a1228cf23df..c91070d6001 100644 --- a/services/storage/requirements/_base.txt +++ b/services/storage/requirements/_base.txt @@ -11,9 +11,7 @@ aio-pika==9.3.0 aioboto3==12.0.0 # via -r requirements/_base.in aiobotocore==2.7.0 - # via - # aioboto3 - # aiobotocore + # via aioboto3 aiodebug==2.3.0 # via # -c requirements/../../../packages/service-library/requirements/./_base.in diff --git a/services/storage/requirements/_test.txt b/services/storage/requirements/_test.txt index 7ec93eb89ab..44f9b003b9b 100644 --- a/services/storage/requirements/_test.txt +++ b/services/storage/requirements/_test.txt @@ -11,7 +11,7 @@ aiohttp==3.8.6 # aioresponses # pytest-aiohttp # simcore-service-storage-sdk -aioresponses==0.7.4 +aioresponses==0.7.6 # via -r requirements/_test.in aiosignal==1.3.1 # via @@ -261,9 +261,7 @@ python-dateutil==2.8.2 python-dotenv==1.0.0 # via -r requirements/_test.in python-jose==3.3.0 - # via - # moto - # python-jose + # via moto pytz==2023.3.post1 # via pandas pyyaml==6.0.1 diff --git a/services/storage/requirements/ci.txt b/services/storage/requirements/ci.txt index 0430e628686..983135c3d6c 100644 --- a/services/storage/requirements/ci.txt +++ b/services/storage/requirements/ci.txt @@ -11,11 +11,11 @@ --requirement _test.txt # installs this repo's packages -../../packages/models-library/ -../../packages/postgres-database/ -../../packages/pytest-simcore/ -../../packages/service-library[aiohttp] -../../packages/settings-library/ +simcore-models-library @ ../../packages/models-library/ +simcore-postgres-database @ ../../packages/postgres-database/ +pytest-simcore @ ../../packages/pytest-simcore/ +simcore-service-library[aiohttp] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ # installs current package -. +simcore-service-storage @ . diff --git a/services/storage/requirements/prod.txt b/services/storage/requirements/prod.txt index 2024e7cc8f5..d8b3f5543f8 100644 --- a/services/storage/requirements/prod.txt +++ b/services/storage/requirements/prod.txt @@ -10,10 +10,10 @@ --requirement _base.txt # installs this repo's packages -../../packages/models-library/ -../../packages/postgres-database/ -../../packages/service-library[aiohttp] -../../packages/settings-library/ +simcore-models-library @ ../../packages/models-library/ +simcore-postgres-database @ ../../packages/postgres-database/ +simcore-service-library[aiohttp] @ ../../packages/service-library +simcore-settings-library @ ../../packages/settings-library/ # installs current package -. +simcore-service-storage @ . diff --git a/services/storage/src/simcore_service_storage/_meta.py b/services/storage/src/simcore_service_storage/_meta.py index f1ca8c783f9..c1ac93fd8ea 100644 --- a/services/storage/src/simcore_service_storage/_meta.py +++ b/services/storage/src/simcore_service_storage/_meta.py @@ -1,18 +1,20 @@ """ Current version of the simcore_service_storage application and its API """ -import pkg_resources -from semantic_version import Version -__version__: str = pkg_resources.get_distribution("simcore-service-storage").version +from importlib.metadata import version + +from semantic_version import Version -version = Version(__version__) +__version__: str = version("simcore-service-storage") -api_version_prefix: str = f"v{version.major}" +version_info = Version(__version__) +assert version_info.major is not None # nosec +api_version_prefix: str = f"v{version_info.major}" app_name: str = __name__.split(".")[0] api_version: str = __version__ -api_vtag: str = f"v{version.major}" +api_vtag: str = f"v{version_info.major}" ## https://patorjk.com/software/taag/#p=display&f=Standard&t=Storage diff --git a/services/storage/src/simcore_service_storage/application.py b/services/storage/src/simcore_service_storage/application.py index 4b12edf4c7a..b303afe457b 100644 --- a/services/storage/src/simcore_service_storage/application.py +++ b/services/storage/src/simcore_service_storage/application.py @@ -2,6 +2,7 @@ Functions to create, setup and run an aiohttp application provided a settingsuration object """ + import logging from typing import Final @@ -11,7 +12,7 @@ from servicelib.aiohttp.monitoring import setup_monitoring from servicelib.aiohttp.tracing import setup_tracing -from ._meta import WELCOME_MSG, app_name, version +from ._meta import WELCOME_MSG, app_name, version_info from .db import setup_db from .dsm import setup_dsm from .dsm_cleaner import setup_dsm_cleaner @@ -74,7 +75,7 @@ def create(settings: Settings) -> web.Application: setup_dev_error_logger(app) if settings.STORAGE_MONITORING_ENABLED: - setup_monitoring(app, app_name, version=f"{version}") + setup_monitoring(app, app_name, version=f"{version_info}") # keep mostly quiet noisy loggers quiet_level: int = max( diff --git a/services/web/Dockerfile b/services/web/Dockerfile index e2053ee9265..23a9d47c18c 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -80,14 +80,17 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential +# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ + pip install uv~=0.1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv -RUN python -m venv "${VIRTUAL_ENV}" +RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ +RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install --upgrade \ pip~=24.0 \ wheel \ setuptools @@ -97,8 +100,8 @@ WORKDIR /build # install only base 3rd party dependencies RUN \ --mount=type=bind,source=services/web/server/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement _base.txt # --------------------------Prod-depends-only stage ------------------- @@ -117,8 +120,8 @@ WORKDIR /build/services/web/server RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/web/server,target=/build/services/web/server,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \ - pip install \ + --mount=type=cache,mode=0755,target=/root/.cache/uv \ + uv pip install \ --requirement requirements/prod.txt \ && pip list -v diff --git a/services/web/server/docker/boot.sh b/services/web/server/docker/boot.sh index c2635f40566..67e2ca9ca18 100755 --- a/services/web/server/docker/boot.sh +++ b/services/web/server/docker/boot.sh @@ -19,7 +19,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/web/server || exit 1 - pip --quiet --no-cache-dir install -r requirements/dev.txt + pip install uv + uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" pip list | sed 's/^/ /' @@ -44,7 +45,7 @@ if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: ptvsd is programmatically enabled inside of the service # this way we can have reload in place as well exec python -m debugpy --listen 0.0.0.0:"${WEBSERVER_REMOTE_DEBUGGING_PORT}" -m gunicorn simcore_service_webserver.cli:app_factory \ - --log-level="${SERVER_LOG_LEVEL}"\ + --log-level="${SERVER_LOG_LEVEL}" \ --bind 0.0.0.0:8080 \ --worker-class aiohttp.GunicornWebWorker \ --workers="${WEBSERVER_GUNICORN_WORKERS:-1}" \ diff --git a/services/web/server/requirements/_base.txt b/services/web/server/requirements/_base.txt index 9af3cba1d83..6ae4fb1dd2e 100644 --- a/services/web/server/requirements/_base.txt +++ b/services/web/server/requirements/_base.txt @@ -1,59 +1,12 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --output-file=requirements/_base.txt --strip-extras requirements/_base.in -# +# This file was autogenerated by uv via the following command: +# uv pip compile --upgrade-package aiopg --build-isolation --strip-extras --resolver=backtracking --output-file requirements/_base.txt requirements/_base.in aio-pika==9.1.2 - # via - # -c requirements/../../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/_base.in aiocache==0.11.1 - # via - # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in aiodebug==2.3.0 - # via - # -c requirements/../../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/_base.in aiodocker==0.21.0 - # via - # -c requirements/../../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in aiofiles==0.8.0 - # via - # -c requirements/../../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in aiohttp==3.8.5 # 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/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/_aiohttp.in - # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in # aiodocker # aiohttp-jinja2 # aiohttp-security @@ -61,79 +14,35 @@ aiohttp==3.8.5 # aiohttp-swagger # aiozipkin aiohttp-jinja2==1.5 - # via -r requirements/_base.in aiohttp-security==0.4.0 - # via -r requirements/_base.in aiohttp-session==2.11.0 - # via -r requirements/_base.in aiohttp-swagger==1.0.16 - # via -r requirements/_base.in aiopg==1.4.0 - # via - # -r requirements/../../../../packages/service-library/requirements/_aiohttp.in - # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in aiormq==6.7.6 # via aio-pika aiosignal==1.2.0 # via aiohttp aiosmtplib==1.1.6 - # via -r requirements/_base.in aiozipkin==1.1.1 - # via -r requirements/../../../../packages/service-library/requirements/_aiohttp.in alembic==1.8.1 - # via - # -r requirements/../../../../packages/postgres-database/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in arrow==1.2.3 - # via - # -c requirements/../../../../packages/service-library/requirements/./_base.in - # -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/service-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/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in async-timeout==4.0.2 # via # aiohttp # aiopg # redis asyncpg==0.27.0 - # via - # -r requirements/_base.in - # sqlalchemy + # via sqlalchemy attrs==21.4.0 # via - # -r requirements/../../../../packages/service-library/requirements/_aiohttp.in # aiohttp # jsonschema # openapi-core bidict==0.22.0 # via python-socketio cachetools==5.3.2 - # via -r requirements/_base.in certifi==2023.7.22 - # 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/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 - # requests + # via requests cffi==1.15.0 # via cryptography charset-normalizer==2.0.12 @@ -143,26 +52,7 @@ charset-normalizer==2.0.12 click==8.1.3 # via typer cryptography==41.0.7 - # 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/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/_base.in - # aiohttp-session + # via aiohttp-session dnspython==2.2.1 # via email-validator email-validator==1.2.1 @@ -170,7 +60,6 @@ email-validator==1.2.1 et-xmlfile==1.1.0 # via openpyxl faker==19.6.1 - # via -r requirements/_base.in frozenlist==1.3.0 # via # aiohttp @@ -178,7 +67,6 @@ frozenlist==1.3.0 greenlet==2.0.2 # via sqlalchemy gunicorn==20.1.0 - # via -r requirements/_base.in idna==3.3 # via # email-validator @@ -187,64 +75,20 @@ idna==3.3 isodate==0.6.1 # via openapi-core jinja-app-loader==1.0.2 - # via -r requirements/_base.in jinja2==3.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/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 # aiohttp-jinja2 # aiohttp-swagger json2html==1.3.0 - # via -r requirements/_base.in jsondiff==2.0.0 - # via -r requirements/_base.in jsonschema==3.2.0 # 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/service-library/requirements/_aiohttp.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 # openapi-schema-validator # openapi-spec-validator lazy-object-proxy==1.7.1 # via openapi-core mako==1.2.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/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 - # alembic + # via alembic markdown-it-py==3.0.0 # via rich markupsafe==2.1.1 @@ -254,41 +98,23 @@ markupsafe==2.1.1 mdurl==0.1.2 # via markdown-it-py msgpack==1.0.7 - # via -r requirements/_base.in multidict==6.0.2 # via # aiohttp # yarl openapi-core==0.12.0 - # via -r requirements/../../../../packages/service-library/requirements/_aiohttp.in openapi-schema-validator==0.2.3 # via openapi-spec-validator openapi-spec-validator==0.4.0 # via openapi-core openpyxl==3.0.9 - # via -r requirements/_base.in orjson==3.7.2 - # 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 packaging==23.1 - # via - # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in pamqp==3.2.1 # via aiormq passlib==1.7.4 - # via -r requirements/_base.in pint==0.19.2 - # via - # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in prometheus-client==0.14.1 - # via -r requirements/../../../../packages/service-library/requirements/_aiohttp.in psycopg2-binary==2.9.6 # via # aiopg @@ -296,46 +122,9 @@ psycopg2-binary==2.9.6 pycparser==2.21 # via cffi pydantic==1.9.0 - # 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/models-library/requirements/_base.in - # -r requirements/../../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/service-library/requirements/./../../../packages/models-library/requirements/_base.in - # -r requirements/../../../../packages/service-library/requirements/./../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/settings-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/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in pygments==2.15.1 # via rich pyinstrument==4.6.1 - # via - # -c requirements/../../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in pyjwt==2.4.0 # via twilio pyrsistent==0.18.1 @@ -347,69 +136,24 @@ python-dateutil==2.8.2 python-engineio==4.3.4 # via python-socketio python-magic==0.4.25 - # via -r requirements/_base.in python-socketio==5.8.0 - # via -r requirements/_base.in pytz==2022.1 # via twilio pyyaml==6.0.1 # 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 # aiohttp-swagger # openapi-spec-validator redis==4.5.4 - # 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 - # -r requirements/_base.in requests==2.31.0 # via twilio rich==13.4.2 - # via - # -r requirements/../../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/service-library/requirements/./../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in setproctitle==1.2.3 # via gunicorn +setuptools==69.1.1 + # via + # gunicorn + # jsonschema + # openapi-spec-validator six==1.16.0 # via # isodate @@ -418,111 +162,27 @@ six==1.16.0 # python-dateutil sqlalchemy==1.4.47 # 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/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/postgres-database/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in # aiopg # alembic strict-rfc3339==0.7 # via openapi-core tenacity==8.0.1 - # via - # -c requirements/../../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in toolz==0.12.0 - # via - # -c requirements/../../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in tqdm==4.64.0 - # via - # -c requirements/../../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in twilio==7.12.0 - # via -r requirements/_base.in typer==0.4.1 - # via - # -r requirements/../../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/service-library/requirements/./../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in typing-extensions==4.3.0 # via # aiodebug # aiodocker # pydantic ujson==5.5.0 - # 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/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 - # aiohttp-swagger + # via aiohttp-swagger urllib3==1.26.11 - # 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/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 - # requests + # via requests werkzeug==2.1.2 - # via -r requirements/../../../../packages/service-library/requirements/_aiohttp.in yarl==1.5.1 # via - # -c requirements/./constraints.txt - # -r requirements/../../../../packages/postgres-database/requirements/_base.in - # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in # aio-pika # aiohttp # aiormq - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/services/web/server/requirements/_test.txt b/services/web/server/requirements/_test.txt index c8386dda21f..e2f37a19cc9 100644 --- a/services/web/server/requirements/_test.txt +++ b/services/web/server/requirements/_test.txt @@ -1,57 +1,33 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --output-file=requirements/_test.txt --strip-extras requirements/_test.in -# +# This file was autogenerated by uv via the following command: +# uv pip compile --upgrade-package aiopg --build-isolation --strip-extras --resolver=backtracking --output-file requirements/_test.txt requirements/_test.in aiohttp==3.8.5 # via - # -c requirements/../../../../requirements/constraints.txt - # -c requirements/_base.txt # aioresponses # pytest-aiohttp -aioresponses==0.7.4 - # via -r requirements/_test.in +aioresponses==0.7.6 aiosignal==1.2.0 - # via - # -c requirements/_base.txt - # aiohttp + # via aiohttp alembic==1.8.1 - # via - # -c requirements/_base.txt - # -r requirements/_test.in async-timeout==4.0.2 # via - # -c requirements/_base.txt # aiohttp # redis attrs==21.4.0 # via - # -c requirements/_base.txt # aiohttp # hypothesis # jsonschema # pytest-docker certifi==2023.7.22 - # via - # -c requirements/../../../../requirements/constraints.txt - # -c requirements/_base.txt - # requests + # via requests charset-normalizer==2.0.12 # via - # -c requirements/_base.txt # aiohttp # requests click==8.1.3 - # via - # -c requirements/_base.txt - # -r requirements/_test.in coverage==7.3.2 - # via - # -r requirements/_test.in - # pytest-cov + # via pytest-cov docker==6.1.3 - # via -r requirements/_test.in exceptiongroup==1.1.3 # via # hypothesis @@ -59,51 +35,33 @@ exceptiongroup==1.1.3 execnet==2.0.2 # via pytest-xdist faker==19.6.1 - # via - # -c requirements/_base.txt - # -r requirements/_test.in flaky==3.7.0 - # via -r requirements/_test.in frozenlist==1.3.0 # via - # -c requirements/_base.txt # aiohttp # aiosignal greenlet==2.0.2 - # via - # -c requirements/_base.txt - # sqlalchemy + # via sqlalchemy hypothesis==6.88.1 - # via -r requirements/_test.in icdiff==2.0.7 # via pytest-icdiff idna==3.3 # via - # -c requirements/_base.txt # requests # yarl iniconfig==2.0.0 # via pytest jsonref==1.1.0 - # via -r requirements/_test.in jsonschema==3.2.0 # via - # -c requirements/_base.txt - # -r requirements/_test.in # openapi-schema-validator # openapi-spec-validator mako==1.2.2 - # via - # -c requirements/../../../../requirements/constraints.txt - # -c requirements/_base.txt - # alembic + # via alembic markupsafe==2.1.1 - # via - # -c requirements/_base.txt - # mako + # via mako multidict==6.0.2 # via - # -c requirements/_base.txt # aiohttp # yarl mypy==1.6.1 @@ -111,16 +69,10 @@ mypy==1.6.1 mypy-extensions==1.0.0 # via mypy openapi-schema-validator==0.2.3 - # via - # -c requirements/_base.txt - # openapi-spec-validator + # via openapi-spec-validator openapi-spec-validator==0.4.0 - # via - # -c requirements/_base.txt - # -r requirements/_test.in packaging==23.1 # via - # -c requirements/_base.txt # docker # pytest # pytest-sugar @@ -131,12 +83,9 @@ pprintpp==0.4.0 py-cpuinfo==9.0.0 # via pytest-benchmark pyrsistent==0.18.1 - # via - # -c requirements/_base.txt - # jsonschema + # via jsonschema pytest==7.4.3 # via - # -r requirements/_test.in # pytest-aiohttp # pytest-asyncio # pytest-benchmark @@ -148,66 +97,40 @@ pytest==7.4.3 # pytest-sugar # pytest-xdist pytest-aiohttp==1.0.5 - # via -r requirements/_test.in pytest-asyncio==0.21.1 # via pytest-aiohttp pytest-benchmark==4.0.0 - # via -r requirements/_test.in pytest-cov==4.1.0 - # via -r requirements/_test.in pytest-docker==2.0.1 - # via -r requirements/_test.in pytest-icdiff==0.8 - # via -r requirements/_test.in pytest-instafail==0.5.0 - # via -r requirements/_test.in pytest-mock==3.12.0 - # via -r requirements/_test.in pytest-runner==6.0.0 - # via -r requirements/_test.in pytest-sugar==0.9.7 - # via -r requirements/_test.in pytest-xdist==3.3.1 - # via -r requirements/_test.in python-dateutil==2.8.2 - # via - # -c requirements/_base.txt - # faker + # via faker python-dotenv==1.0.0 - # via -r requirements/_test.in pyyaml==6.0.1 - # via - # -c requirements/../../../../requirements/constraints.txt - # -c requirements/_base.txt - # openapi-spec-validator + # via openapi-spec-validator redis==4.5.4 - # via - # -c requirements/../../../../requirements/constraints.txt - # -c requirements/_base.txt - # -r requirements/_test.in requests==2.31.0 + # via docker +setuptools==69.1.1 # via - # -c requirements/_base.txt - # docker + # jsonschema + # openapi-spec-validator six==1.16.0 # via - # -c requirements/_base.txt # jsonschema # python-dateutil sortedcontainers==2.4.0 # via hypothesis sqlalchemy==1.4.47 - # via - # -c requirements/../../../../requirements/constraints.txt - # -c requirements/_base.txt - # -r requirements/_test.in - # alembic + # via alembic sqlalchemy2-stubs==0.0.2a36 # via sqlalchemy tenacity==8.0.1 - # via - # -c requirements/_base.txt - # -r requirements/_test.in termcolor==2.3.0 # via pytest-sugar tomli==2.0.1 @@ -217,23 +140,14 @@ tomli==2.0.1 # pytest typing-extensions==4.3.0 # via - # -c requirements/_base.txt # mypy # sqlalchemy2-stubs urllib3==1.26.11 # via - # -c requirements/../../../../requirements/constraints.txt - # -c requirements/_base.txt # docker # requests websocket-client==1.6.4 # via docker websockets==12.0 - # via -r requirements/_test.in yarl==1.5.1 - # via - # -c requirements/_base.txt - # aiohttp - -# The following packages are considered to be unsafe in a requirements file: -# setuptools + # via aiohttp diff --git a/services/web/server/requirements/_tools.txt b/services/web/server/requirements/_tools.txt index ae61e1835e0..1218e892c4b 100644 --- a/services/web/server/requirements/_tools.txt +++ b/services/web/server/requirements/_tools.txt @@ -1,49 +1,25 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --output-file=requirements/_tools.txt --strip-extras requirements/_tools.in -# +# This file was autogenerated by uv via the following command: +# uv pip compile --upgrade-package aiopg --build-isolation --strip-extras --resolver=backtracking --output-file requirements/_tools.txt requirements/_tools.in aiohttp==3.8.5 - # via - # -c requirements/../../../../requirements/constraints.txt - # -c requirements/_base.txt - # -c requirements/_test.txt - # black + # via black aiosignal==1.2.0 - # via - # -c requirements/_base.txt - # -c requirements/_test.txt - # aiohttp + # via aiohttp astroid==3.0.2 # via pylint async-timeout==4.0.2 - # via - # -c requirements/_base.txt - # -c requirements/_test.txt - # aiohttp + # via aiohttp attrs==21.4.0 - # via - # -c requirements/_base.txt - # -c requirements/_test.txt - # aiohttp + # via aiohttp black==23.12.0 - # via -r requirements/../../../../requirements/devenv.txt build==1.0.3 # via pip-tools bump2version==1.0.1 - # via -r requirements/../../../../requirements/devenv.txt cfgv==3.4.0 # via pre-commit charset-normalizer==2.0.12 - # via - # -c requirements/_base.txt - # -c requirements/_test.txt - # aiohttp + # via aiohttp click==8.1.3 # via - # -c requirements/_base.txt - # -c requirements/_test.txt # black # pip-tools dill==0.3.7 @@ -54,71 +30,54 @@ filelock==3.13.1 # via virtualenv frozenlist==1.3.0 # via - # -c requirements/_base.txt - # -c requirements/_test.txt # aiohttp # aiosignal identify==2.5.33 # via pre-commit idna==3.3 - # via - # -c requirements/_base.txt - # -c requirements/_test.txt - # yarl + # via yarl inotify==0.2.10 - # via -r requirements/_tools.in isort==5.13.2 - # via - # -r requirements/../../../../requirements/devenv.txt - # pylint + # via pylint mccabe==0.7.0 # via pylint multidict==6.0.2 # via - # -c requirements/_base.txt - # -c requirements/_test.txt # aiohttp # yarl mypy-extensions==1.0.0 - # via - # -c requirements/_test.txt - # black + # via black nodeenv==1.8.0 # via pre-commit nose==1.3.7 # via inotify packaging==23.1 # via - # -c requirements/_base.txt - # -c requirements/_test.txt # black # build pathspec==0.12.1 # via black +pip==24.0 + # via pip-tools pip-tools==7.3.0 - # via -r requirements/../../../../requirements/devenv.txt platformdirs==4.1.0 # via # black # pylint # virtualenv pre-commit==3.6.0 - # via -r requirements/../../../../requirements/devenv.txt pylint==3.0.3 - # via -r requirements/../../../../requirements/devenv.txt pyproject-hooks==1.0.0 # via build pyyaml==6.0.1 - # via - # -c requirements/../../../../requirements/constraints.txt - # -c requirements/_base.txt - # -c requirements/_test.txt - # pre-commit + # via pre-commit ruff==0.1.8 - # via -r requirements/../../../../requirements/devenv.txt +setuptools==69.1.1 + # via + # nodeenv + # pip-tools tomli==2.0.1 # via - # -c requirements/_test.txt # black # build # pip-tools @@ -127,11 +86,8 @@ tomli==2.0.1 tomlkit==0.12.3 # via pylint types-cachetools==5.3.0.7 - # via -r requirements/_tools.in typing-extensions==4.3.0 # via - # -c requirements/_base.txt - # -c requirements/_test.txt # astroid # black virtualenv==20.25.0 @@ -139,11 +95,4 @@ virtualenv==20.25.0 wheel==0.42.0 # via pip-tools yarl==1.5.1 - # via - # -c requirements/_base.txt - # -c requirements/_test.txt - # aiohttp - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools + # via aiohttp diff --git a/services/web/server/requirements/ci.txt b/services/web/server/requirements/ci.txt index 564571e1f0d..9a171226abf 100644 --- a/services/web/server/requirements/ci.txt +++ b/services/web/server/requirements/ci.txt @@ -11,12 +11,12 @@ --requirement _test.txt # installs this repo's packages -../../../packages/models-library/ -../../../packages/postgres-database/ -../../../packages/settings-library/ -../../../packages/service-library[aiohttp] -../../../packages/simcore-sdk/ -../../../packages/pytest-simcore/ +simcore-models-library @ ../../../packages/models-library +simcore-postgres-database @ ../../../packages/postgres-database +simcore-settings-library @ ../../../packages/settings-library +simcore-service-library[aiohttp] @ ../../../packages/service-library +simcore-sdk @ ../../../packages/simcore-sdk +pytest-simcore @ ../../../packages/pytest-simcore # installs current package -. +simcore-service-webserver @ . diff --git a/services/web/server/requirements/prod.txt b/services/web/server/requirements/prod.txt index be4f9e5e1d6..9494dd12c30 100644 --- a/services/web/server/requirements/prod.txt +++ b/services/web/server/requirements/prod.txt @@ -10,11 +10,11 @@ --requirement _base.txt # installs this repo's packages -../../../packages/models-library/ -../../../packages/postgres-database/ -../../../packages/settings-library/ -../../../packages/service-library[aiohttp] -../../../packages/simcore-sdk/ +simcore-models-library @ ../../../packages/models-library +simcore-postgres-database @ ../../../packages/postgres-database +simcore-settings-library @ ../../../packages/settings-library +simcore-service-library[aiohttp] @ ../../../packages/service-library +simcore-sdk @ ../../../packages/simcore-sdk # installs current package -. +simcore-service-webserver @ . diff --git a/services/web/server/src/simcore_service_webserver/api_keys/_api.py b/services/web/server/src/simcore_service_webserver/api_keys/_api.py index 6768ce40fcb..dd11fc70126 100644 --- a/services/web/server/src/simcore_service_webserver/api_keys/_api.py +++ b/services/web/server/src/simcore_service_webserver/api_keys/_api.py @@ -6,8 +6,8 @@ from models_library.api_schemas_webserver.auth import ApiKeyCreate, ApiKeyGet from models_library.products import ProductName from models_library.users import UserID +from servicelib.utils_secrets import generate_token_secret_key -from ..login.utils import get_random_string from ._db import ApiKeyRepo _PUNCTUATION_REGEX = re.compile( @@ -15,7 +15,7 @@ ) _KEY_LEN: Final = 10 -_SECRET_LEN: Final = 30 +_SECRET_LEN: Final = 20 async def list_api_keys( @@ -37,8 +37,8 @@ async def create_api_key( product_name: ProductName, ) -> ApiKeyGet: prefix = _PUNCTUATION_REGEX.sub("_", new.display_name[:5]) - api_key = f"{prefix}_{get_random_string(_KEY_LEN)}" - api_secret = get_random_string(_SECRET_LEN) + api_key = f"{prefix}_{generate_token_secret_key(_KEY_LEN)}" + api_secret = generate_token_secret_key(_SECRET_LEN) # raises if name exists already! repo = ApiKeyRepo.create_from_app(app) diff --git a/services/web/server/src/simcore_service_webserver/login/_confirmation.py b/services/web/server/src/simcore_service_webserver/login/_confirmation.py index 33978ffbe41..fa9401778e7 100644 --- a/services/web/server/src/simcore_service_webserver/login/_confirmation.py +++ b/services/web/server/src/simcore_service_webserver/login/_confirmation.py @@ -5,8 +5,10 @@ Codes can be used one time Codes have expiration date (duration time is configurable) """ + import logging from datetime import datetime +from urllib.parse import quote from aiohttp import web from yarl import URL @@ -40,7 +42,9 @@ async def validate_confirmation_code( def _url_for_confirmation(app: web.Application, code: str) -> URL: - return app.router["auth_confirmation"].url_for(code=code) + # NOTE: this is in a query parameter, and can contain ? for example. + safe_code = quote(code, safe="") + return app.router["auth_confirmation"].url_for(code=safe_code) def make_confirmation_link( @@ -60,7 +64,7 @@ def get_expiration_date( async def is_confirmation_allowed( cfg: LoginOptions, db: AsyncpgStorage, user, action: ConfirmationAction ): - confirmation: ConfirmationTokenDict = await db.get_confirmation( + confirmation: ConfirmationTokenDict | None = await db.get_confirmation( {"user": user, "action": action} ) if not confirmation: diff --git a/services/web/server/src/simcore_service_webserver/login/cli.py b/services/web/server/src/simcore_service_webserver/login/cli.py index 6d2d2816c35..cc682852d2a 100644 --- a/services/web/server/src/simcore_service_webserver/login/cli.py +++ b/services/web/server/src/simcore_service_webserver/login/cli.py @@ -2,11 +2,11 @@ from datetime import datetime import typer +from servicelib.utils_secrets import generate_password from simcore_postgres_database.models.confirmations import ConfirmationAction from yarl import URL from ._registration import InvitationData, get_invitation_url -from .utils import get_random_string def invitations( @@ -21,7 +21,7 @@ def invitations( invitation = InvitationData(issuer=issuer_email, trial_account_days=trial_days) - codes = [get_random_string(code_length) for _ in range(num_codes)] + codes = [generate_password(code_length) for _ in range(num_codes)] typer.secho( "{:-^100}".format("invitations.md"), diff --git a/services/web/server/src/simcore_service_webserver/login/storage.py b/services/web/server/src/simcore_service_webserver/login/storage.py index 672364aeb80..8212c24cc70 100644 --- a/services/web/server/src/simcore_service_webserver/login/storage.py +++ b/services/web/server/src/simcore_service_webserver/login/storage.py @@ -4,9 +4,9 @@ import asyncpg from aiohttp import web +from servicelib.utils_secrets import generate_password from . import _sql -from .utils import get_random_string _logger = getLogger(__name__) @@ -80,7 +80,7 @@ async def create_confirmation( async with self.pool.acquire() as conn: # generate different code while True: - code: str = get_random_string(30) + code: str = generate_password(30) if not await _sql.find_one(conn, self.confirm_tbl, {"code": code}): break # insert confirmation diff --git a/services/web/server/src/simcore_service_webserver/login/utils.py b/services/web/server/src/simcore_service_webserver/login/utils.py index 490869f5ce9..d18d033de72 100644 --- a/services/web/server/src/simcore_service_webserver/login/utils.py +++ b/services/web/server/src/simcore_service_webserver/login/utils.py @@ -1,9 +1,6 @@ -import random from dataclasses import asdict -from typing import Any, cast +from typing import Any -import passlib.hash -import passlib.pwd from aiohttp import web from models_library.products import ProductName from models_library.users import UserID @@ -119,12 +116,6 @@ async def notify_user_logout( ) -def get_random_string(min_len: int, max_len: int | None = None) -> str: - max_len = max_len or min_len - size = random.randint(min_len, max_len) # noqa: S311 # nosec # NOSONAR - return cast(str, passlib.pwd.genword(entropy=52, length=size)) - - def flash_response( message: str, level: str = "INFO", *, status: int = HTTP_200_OK ) -> web.Response: diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py index bae7bffb472..1e826f971d7 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py @@ -7,7 +7,10 @@ - resource_manager """ + import logging +import secrets +import string from contextlib import suppress from datetime import datetime @@ -19,11 +22,12 @@ from servicelib.aiohttp.application_keys import APP_FIRE_AND_FORGET_TASKS_KEY from servicelib.logging_utils import log_decorator from servicelib.utils import fire_and_forget_task +from servicelib.utils_secrets import generate_password from ..garbage_collector.settings import GUEST_USER_RC_LOCK_FORMAT from ..groups.api import auto_add_user_to_product_group from ..login.storage import AsyncpgStorage, get_plugin_storage -from ..login.utils import ACTIVE, GUEST, get_random_string +from ..login.utils import ACTIVE, GUEST from ..products.api import get_product_name from ..redis import get_redis_lock_manager_client from ..security.api import ( @@ -73,9 +77,11 @@ async def create_temporary_guest_user(request: web.Request): settings: StudiesDispatcherSettings = get_plugin_settings(app=request.app) product_name = get_product_name(request) - random_user_name = get_random_string(min_len=5) + random_user_name = "".join( + secrets.choice(string.ascii_lowercase) for _ in range(10) + ) email = parse_obj_as(LowerCaseEmailStr, f"{random_user_name}@guest-at-osparc.io") - password = get_random_string(min_len=12) + password = generate_password(length=12) expires_at = datetime.utcnow() + settings.STUDIES_GUEST_ACCOUNT_LIFETIME # GUEST_USER_RC_LOCK: diff --git a/services/web/server/tests/unit/isolated/test_project_utils.py b/services/web/server/tests/unit/isolated/test_project_utils.py index 744f42fc25a..60ce2fe65bc 100644 --- a/services/web/server/tests/unit/isolated/test_project_utils.py +++ b/services/web/server/tests/unit/isolated/test_project_utils.py @@ -1,6 +1,8 @@ from typing import Any import pytest +from models_library.projects import ProjectType as ml_project_type +from simcore_postgres_database.models.projects import ProjectType as pg_project_type from simcore_service_webserver.projects.utils import ( NodeDict, find_changed_node_keys, @@ -341,3 +343,11 @@ def test_did_node_outputs_change( get_frontend_node_outputs_changes(new_node=new_node, old_node=old_node) == expected ) + + +def test_project_type_in_models_package_same_as_in_postgres_database_package(): + + # pylint: disable=no-member + assert ( + ml_project_type.__members__.keys() == pg_project_type.__members__.keys() + ), f"The enum in models_library package and postgres package shall have the same values. models_pck: {ml_project_type.__members__}, postgres_pck: {pg_project_type.__members__}" diff --git a/services/web/server/tests/unit/with_dbs/03/login/test_login_reset_password.py b/services/web/server/tests/unit/with_dbs/03/login/test_login_reset_password.py index 820e59694d2..2fbf3874c8a 100644 --- a/services/web/server/tests/unit/with_dbs/03/login/test_login_reset_password.py +++ b/services/web/server/tests/unit/with_dbs/03/login/test_login_reset_password.py @@ -10,6 +10,7 @@ from pytest import CaptureFixture from pytest_simcore.helpers.utils_assert import assert_status from pytest_simcore.helpers.utils_login import NewUser, parse_link, parse_test_marks +from servicelib.utils_secrets import generate_password from simcore_service_webserver.db.models import ConfirmationAction, UserStatus from simcore_service_webserver.login._constants import ( MSG_ACTIVATION_REQUIRED, @@ -23,7 +24,6 @@ ) from simcore_service_webserver.login.settings import LoginOptions from simcore_service_webserver.login.storage import AsyncpgStorage -from simcore_service_webserver.login.utils import get_random_string from yarl import URL # @@ -187,7 +187,7 @@ async def test_reset_and_confirm( reset_allowed_url = client.app.router["auth_reset_password_allowed"].url_for( code=code ) - new_password = get_random_string(5, 10) + new_password = generate_password(10) response = await client.post( f"{reset_allowed_url}", json={ diff --git a/tests/e2e-playwright/Makefile b/tests/e2e-playwright/Makefile index e57395c4937..e8981393a16 100644 --- a/tests/e2e-playwright/Makefile +++ b/tests/e2e-playwright/Makefile @@ -56,7 +56,7 @@ requirements: ## compiles pip requirements (.in -> .txt) .PHONY: install-dev install-prod install-ci install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt # installing playwright dependencies @playwright install diff --git a/tests/e2e-playwright/requirements/ci.txt b/tests/e2e-playwright/requirements/ci.txt index db69de877ab..d6a417115eb 100644 --- a/tests/e2e-playwright/requirements/ci.txt +++ b/tests/e2e-playwright/requirements/ci.txt @@ -1,3 +1,3 @@ --requirement _test.txt -../../packages/pytest-simcore +pytest-simcore @ ../../packages/pytest-simcore diff --git a/tests/e2e/Makefile b/tests/e2e/Makefile index 109d5221e0b..9f2d343253b 100644 --- a/tests/e2e/Makefile +++ b/tests/e2e/Makefile @@ -23,7 +23,7 @@ endef define _setup_test_environment # setup the python environment $(MAKE_C) $(REPO_BASE_DIR) devenv -$(VENV_DIR)/bin/pip install -r requirements/requirements.txt +uv pip install -r requirements/requirements.txt # setup node environment for puppeteer npm install endef diff --git a/tests/e2e/requirements/Makefile b/tests/e2e/requirements/Makefile index 698653173cd..c9e400882d1 100644 --- a/tests/e2e/requirements/Makefile +++ b/tests/e2e/requirements/Makefile @@ -9,4 +9,4 @@ VENV_DIR ?= $(realpath $(REPO_BASE_DIR)/.venv) .PHONY: install install: $(VENV_DIR) requirements.txt ## installs dependencies # installing requirements - @pip install -r requirements.txt + @uv pip install -r requirements.txt diff --git a/tests/environment-setup/Makefile b/tests/environment-setup/Makefile index 9dc5e6caf50..368728e9119 100644 --- a/tests/environment-setup/Makefile +++ b/tests/environment-setup/Makefile @@ -15,7 +15,7 @@ install: install-ci install-dev install-prod install-ci: ## install requirements in dev/prod/ci mode # installing in $(subst install-,,$@) mode - @$(VENV_DIR)/bin/pip3 install -r requirements/$(subst install-,,$@).txt + @uv pip install -r requirements/$(subst install-,,$@).txt .PHONY: tests diff --git a/tests/environment-setup/requirements/ci.txt b/tests/environment-setup/requirements/ci.txt index 7eb2bcea2b8..66b3d90e7f9 100644 --- a/tests/environment-setup/requirements/ci.txt +++ b/tests/environment-setup/requirements/ci.txt @@ -10,6 +10,6 @@ --requirement requirements.txt # installs this repo's packages -../../packages/pytest-simcore/ -../../packages/settings-library/ -../../packages/service-library/ +pytest-simcore @ ../../packages/pytest-simcore/ +simcore-settings-library @ ../../packages/settings-library/ +simcore-service-library @ ../../packages/service-library/ diff --git a/tests/public-api/Makefile b/tests/public-api/Makefile index ea79bb129eb..e688cf0b195 100644 --- a/tests/public-api/Makefile +++ b/tests/public-api/Makefile @@ -22,7 +22,7 @@ requirements: ## compiles pip requirements (.in -> .txt) .PHONY: install-dev install-prod install-ci install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: test-dev @@ -48,4 +48,5 @@ test-ci: ## runs ci tests (i.e. w/o debug tools and with code coverage) -vv \ --color=yes \ --durations=10 \ + --keep-docker-up \ $(CURDIR) diff --git a/tests/public-api/examples/Makefile b/tests/public-api/examples/Makefile index eb2c79c4401..8f56654f2d7 100644 --- a/tests/public-api/examples/Makefile +++ b/tests/public-api/examples/Makefile @@ -17,14 +17,14 @@ help: ## help on rule's targets .PHONY: install-dev install-dev: ## installs osparc client from folder for developent - pip install --editable $(API_SERVER_DIR)/client - pip install python-dotenv + uv pip install --editable $(API_SERVER_DIR)/client + uv pip install python-dotenv .PHONY: install-ci install-ci: ## installs osparc client and dependencies - pip install git+https://github.com/ITISFoundation/osparc-simcore-clients.git - pip install python-dotenv jupytext + uv pip install git+https://github.com/ITISFoundation/osparc-simcore-clients.git + uv pip install python-dotenv jupytext objects = $(wildcard *.py) diff --git a/tests/public-api/requirements/_base.in b/tests/public-api/requirements/_base.in new file mode 100644 index 00000000000..ea04a8509a3 --- /dev/null +++ b/tests/public-api/requirements/_base.in @@ -0,0 +1 @@ +osparc diff --git a/tests/public-api/requirements/_base.txt b/tests/public-api/requirements/_base.txt index 0eb14367cec..934a123e0a5 100644 --- a/tests/public-api/requirements/_base.txt +++ b/tests/public-api/requirements/_base.txt @@ -1,6 +1,44 @@ -# NOTE: -# This file file is just here as placeholder -# to fulfill dependencies of _tools.txt target in requirements/base.Makefile -# -# This is a pure-tests project and all dependencies are added in _test.in -# +# This file was autogenerated by uv via the following command: +# uv pip compile --output-file requirements/_base.txt requirements/_base.in +anyio==4.3.0 + # via httpx +certifi==2024.2.2 + # via + # httpcore + # httpx + # osparc-client +exceptiongroup==1.2.0 + # via anyio +h11==0.14.0 + # via httpcore +httpcore==1.0.4 + # via httpx +httpx==0.27.0 + # via osparc +idna==3.6 + # via + # anyio + # httpx +nest-asyncio==1.6.0 + # via osparc +osparc==0.6.5 +osparc-client==0.6.5 + # via osparc +python-dateutil==2.8.2 + # via osparc-client +six==1.16.0 + # via + # osparc-client + # python-dateutil +sniffio==1.3.1 + # via + # anyio + # httpx +tenacity==8.2.3 + # via osparc +tqdm==4.66.2 + # via osparc +typing-extensions==4.10.0 + # via anyio +urllib3==2.2.1 + # via osparc-client diff --git a/tests/public-api/requirements/_test.txt b/tests/public-api/requirements/_test.txt index b9fa71205f1..6d6d69af766 100644 --- a/tests/public-api/requirements/_test.txt +++ b/tests/public-api/requirements/_test.txt @@ -1,117 +1,91 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --output-file=requirements/_test.txt --strip-extras requirements/_test.in -# -aiohttp==3.8.6 - # via - # -c requirements/../../../requirements/constraints.txt - # -r requirements/_test.in -aiosignal==1.3.1 - # via aiohttp -anyio==4.0.0 - # via httpcore -async-timeout==4.0.3 - # via aiohttp -attrs==23.1.0 - # via - # aiohttp - # jsonschema - # referencing -certifi==2023.7.22 - # via - # -c requirements/../../../requirements/constraints.txt - # httpcore - # httpx - # requests -charset-normalizer==3.3.2 - # via - # aiohttp - # requests -docker==6.1.3 - # via -r requirements/_test.in -exceptiongroup==1.1.3 - # via - # anyio - # pytest -faker==19.13.0 - # via -r requirements/_test.in -frozenlist==1.4.0 - # via - # aiohttp - # aiosignal -h11==0.14.0 - # via httpcore -httpcore==0.18.0 - # via httpx -httpx==0.25.0 - # via - # -c requirements/../../../requirements/constraints.txt - # -r requirements/_test.in -idna==3.4 - # via - # anyio - # httpx - # requests - # yarl -iniconfig==2.0.0 - # via pytest -jsonschema==4.19.2 - # via -r requirements/_test.in -jsonschema-specifications==2023.7.1 - # via jsonschema -multidict==6.0.4 - # via - # aiohttp - # yarl -packaging==23.2 - # via - # docker - # pytest -pluggy==1.3.0 - # via pytest -pytest==7.4.3 - # via - # -r requirements/_test.in - # pytest-asyncio -pytest-asyncio==0.21.1 - # via -r requirements/_test.in -python-dateutil==2.8.2 - # via faker -python-dotenv==1.0.0 - # via -r requirements/_test.in -pyyaml==6.0.1 - # via - # -c requirements/../../../requirements/constraints.txt - # -r requirements/_test.in -referencing==0.30.2 - # via - # jsonschema - # jsonschema-specifications -requests==2.31.0 - # via docker -rpds-py==0.10.6 - # via - # jsonschema - # referencing -six==1.16.0 - # via python-dateutil -sniffio==1.3.0 - # via - # anyio - # httpcore - # httpx -tenacity==8.2.3 - # via -r requirements/_test.in -tomli==2.0.1 - # via pytest -urllib3==2.0.7 - # via - # -c requirements/../../../requirements/constraints.txt - # docker - # requests -websocket-client==1.6.4 - # via docker -yarl==1.9.2 - # via aiohttp +# This file was autogenerated by uv via the following command: +# uv pip compile --output-file requirements/_test.txt requirements/_test.in +aiohttp==3.9.3 +aiosignal==1.3.1 + # via aiohttp +anyio==4.3.0 + # via httpx +async-timeout==4.0.3 + # via aiohttp +attrs==23.2.0 + # via + # aiohttp + # jsonschema + # referencing +certifi==2024.2.2 + # via + # httpcore + # httpx + # requests +charset-normalizer==3.3.2 + # via requests +docker==7.0.0 +exceptiongroup==1.2.0 + # via + # anyio + # pytest +faker==23.2.1 +frozenlist==1.4.1 + # via + # aiohttp + # aiosignal +h11==0.14.0 + # via httpcore +httpcore==1.0.4 + # via httpx +httpx==0.27.0 +idna==3.6 + # via + # anyio + # httpx + # requests + # yarl +iniconfig==2.0.0 + # via pytest +jsonschema==4.21.1 +jsonschema-specifications==2023.12.1 + # via jsonschema +multidict==6.0.5 + # via + # aiohttp + # yarl +packaging==23.2 + # via + # docker + # pytest +pluggy==1.4.0 + # via pytest +pytest==8.0.2 + # via pytest-asyncio +pytest-asyncio==0.23.5 +python-dateutil==2.8.2 + # via faker +python-dotenv==1.0.1 +pyyaml==6.0.1 +referencing==0.33.0 + # via + # jsonschema + # jsonschema-specifications +requests==2.31.0 + # via docker +rpds-py==0.18.0 + # via + # jsonschema + # referencing +six==1.16.0 + # via python-dateutil +sniffio==1.3.1 + # via + # anyio + # httpx +tenacity==8.2.3 +tomli==2.0.1 + # via pytest +typing-extensions==4.10.0 + # via anyio +urllib3==2.2.1 + # via + # docker + # requests +yarl==1.9.4 + # via aiohttp diff --git a/tests/public-api/requirements/_tools.in b/tests/public-api/requirements/_tools.in index 107085b321e..1def82c12a3 100644 --- a/tests/public-api/requirements/_tools.in +++ b/tests/public-api/requirements/_tools.in @@ -1,4 +1,5 @@ --constraint ../../../requirements/constraints.txt +--constraint _base.txt --constraint _test.txt --requirement ../../../requirements/devenv.txt diff --git a/tests/public-api/requirements/_tools.txt b/tests/public-api/requirements/_tools.txt index 41c2c534d93..16adc064f13 100644 --- a/tests/public-api/requirements/_tools.txt +++ b/tests/public-api/requirements/_tools.txt @@ -1,106 +1,62 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --output-file=requirements/_tools.txt --strip-extras requirements/_tools.in -# -aiohttp==3.8.6 - # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_test.txt - # black -aiosignal==1.3.1 - # via - # -c requirements/_test.txt - # aiohttp -astroid==3.0.2 +# This file was autogenerated by uv via the following command: +# uv pip compile --output-file requirements/_tools.txt requirements/_tools.in +astroid==3.1.0 # via pylint -async-timeout==4.0.3 - # via - # -c requirements/_test.txt - # aiohttp -attrs==23.1.0 - # via - # -c requirements/_test.txt - # aiohttp -black==23.12.0 - # via -r requirements/../../../requirements/devenv.txt +black==24.2.0 build==1.0.3 # via pip-tools bump2version==1.0.1 - # via -r requirements/../../../requirements/devenv.txt cfgv==3.4.0 # via pre-commit -charset-normalizer==3.3.2 - # via - # -c requirements/_test.txt - # aiohttp click==8.1.7 # via # black # pip-tools -dill==0.3.7 +dill==0.3.8 # via pylint distlib==0.3.8 # via virtualenv filelock==3.13.1 # via virtualenv -frozenlist==1.4.0 - # via - # -c requirements/_test.txt - # aiohttp - # aiosignal -identify==2.5.33 +identify==2.5.35 # via pre-commit -idna==3.4 - # via - # -c requirements/_test.txt - # yarl isort==5.13.2 - # via - # -r requirements/../../../requirements/devenv.txt - # pylint + # via pylint mccabe==0.7.0 # via pylint -multidict==6.0.4 - # via - # -c requirements/_test.txt - # aiohttp - # yarl mypy-extensions==1.0.0 # via black nodeenv==1.8.0 # via pre-commit packaging==23.2 # via - # -c requirements/_test.txt # black # build pathspec==0.12.1 # via black -pip-tools==7.3.0 - # via -r requirements/../../../requirements/devenv.txt -platformdirs==4.1.0 +pip==24.0 + # via pip-tools +pip-tools==7.4.0 +platformdirs==4.2.0 # via # black # pylint # virtualenv -pre-commit==3.6.0 - # via -r requirements/../../../requirements/devenv.txt -pylint==3.0.3 - # via -r requirements/../../../requirements/devenv.txt +pre-commit==3.6.2 +pylint==3.1.0 pyproject-hooks==1.0.0 - # via build + # via + # build + # pip-tools pyyaml==6.0.1 + # via pre-commit +ruff==0.2.2 +setuptools==69.1.1 # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_test.txt - # pre-commit -ruff==0.1.8 - # via -r requirements/../../../requirements/devenv.txt + # nodeenv + # pip-tools tomli==2.0.1 # via - # -c requirements/_test.txt # black # build # pip-tools @@ -108,19 +64,11 @@ tomli==2.0.1 # pyproject-hooks tomlkit==0.12.3 # via pylint -typing-extensions==4.9.0 +typing-extensions==4.10.0 # via # astroid # black -virtualenv==20.25.0 +virtualenv==20.25.1 # via pre-commit wheel==0.42.0 # via pip-tools -yarl==1.9.2 - # via - # -c requirements/_test.txt - # aiohttp - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools diff --git a/tests/public-api/requirements/ci.txt b/tests/public-api/requirements/ci.txt index f55aec6076e..ec07bd3c56b 100644 --- a/tests/public-api/requirements/ci.txt +++ b/tests/public-api/requirements/ci.txt @@ -7,9 +7,7 @@ # # installs base + tests requirements +--requirement _base.txt --requirement _test.txt -osparc==0.6.5 - -# installs this repo's packages -../../packages/pytest-simcore/ +pytest-simcore @ ../../packages/pytest-simcore/ diff --git a/tests/public-api/requirements/dev.txt b/tests/public-api/requirements/dev.txt index 128f4959134..da3888fc6e2 100644 --- a/tests/public-api/requirements/dev.txt +++ b/tests/public-api/requirements/dev.txt @@ -14,12 +14,10 @@ # make install-dev # make python-client # -osparc - # installs base + tests requirements +--requirement _base.txt --requirement _test.txt --requirement _tools.txt -# installs this repo's packages --editable ../../packages/pytest-simcore/ diff --git a/tests/swarm-deploy/Makefile b/tests/swarm-deploy/Makefile index 3cbb743afcc..6f7fd026acb 100644 --- a/tests/swarm-deploy/Makefile +++ b/tests/swarm-deploy/Makefile @@ -15,7 +15,7 @@ install: install-ci install-dev install-prod install-ci: _check_venv_active ## install requirements in dev/prod/ci mode # installing in $(subst install-,,$@) mode - pip-sync requirements/$(subst install-,,$@).txt + @uv pip sync requirements/$(subst install-,,$@).txt .PHONY: tests diff --git a/tests/swarm-deploy/requirements/ci.txt b/tests/swarm-deploy/requirements/ci.txt index fb43661ff8b..0b682dd7a38 100644 --- a/tests/swarm-deploy/requirements/ci.txt +++ b/tests/swarm-deploy/requirements/ci.txt @@ -10,9 +10,9 @@ --requirement _test.txt # installs this repo's packages -../../packages/models-library/ -../../packages/postgres-database/[migration] -../../packages/pytest-simcore/ -../../packages/service-library/ -../../packages/settings-library/ -../../packages/simcore-sdk/ +simcore-models-library @ ../../packages/models-library/ +simcore-postgres-database[migration] @ ../../packages/postgres-database/ +pytest-simcore @ ../../packages/pytest-simcore/ +simcore-service-library @ ../../packages/service-library/ +simcore-settings-library @ ../../packages/settings-library/ +simcore-sdk @ ../../packages/simcore-sdk/ diff --git a/tests/swarm-deploy/requirements/dev.txt b/tests/swarm-deploy/requirements/dev.txt index 02cfbcfd962..ed2c7cee70a 100644 --- a/tests/swarm-deploy/requirements/dev.txt +++ b/tests/swarm-deploy/requirements/dev.txt @@ -13,7 +13,7 @@ # installs this repo's packages --editable ../../packages/models-library/ ---editable ../../packages/postgres-database/ +--editable ../../packages/postgres-database[migration] --editable ../../packages/pytest-simcore/ --editable ../../packages/service-library/ --editable ../../packages/settings-library/