Skip to content
Merged
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
69 changes: 67 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,65 @@ disallow_untyped_defs = false
disallow_untyped_calls = false
check_untyped_defs = true

[[tool.mypy.overrides]]
# Legacy test files: test type-validation (intentionally wrong types),
# use pre-rewrite channel API, or have Python 2 compat cruft
module = [
"tests.integration_tests",
"tests.utils_tests",
"tests.base_tests",
"tests.channel_test",
"tests.helpers",
"tests.test_queue",
"tests.test_message",
]
ignore_errors = true

[[tool.mypy.overrides]]
# Restored legacy modules — not yet fully typed; suppress strict errors
module = [
"rabbitpy.amqp",
"rabbitpy.amqp_queue",
"rabbitpy.base",
"rabbitpy.channel",
"rabbitpy.channel0",
"rabbitpy.exchange",
"rabbitpy.heartbeat",
"rabbitpy.message",
"rabbitpy.simple",
"rabbitpy.tx",
"rabbitpy.utils",
]
disallow_untyped_defs = false
disallow_untyped_calls = false
ignore_errors = true

[tool.basedpyright]
pythonVersion = "3.11"
typeCheckingMode = "standard"
include = ["rabbitpy", "tests"]
exclude = ["examples/**", ".venv/**"]
exclude = [
"examples/**",
".venv/**",
"tests/base_tests.py",
"tests/channel_test.py",
"tests/helpers.py",
"tests/integration_tests.py",
"tests/test_message.py",
"tests/test_queue.py",
"tests/utils_tests.py",
"rabbitpy/amqp.py",
"rabbitpy/amqp_queue.py",
"rabbitpy/base.py",
"rabbitpy/channel.py",
"rabbitpy/channel0.py",
"rabbitpy/exchange.py",
"rabbitpy/heartbeat.py",
"rabbitpy/message.py",
"rabbitpy/simple.py",
"rabbitpy/tx.py",
"rabbitpy/utils.py",
]

[tool.ruff]
line-length = 79
Expand Down Expand Up @@ -129,5 +183,16 @@ flake8-quotes = {inline-quotes = "single"}
max-complexity = 15

[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["N802", "S"]
"tests/**/*.py" = ["E501", "N802", "RUF012", "S", "T20", "T203"]
"examples/**/*.py" = ["S", "T20"]
# Restored legacy modules — relax line-length and mutable-default rules
"rabbitpy/base.py" = ["E501", "RUF012", "UP007"]
"rabbitpy/channel.py" = ["E501", "RUF012"]
"rabbitpy/channel0.py" = ["E501", "RUF012"]
"rabbitpy/amqp_queue.py" = ["E501", "RUF002", "RUF012"]
"rabbitpy/exchange.py" = ["E501", "RUF012"]
"rabbitpy/message.py" = ["E501", "RUF012"]
"rabbitpy/simple.py" = ["E501", "RUF012"]
"rabbitpy/tx.py" = ["E501", "RUF012"]
"rabbitpy/heartbeat.py" = ["E501", "RUF012"]
"rabbitpy/amqp.py" = ["E501", "RUF012"]
60 changes: 57 additions & 3 deletions rabbitpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,63 @@
"""
rabbitpy, An opinionated and Pythonic RabbitMQ client
rabbitpy, a pythonic RabbitMQ client

"""

__version__ = '3.0.0'
__author__ = 'Gavin M. Roy'

__all__ = ['__author__', '__version__']
import logging

from rabbitpy.amqp import AMQP
from rabbitpy.amqp_queue import Queue
from rabbitpy.channel import Channel
from rabbitpy.connection import Connection
from rabbitpy.exchange import (
DirectExchange,
Exchange,
FanoutExchange,
HeadersExchange,
TopicExchange,
)
from rabbitpy.message import Message
from rabbitpy.simple import (
SimpleChannel,
consume,
create_direct_exchange,
create_fanout_exchange,
create_headers_exchange,
create_queue,
create_topic_exchange,
delete_exchange,
delete_queue,
get,
publish,
)
from rabbitpy.tx import Tx

logging.getLogger('rabbitpy').addHandler(logging.NullHandler())

__all__ = [
'AMQP',
'Channel',
'Connection',
'DirectExchange',
'Exchange',
'FanoutExchange',
'HeadersExchange',
'Message',
'Queue',
'SimpleChannel',
'TopicExchange',
'Tx',
'__version__',
'consume',
'create_direct_exchange',
'create_fanout_exchange',
'create_headers_exchange',
'create_queue',
'create_topic_exchange',
'delete_exchange',
'delete_queue',
'get',
'publish',
]
Loading
Loading