Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -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) }}
11 changes: 4 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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**.
Expand Down
4 changes: 2 additions & 2 deletions microagent/bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion microagent/tools/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
30 changes: 15 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]
Expand All @@ -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',
Expand All @@ -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']
Expand All @@ -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',
Expand All @@ -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'
Expand Down