diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index f35cf50..22e7bae 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,34 +1,43 @@ -name: Python package +name: Tests on: [push] jobs: - build: + tests: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14.0-rc.3"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Install uv + uses: astral-sh/setup-uv@v6 with: python-version: ${{ matrix.python-version }} - - - name: Display Python version - run: python -c "import sys; print(sys.version)" - - - name: Install app - run: python -m pip install --upgrade pip setuptools wheel && pip install '.[dev]' + enable-cache: true - name: Lint with ruff - run: ruff microagent + run: uvx ruff check microagent - name: Lint with mypy - run: mypy microagent + run: uvx mypy microagent - name: Testing - run: pytest tests + run: uvx --with .[dev] pytest tests + + check: + if: always() + + needs: + - tests + + runs-on: ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/README.rst b/README.rst index 55c36d7..b83cbfb 100644 --- a/README.rst +++ b/README.rst @@ -13,18 +13,15 @@ MicroAgent .. image:: https://img.shields.io/pypi/status/microagent.svg :target: https://pypi.python.org/pypi/microagent -.. image:: https://img.shields.io/pypi/dd/microagent.svg +.. image:: https://img.shields.io/pypi/dm/microagent.svg :target: https://pypi.python.org/pypi/microagent -.. image:: https://codecov.io/gh/scailer/microagent/branch/master/graph/badge.svg - :target: https://codecov.io/gh/scailer/microagent - -.. image:: https://travis-ci.com/scailer/microagent.svg?branch=master - :target: https://travis-ci.con/scailer/microagent - .. image:: https://readthedocs.org/projects/microagent/badge/?version=latest&style=flat :target: https://microagent.readthedocs.io/ +.. image:: https://github.com/scailer/microagent/workflows/Tests/badge.svg + :target: https://github.com/scailer/microagent/actions + The goal of this project is to facilitate the creation of **microservices** interacting via a **signal bus** and/or **queue broker**. diff --git a/microagent/bus.py b/microagent/bus.py index 8dc36f2..369228c 100644 --- a/microagent/bus.py +++ b/microagent/bus.py @@ -333,6 +333,6 @@ def check_types(signal: Signal, data: dict, log: logging.Logger) -> None: if signal.type_map: for key, value in data.items(): if key not in signal.type_map: - log.warning('Receiver get unknown arg "%s" %s', key, value) + log.warning('Receiver "%s" get unknown arg "%s" %s', signal.name, key, value) elif not isinstance(value, signal.type_map[key]): - log.warning('Receiver get wrong type for "%s" %s', key, value) + log.warning('Receiver "%s" get wrong type for "%s" %s', signal.name, key, value) diff --git a/microagent/tools/redis.py b/microagent/tools/redis.py index d878fd0..f42b331 100644 --- a/microagent/tools/redis.py +++ b/microagent/tools/redis.py @@ -120,7 +120,7 @@ async def queue_length(self, name: str, **options: Any) -> int: if inspect.isawaitable(ret): return await ret - return ret # type: ignore[return-value] + return ret async def bind(self, name: str) -> None: _loop = asyncio.get_running_loop() diff --git a/pyproject.toml b/pyproject.toml index 25fcf46..64dc599 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,8 @@ classifiers = [ 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', 'Topic :: Software Development :: Libraries :: Python Modules', 'Framework :: AsyncIO' ] @@ -35,9 +37,9 @@ Repository = 'https://github.com/scailer/microagent.git' Changelog = 'https://github.com/scailer/microagent/blob/master/CHANGELOG.rst' [project.optional-dependencies] -redis = ['redis[hiredis]==5.*'] -amqp = ['aiormq==6.8.*'] -kafka = ['aiokafka==0.10.*'] +redis = ['redis[hiredis]==6.*'] +amqp = ['aiormq==6.9.*'] +kafka = ['aiokafka==0.12.*'] dev = [ 'pytest', 'pytest-runner', @@ -46,9 +48,9 @@ dev = [ 'coverage', 'mypy', 'ruff', - 'redis==5.*', - 'aiormq==6.8.*', - 'aiokafka==0.10.*', + 'redis==6.*', + 'aiormq==6.9.*', + 'aiokafka==0.12.*', ] [project.entry-points.'console_scripts'] @@ -75,11 +77,9 @@ exclude_lines = [ ' \.\.\.' ] -[tool.ruff] +[tool.lint.ruff] line-length = 100 target-version = 'py310' - -[tool.ruff.lint] preview = true select = [ 'E', 'W', 'PL', 'C90', 'N', 'UP', 'I', @@ -99,29 +99,29 @@ ignore = [ 'N818', # Checks for custom exception definitions that omit the Error suffix. ] -[tool.ruff.lint.per-file-ignores] +[tool.lint.ruff.per-file-ignores] 'microagent/tools/mocks.py' = ['PLC2701'] 'tests/*' = ['PLR2004'] 'tests/test_launcher.py' = ['N806'] # Variable `A` in function should be lowercase -[tool.ruff.lint.mccabe] +[tool.lint.ruff.mccabe] max-complexity = 10 -[tool.ruff.lint.isort] +[tool.lint.ruff.isort] case-sensitive = true combine-as-imports = true lines-after-imports = 2 lines-between-types = 1 split-on-trailing-comma = false -[tool.ruff.lint.pep8-naming] +[tool.lint.ruff.pep8-naming] extend-ignore-names = ['test_*'] -[tool.ruff.lint.flake8-annotations] +[tool.lint.ruff.flake8-annotations] allow-star-arg-any = true ignore-fully-untyped = true # temp, legacy code -[tool.ruff.lint.flake8-quotes] +[tool.lint.ruff.flake8-quotes] inline-quotes = 'single' docstring-quotes = 'single' multiline-quotes = 'single'