Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(structure): restructure project layout #1712

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
7 changes: 3 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[tool:pytest]
testpaths = t/unit/
python_classes = test_*

[build_sphinx]
Expand Down Expand Up @@ -27,12 +26,12 @@ files =
kombu/abstract.py,
kombu/utils/time.py,
kombu/utils/uuid.py,
t/unit/utils/test_uuid.py,
tests/unit/utils/test_uuid.py,
kombu/utils/text.py,
kombu/exceptions.py,
t/unit/test_exceptions.py,
tests/unit/test_exceptions.py,
kombu/clocks.py,
t/unit/test_clocks.py,
tests/unit/test_clocks.py,
kombu/__init__.py,
kombu/asynchronous/__init__.py,
kombu/asynchronous/aws/__init__.py,
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import re
import sys

import setuptools
from setuptools import setup

# -- Parse meta
Expand Down Expand Up @@ -82,7 +81,6 @@ def readme():

setup(
name='kombu',
packages=setuptools.find_packages(exclude=['t', 't.*']),
version=meta['version'],
description=meta['doc'],
keywords='messaging message amqp rabbitmq redis actor producer consumer',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import pytest

import t.skip
import tests.skip

pytest.importorskip('boto3')
pytest.importorskip('pycurl')


@t.skip.if_pypy
@tests.skip.if_pypy
@pytest.mark.usefixtures('hub')
class AWSCase:
pass
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from kombu.asynchronous.aws.sqs.message import AsyncMessage
from kombu.asynchronous.aws.sqs.queue import AsyncQueue
from kombu.utils.uuid import uuid
from t.mocks import PromiseMock
from tests.mocks import PromiseMock

from ..case import AWSCase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from kombu.asynchronous.aws.sqs.message import AsyncMessage
from kombu.asynchronous.aws.sqs.queue import AsyncQueue
from t.mocks import PromiseMock
from tests.mocks import PromiseMock

from ..case import AWSCase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
AsyncHTTPSConnection)
from kombu.asynchronous.aws.ext import boto3
from kombu.exceptions import HttpError
from t.mocks import PromiseMock
from tests.mocks import PromiseMock

from .case import AWSCase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import pytest

import t.skip
import tests.skip
from kombu.asynchronous.http.curl import READ, WRITE, CurlClient

pytest.importorskip('pycurl')


@t.skip.if_pypy
@tests.skip.if_pypy
@pytest.mark.usefixtures('hub')
class test_CurlClient:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import pytest
from vine import promise

import t.skip
import tests.skip
from kombu.asynchronous import http
from kombu.asynchronous.http.base import BaseClient, normalize_header
from kombu.exceptions import HttpError
from t.mocks import PromiseMock
from tests.mocks import PromiseMock


class test_Headers:
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_as_context(self):
c.close.assert_called_with()


@t.skip.if_pypy
@tests.skip.if_pypy
class test_Client:

def test_get_client(self, hub):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion t/unit/test_common.py → tests/unit/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from kombu.common import (PREFETCH_COUNT_MAX, Broadcast, QoS, collect_replies,
declaration_cached, generate_oid, ignore_errors,
maybe_declare, send_reply)
from t.mocks import ContextMock, MockPool
from tests.mocks import ContextMock, MockPool

if TYPE_CHECKING:
from types import TracebackType
Expand Down
2 changes: 1 addition & 1 deletion t/unit/test_compat.py → tests/unit/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest

from kombu import Connection, Exchange, Queue, compat
from t.mocks import Channel, Transport
from tests.mocks import Channel, Transport


class test_misc:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from kombu.connection import Resource
from kombu.exceptions import OperationalError
from kombu.utils.functional import lazy
from t.mocks import TimeoutingTransport, Transport
from tests.mocks import TimeoutingTransport, Transport


class test_connection_utils:
Expand Down
2 changes: 1 addition & 1 deletion t/unit/test_entity.py → tests/unit/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from kombu.abstract import MaybeChannelBound
from kombu.exceptions import NotBoundError
from kombu.serialization import registry
from t.mocks import Transport
from tests.mocks import Transport


def get_conn() -> Connection:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion t/unit/test_messaging.py → tests/unit/test_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from kombu.exceptions import MessageStateError
from kombu.utils import json
from kombu.utils.functional import ChannelPromise
from t.mocks import Transport
from tests.mocks import Transport


class test_Producer:
Expand Down
2 changes: 1 addition & 1 deletion t/unit/test_mixins.py → tests/unit/test_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

from kombu.mixins import ConsumerMixin
from t.mocks import ContextMock
from tests.mocks import ContextMock


def Message(body, content_type='text/plain', content_encoding='utf-8'):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import pytest

import t.skip
import tests.skip
from kombu.exceptions import ContentDisallowed, DecodeError, EncodeError
from kombu.serialization import (SerializerNotInstalled,
disable_insecure_serializers, dumps,
Expand Down Expand Up @@ -193,7 +193,7 @@ def test_json_dumps(self):
)
assert a == b

@t.skip.if_pypy
@tests.skip.if_pypy
def test_msgpack_loads(self):
register_msgpack()
pytest.importorskip('msgpack')
Expand All @@ -202,7 +202,7 @@ def test_msgpack_loads(self):
content_encoding='binary')
assert res == msgpack_py_data

@t.skip.if_pypy
@tests.skip.if_pypy
def test_msgpack_dumps(self):
pytest.importorskip('msgpack')
register_msgpack()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import pytest

import t.skip
import tests.skip
from kombu import Connection, Consumer, Exchange, Producer, Queue


@t.skip.if_win32
@tests.skip.if_win32
class test_FilesystemTransport:

def setup(self):
Expand Down Expand Up @@ -145,7 +145,7 @@ def callback2(message_data, message):
assert self.q2(consumer_channel).get() is None


@t.skip.if_win32
@tests.skip.if_win32
class test_FilesystemFanout:
def setup(self):
try:
Expand Down Expand Up @@ -238,7 +238,7 @@ def callback2(message_data, message):
assert self.q2(self.consume_channel).get() is None


@t.skip.if_win32
@tests.skip.if_win32
class test_FilesystemLock:
def setup(self):
try:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from kombu import Connection
from kombu.transport.virtual import exchange
from t.mocks import Transport
from tests.mocks import Transport


class ExchangeCase:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ deps=
flake8,pydocstyle,mypy: -r{toxinidir}/requirements/pkgutils.txt

commands =
unit: python -bb -m pytest -rxs -xv --cov=kombu --cov-report=xml --no-cov-on-fail {posargs}
integration-py-amqp: pytest -xv -E py-amqp t/integration {posargs:-n2}
integration-redis: pytest -xv -E redis t/integration {posargs:-n2}
integration-mongodb: pytest -xv -E mongodb t/integration {posargs:-n2}
integration-kafka: pytest -xv -E kafka t/integration {posargs:-n2}
unit: python -bb -m pytest tests/unit -rxs -xv --cov=kombu --cov-report=xml --no-cov-on-fail {posargs}
integration-py-amqp: pytest -xv -E py-amqp tests/integration {posargs:-n2}
integration-redis: pytest -xv -E redis tests/integration {posargs:-n2}
integration-mongodb: pytest -xv -E mongodb tests/integration {posargs:-n2}
integration-kafka: pytest -xv -E kafka tests/integration {posargs:-n2}

basepython =
pypy3.9: pypy3.9
Expand Down Expand Up @@ -124,7 +124,7 @@ commands = pip install -U -r{toxinidir}/requirements/dev.txt

[testenv:flake8]
commands =
flake8 -j2 {toxinidir}/kombu {toxinidir}/t
flake8 -j2 {toxinidir}/kombu {toxinidir}/tests

[testenv:pydocstyle]
commands =
Expand Down