diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3642568..d76ace2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,42 +3,67 @@ name: Build-Test-Lint-etc (linux) on: [push] jobs: - - flake8-lint: + setup: runs-on: ubuntu-latest - name: Lint + strategy: + fail-fast: false + matrix: + python-version: [ "3.11" ] + name: Setup steps: - - name: Check out source repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Python environment + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: 3.11 - - name: flake8 Lint - uses: TrueBrain/actions-flake8@v2 + python-version: ${{ matrix.python-version }} + cache: 'pip' + - run: | + ./ci/linux/create_venv.sh + ./ci/linux/install_dependencies.sh + - name: 'Tar venv' + run: tar -cvf venv.tar ./.venv/ + - name: Save venv + uses: actions/upload-artifact@v4 with: - plugins: Flake8-pyproject==1.2.3 flake8-docstrings==1.7.0 flake8-quotes==3.3.2 flake8-bugbear==23.9.16 flake8-mock==0.4 flake8-tuple==0.4.1 - # only_warn: 1 #causes action to always be succesful, but still provide annotations + path: ./venv.tar + name: ${{ runner.os }}-python-${{ matrix.python-version }}-venv-${{github.run_id}} - test: + lint: + name: Lint runs-on: ubuntu-latest + needs: [ setup ] strategy: + fail-fast: false matrix: - python-version: ["3.11"] -# python-version: [3.8, 3.9, 3.10, 3.11] + python-version: [ "3.11" ] steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Restore venv + uses: actions/download-artifact@v4 with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - - run: | - ./ci/linux/create_venv.sh - ./ci/linux/install_dependencies.sh + name: ${{ runner.os }}-python-${{ matrix.python-version }}-venv-${{github.run_id}} + - name: Untar venv + run: tar -xvf venv.tar + - name: run unit tests + run: | + ./ci/linux/lint.sh + test: + name: Test + runs-on: ubuntu-latest + needs: [ setup ] + strategy: + fail-fast: false + matrix: + python-version: [ "3.11" ] + steps: + - uses: actions/checkout@v3 + - name: Restore venv + uses: actions/download-artifact@v4 + with: + name: ${{ runner.os }}-python-${{ matrix.python-version }}-venv-${{github.run_id}} + - name: Untar venv + run: tar -xvf venv.tar - name: run unit tests run: | ./ci/linux/test_unit.sh @@ -67,46 +92,24 @@ jobs: fail-on-empty: true typecheck: + name: Typecheck runs-on: ubuntu-latest + needs: [ setup ] strategy: + fail-fast: false matrix: - python-version: ["3.11"] -# python-version: [3.8, 3.9, 3.10, 3.11] + python-version: [ "3.11" ] steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Restore venv + uses: actions/download-artifact@v4 with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - - run: | - ./ci/linux/create_venv.sh - ./ci/linux/install_dependencies.sh - + name: ${{ runner.os }}-python-${{ matrix.python-version }}-venv-${{github.run_id}} + - name: Untar venv + run: tar -xvf venv.tar - name: Add mypy annotator uses: pr-annotators/mypy-pr-annotator@v1.0.0 - name: run typechecker run: | ./ci/linux/typecheck.sh - - build: - name: Build the python package - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [ "3.11" ] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - - run: | - ./ci/linux/create_venv.sh - ./ci/linux/install_dependencies.sh - - - name: build - run: | - ./ci/linux/build_python_package.sh diff --git a/ci/linux/_load_dot_env.sh b/ci/linux/_load_dot_env.sh new file mode 100644 index 0000000..434c067 --- /dev/null +++ b/ci/linux/_load_dot_env.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -a +source $1 +set +a diff --git a/ci/linux/build_python_package.sh b/ci/linux/build_python_package.sh index 5f4244f..0d2d2af 100755 --- a/ci/linux/build_python_package.sh +++ b/ci/linux/build_python_package.sh @@ -1,4 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash + +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi -. .venv/bin/activate python -m build diff --git a/ci/linux/create_venv.sh b/ci/linux/create_venv.sh index 0a0dc45..71fd104 100755 --- a/ci/linux/create_venv.sh +++ b/ci/linux/create_venv.sh @@ -1,5 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash python3 -m venv ./.venv -. .venv/bin/activate +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi pip3 install pip-tools diff --git a/ci/linux/install_dependencies.sh b/ci/linux/install_dependencies.sh index 0447bed..e00b897 100755 --- a/ci/linux/install_dependencies.sh +++ b/ci/linux/install_dependencies.sh @@ -1,4 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash + +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi -. .venv/bin/activate pip-sync ./dev-requirements.txt ./requirements.txt diff --git a/ci/linux/lint.sh b/ci/linux/lint.sh index 9bcfe7e..a5f61b0 100755 --- a/ci/linux/lint.sh +++ b/ci/linux/lint.sh @@ -1,4 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -. .venv/bin/activate -flake8 ./src/simulator_worker +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi + +flake8 ./src/simulator_worker ./unit_test/ diff --git a/ci/linux/test_unit.sh b/ci/linux/test_unit.sh index b810a25..bff0c15 100755 --- a/ci/linux/test_unit.sh +++ b/ci/linux/test_unit.sh @@ -1,4 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash + +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi -. .venv/bin/activate PYTHONPATH='$PYTHONPATH:src/' pytest --junit-xml=test-results.xml unit_test/ diff --git a/ci/linux/typecheck.sh b/ci/linux/typecheck.sh index 9a5f791..95c856d 100755 --- a/ci/linux/typecheck.sh +++ b/ci/linux/typecheck.sh @@ -1,4 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash + +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi -. .venv/bin/activate python -m mypy ./src/simulator_worker ./unit_test/ diff --git a/ci/linux/update_dependencies.sh b/ci/linux/update_dependencies.sh index cfb00aa..fea6566 100755 --- a/ci/linux/update_dependencies.sh +++ b/ci/linux/update_dependencies.sh @@ -1,5 +1,9 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -. .venv/bin/activate -pip-compile --output-file=requirements.txt pyproject.toml -pip-compile --extra=dev --output-file=dev-requirements.txt -c requirements.txt pyproject.toml +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi + +pip-compile --upgrade --output-file=requirements.txt pyproject.toml +pip-compile --upgrade --extra=dev -c requirements.txt --output-file=dev-requirements.txt pyproject.toml diff --git a/dev-requirements.txt b/dev-requirements.txt index 930683b..b2dd946 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,302 +2,297 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --constraint='..\..\requirements.txt' --extra=dev --output-file='..\..\dev-requirements.txt' '..\..\pyproject.toml' +# pip-compile --constraint=requirements.txt --extra=dev --output-file=dev-requirements.txt pyproject.toml # -aio-pika==9.4.2 +aio-pika==9.4.3 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-sdk-python -aiormq==6.8.0 +aiormq==6.8.1 # via - # -c ..\..\requirements.txt + # -c requirements.txt # aio-pika -amqp==5.2.0 +amqp==5.3.1 # via - # -c ..\..\requirements.txt + # -c requirements.txt # kombu -attrs==23.2.0 +attrs==24.3.0 # via flake8-bugbear -billiard==4.2.0 +billiard==4.2.1 # via - # -c ..\..\requirements.txt + # -c requirements.txt # celery -black==22.1.0 - # via simulator-worker (..\..\pyproject.toml) -build==1.0.3 - # via - # pip-tools - # simulator-worker (..\..\pyproject.toml) -bump2version==1.0.1 - # via simulator-worker (..\..\pyproject.toml) +black==24.10.0 + # via simulator-worker (pyproject.toml) +build==1.2.2.post1 + # via simulator-worker (pyproject.toml) celery==5.3.6 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-sdk-python -certifi==2024.2.2 +certifi==2024.12.14 # via - # -c ..\..\requirements.txt + # -c requirements.txt # requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # requests click==8.1.7 # via - # -c ..\..\requirements.txt + # -c requirements.txt # black # celery # click-didyoumean # click-plugins # click-repl - # pip-tools -click-didyoumean==0.3.0 +click-didyoumean==0.3.1 # via - # -c ..\..\requirements.txt + # -c requirements.txt # celery click-plugins==1.1.1 # via - # -c ..\..\requirements.txt + # -c requirements.txt # celery click-repl==0.3.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # celery -colorama==0.4.6 - # via - # -c ..\..\requirements.txt - # build - # click - # pytest coolprop==6.6.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-simulator-core -coverage[toml]==7.4.1 - # via pytest-cov +coverage[toml]==7.6.9 + # via + # coverage + # pytest-cov dataclass-wizard==0.22.3 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-simulator-core -flake8==6.0.0 +flake8==7.1.1 # via # flake8-bugbear # flake8-docstrings # flake8-pyproject # flake8-quotes # flake8-tuple - # simulator-worker (..\..\pyproject.toml) -flake8-bugbear==23.9.16 - # via simulator-worker (..\..\pyproject.toml) + # simulator-worker (pyproject.toml) +flake8-bugbear==24.10.31 + # via simulator-worker (pyproject.toml) flake8-docstrings==1.7.0 - # via simulator-worker (..\..\pyproject.toml) + # via simulator-worker (pyproject.toml) flake8-mock==0.4 - # via simulator-worker (..\..\pyproject.toml) + # via simulator-worker (pyproject.toml) flake8-pyproject==1.2.3 - # via simulator-worker (..\..\pyproject.toml) -flake8-quotes==3.3.2 - # via simulator-worker (..\..\pyproject.toml) + # via simulator-worker (pyproject.toml) +flake8-quotes==3.4.0 + # via simulator-worker (pyproject.toml) flake8-tuple==0.4.1 - # via simulator-worker (..\..\pyproject.toml) + # via simulator-worker (pyproject.toml) future-fstrings==1.2.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # pyecore -idna==3.6 +idna==3.10 # via - # -c ..\..\requirements.txt + # -c requirements.txt # requests # yarl influxdb==5.3.2 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-simulator-core iniconfig==2.0.0 # via pytest isort==5.13.2 - # via simulator-worker (..\..\pyproject.toml) -kombu==5.3.5 + # via simulator-worker (pyproject.toml) +kombu==5.4.2 # via - # -c ..\..\requirements.txt + # -c requirements.txt # celery -lxml==5.1.0 +lxml==5.3.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # pyecore mccabe==0.7.0 # via flake8 -msgpack==1.0.8 +msgpack==1.1.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # influxdb -multidict==6.0.5 +multidict==6.1.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # yarl -mypy==1.5.1 - # via simulator-worker (..\..\pyproject.toml) +mypy==1.13.0 + # via simulator-worker (pyproject.toml) mypy-extensions==1.0.0 # via # black # mypy numpy==2.1.3 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-simulator-core # pandas # pandas-stubs # scipy -omotes-sdk-protocol==0.1.6 +omotes-sdk-protocol==0.1.13 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-sdk-python -omotes-sdk-python==3.2.4 +omotes-sdk-python==3.2.5 # via - # -c ..\..\requirements.txt - # simulator-worker (..\..\pyproject.toml) -omotes-simulator-core==0.0.16 + # -c requirements.txt + # simulator-worker (pyproject.toml) +omotes-simulator-core==0.0.18 # via - # -c ..\..\requirements.txt - # simulator-worker (..\..\pyproject.toml) + # -c requirements.txt + # simulator-worker (pyproject.toml) ordered-set==4.1.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # pyecore -packaging==24.0 +packaging==24.2 # via + # black # build # pytest + # setuptools-git-versioning pamqp==3.3.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # aiormq # omotes-sdk-python pandas==2.2.3 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-simulator-core - # simulator-worker (..\..\pyproject.toml) + # simulator-worker (pyproject.toml) pandas-stubs==2.1.4.231227 - # via simulator-worker (..\..\pyproject.toml) + # via simulator-worker (pyproject.toml) pathspec==0.12.1 # via black -pip-tools==7.3.0 - # via simulator-worker (..\..\pyproject.toml) -platformdirs==4.2.0 +platformdirs==4.3.6 # via black -pluggy==1.4.0 +pluggy==1.5.0 # via pytest -prompt-toolkit==3.0.43 +prompt-toolkit==3.0.48 # via - # -c ..\..\requirements.txt + # -c requirements.txt # click-repl -protobuf==4.25.3 +propcache==0.2.1 + # via + # -c requirements.txt + # yarl +protobuf==4.25.5 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-sdk-protocol -pycodestyle==2.10.0 +pycodestyle==2.12.1 # via flake8 pydocstyle==6.3.0 # via flake8-docstrings pyecore==0.12.1 # via - # -c ..\..\requirements.txt + # -c requirements.txt # pyesdl pyesdl==24.2 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-sdk-python # omotes-simulator-core - # simulator-worker (..\..\pyproject.toml) -pyflakes==3.0.1 + # simulator-worker (pyproject.toml) +pyflakes==3.2.0 # via flake8 pyjnius==1.6.1 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-simulator-core -pyproject-hooks==1.0.0 +pyproject-hooks==1.2.0 # via build -pytest==7.3.2 +pytest==8.3.4 # via # pytest-cov - # simulator-worker (..\..\pyproject.toml) -pytest-cov==4.0.0 - # via simulator-worker (..\..\pyproject.toml) -python-dateutil==2.8.2 + # simulator-worker (pyproject.toml) +pytest-cov==6.0.0 + # via simulator-worker (pyproject.toml) +python-dateutil==2.9.0.post0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # celery # influxdb # pandas python-dotenv==1.0.1 # via - # -c ..\..\requirements.txt - # simulator-worker (..\..\pyproject.toml) -pytz==2024.1 + # -c requirements.txt + # simulator-worker (pyproject.toml) +pytz==2024.2 # via - # -c ..\..\requirements.txt + # -c requirements.txt # influxdb # pandas -requests==2.31.0 +requests==2.32.3 # via - # -c ..\..\requirements.txt + # -c requirements.txt # influxdb -restrictedpython==7.2a1.dev0 +restrictedpython==7.4 # via - # -c ..\..\requirements.txt + # -c requirements.txt # pyecore scipy==1.14.1 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-simulator-core -six==1.16.0 +setuptools-git-versioning==2.0.0 + # via simulator-worker (pyproject.toml) +six==1.17.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # flake8-tuple # influxdb # python-dateutil snowballstemmer==2.2.0 # via pydocstyle -streamcapture==1.2.4 +streamcapture==1.2.5 # via - # -c ..\..\requirements.txt + # -c requirements.txt # omotes-sdk-python -tomli==2.0.1 - # via black -types-pytz==2024.1.0.20240203 +types-pytz==2024.2.0.20241003 # via pandas-stubs typing-extensions==4.11.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # mypy # omotes-sdk-python -tzdata==2024.1 +tzdata==2024.2 # via - # -c ..\..\requirements.txt + # -c requirements.txt # celery + # kombu # pandas -urllib3==2.2.1 +urllib3==2.2.3 # via - # -c ..\..\requirements.txt + # -c requirements.txt # requests vine==5.1.0 # via - # -c ..\..\requirements.txt + # -c requirements.txt # amqp # celery # kombu wcwidth==0.2.13 # via - # -c ..\..\requirements.txt + # -c requirements.txt # prompt-toolkit -wheel==0.42.0 - # via pip-tools -yarl==1.9.4 +wheel==0.45.1 + # via simulator-worker (pyproject.toml) +yarl==1.18.3 # via - # -c ..\..\requirements.txt + # -c requirements.txt # aio-pika # aiormq # The following packages are considered to be unsafe in a requirements file: -# pip # setuptools diff --git a/pyproject.toml b/pyproject.toml index 7ebfbc5..377fa07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,22 +29,22 @@ dependencies = [ [project.optional-dependencies] dev = [ - "setuptools ~= 69.0.3", - "pip-tools ~= 7.3.0", - "black~=22.1.0", - "flake8==6.0.0", - "Flake8-pyproject==1.2.3", - "flake8-docstrings==1.7.0", - "flake8-quotes==3.3.2", - "flake8-bugbear==23.9.16", - "flake8-mock==0.4", - "flake8-tuple==0.4.1", - "pytest ~=7.3.1", - "pytest-cov ~=4.0.0", - "bump2version==1.0.1", - "mypy ~= 1.5.1", - "isort==5.13.2", - "build ~= 1.0.3", + "setuptools ~= 75.6.0", + "wheel ~= 0.45.1", + "setuptools-git-versioning >= 2.0, < 3", + "black ~= 24.10.0", + "flake8 == 7.1.1", + "flake8-pyproject ~= 1.2.3", + "flake8-docstrings ~= 1.7.0", + "flake8-quotes ~= 3.4.0", + "flake8-bugbear ~= 24.10.31", + "flake8-mock ~= 0.4", + "flake8-tuple ~= 0.4.1", + "pytest ~= 8.3.4", + "pytest-cov ~= 6.0.0", + "mypy ~= 1.13.0", + "isort == 5.13.2", + "build ~= 1.2.2", "pandas-stubs ~= 2.1.1" ] @@ -60,16 +60,14 @@ simulator_worker = "simulator_worker:start_app" [build-system] build-backend = "setuptools.build_meta" requires = [ - "setuptools ~= 69.1.0", - "wheel ~= 0.42.0", - "setuptools-git-versioning>=2.0,<3", + "setuptools ~= 75.6.0", + "wheel ~= 0.45.1", + "setuptools-git-versioning >= 2.0, < 3", ] [tool.setuptools-git-versioning] enabled = true -starting_version = "0.0.13" -dev_template = "{tag}.dev{ccount}" -dirty_template = "{tag}.dev{ccount}" +starting_version = "0.0.1" [tool.pytest.ini_options] addopts = "--cov=simulator_worker --cov-report html --cov-report term-missing --cov-fail-under 20" @@ -86,6 +84,8 @@ ignore = [ 'E203', # Space before colon (not PEP-8 compliant, and conflicts with black) 'C408', # Suggestion to use dict() over {} 'W503', # Starting lines with operators. + 'D104', # Missing docstring in public package + 'D100' # Missing docstring in public module ] per-file-ignores = ['__init__.py:F401', 'test_*.py:D100,D101,D102,D103'] max-line-length = 100 diff --git a/requirements.txt b/requirements.txt index bbed08d..b0dfe8e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,21 +2,21 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --output-file='..\..\requirements.txt' '..\..\pyproject.toml' +# pip-compile --output-file=requirements.txt pyproject.toml # -aio-pika==9.4.2 +aio-pika==9.4.3 # via omotes-sdk-python -aiormq==6.8.0 +aiormq==6.8.1 # via aio-pika -amqp==5.2.0 +amqp==5.3.1 # via kombu -billiard==4.2.0 +billiard==4.2.1 # via celery celery==5.3.6 # via omotes-sdk-python -certifi==2024.2.2 +certifi==2024.12.14 # via requests -charset-normalizer==3.3.2 +charset-normalizer==3.4.0 # via requests click==8.1.7 # via @@ -24,45 +24,43 @@ click==8.1.7 # click-didyoumean # click-plugins # click-repl -click-didyoumean==0.3.0 +click-didyoumean==0.3.1 # via celery click-plugins==1.1.1 # via celery click-repl==0.3.0 # via celery -colorama==0.4.6 - # via click coolprop==6.6.0 # via omotes-simulator-core dataclass-wizard==0.22.3 # via omotes-simulator-core future-fstrings==1.2.0 # via pyecore -idna==3.6 +idna==3.10 # via # requests # yarl influxdb==5.3.2 # via omotes-simulator-core -kombu==5.3.5 +kombu==5.4.2 # via celery -lxml==5.1.0 +lxml==5.3.0 # via pyecore -msgpack==1.0.8 +msgpack==1.1.0 # via influxdb -multidict==6.0.5 +multidict==6.1.0 # via yarl numpy==2.1.3 # via # omotes-simulator-core # pandas # scipy -omotes-sdk-protocol==0.1.6 +omotes-sdk-protocol==0.1.13 # via omotes-sdk-python -omotes-sdk-python==3.2.4 - # via simulator-worker (..\..\pyproject.toml) -omotes-simulator-core==0.0.16 - # via simulator-worker (..\..\pyproject.toml) +omotes-sdk-python==3.2.5 + # via simulator-worker (pyproject.toml) +omotes-simulator-core==0.0.18 + # via simulator-worker (pyproject.toml) ordered-set==4.1.0 # via pyecore pamqp==3.3.0 @@ -72,10 +70,12 @@ pamqp==3.3.0 pandas==2.2.3 # via # omotes-simulator-core - # simulator-worker (..\..\pyproject.toml) -prompt-toolkit==3.0.43 + # simulator-worker (pyproject.toml) +prompt-toolkit==3.0.48 # via click-repl -protobuf==4.25.3 +propcache==0.2.1 + # via yarl +protobuf==4.25.5 # via omotes-sdk-protocol pyecore==0.12.1 # via pyesdl @@ -83,39 +83,40 @@ pyesdl==24.2 # via # omotes-sdk-python # omotes-simulator-core - # simulator-worker (..\..\pyproject.toml) + # simulator-worker (pyproject.toml) pyjnius==1.6.1 # via omotes-simulator-core -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # celery # influxdb # pandas python-dotenv==1.0.1 - # via simulator-worker (..\..\pyproject.toml) -pytz==2024.1 + # via simulator-worker (pyproject.toml) +pytz==2024.2 # via # influxdb # pandas -requests==2.31.0 +requests==2.32.3 # via influxdb -restrictedpython==7.2a1.dev0 +restrictedpython==7.4 # via pyecore scipy==1.14.1 # via omotes-simulator-core -six==1.16.0 +six==1.17.0 # via # influxdb # python-dateutil -streamcapture==1.2.4 +streamcapture==1.2.5 # via omotes-sdk-python typing-extensions==4.11.0 # via omotes-sdk-python -tzdata==2024.1 +tzdata==2024.2 # via # celery + # kombu # pandas -urllib3==2.2.1 +urllib3==2.2.3 # via requests vine==5.1.0 # via @@ -124,7 +125,7 @@ vine==5.1.0 # kombu wcwidth==0.2.13 # via prompt-toolkit -yarl==1.9.4 +yarl==1.18.3 # via # aio-pika # aiormq diff --git a/src/simulator_worker/simulator_worker.py b/src/simulator_worker/simulator_worker.py index 2095602..0a5a350 100644 --- a/src/simulator_worker/simulator_worker.py +++ b/src/simulator_worker/simulator_worker.py @@ -21,6 +21,7 @@ from uuid import uuid4 import dotenv +from omotes_sdk.internal.orchestrator_worker_events.esdl_messages import EsdlMessage from omotes_sdk.internal.worker.worker import UpdateProgressHandler, initialize_worker from omotes_sdk.types import ProtobufDict from omotes_sdk.workflow_type import ( @@ -44,7 +45,7 @@ def simulator_worker_task( input_esdl: str, workflow_config: ProtobufDict, update_progress_handler: UpdateProgressHandler -) -> str: +) -> tuple[str | None, list[EsdlMessage]]: """Simulator worker function for celery task. Note: Be careful! This spawns within a subprocess and gains a copy of memory from parent @@ -111,7 +112,7 @@ def simulator_worker_task( # Write output_esdl to file for debugging # with open(f"result_{simulation_id}.esdl", "w") as file: # file.writelines(output_esdl) - return output_esdl + return output_esdl, [] def start_app() -> None: