diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bf21fd4..b108fba 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -21,15 +21,21 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools + python -m pip install --upgrade pip setuptools twine wheel python -m pip install '.[dev]' python -m pip install -e . - name: Lint run: | - flake8 sprockets_statsd tests + flake8 sprockets_statsd tests setup.py docs/conf.py - name: Check format run: | - yapf -dr sprockets_statsd tests + yapf -dr sprockets_statsd tests setup.py docs/conf.py + - name: Verify distribution build + run: | + rm -fr dist + python setup.py bdist_wheel + python setup.py sdist + twine check dist/* - name: Run tests run: | coverage run -m unittest diff --git a/README.rst b/README.rst index 5584c4c..882eeb4 100644 --- a/README.rst +++ b/README.rst @@ -50,13 +50,13 @@ the payload. If you are a `python-statsd`_ user, then the method names should look very familiar. That is quite intentional. I like the interface and many others do as well. There is one very very important difference though -- the -``timing`` method takes the duration as the number of **seconds** as a :class:`float` instead of the number of +``timing`` method takes the duration as the number of **seconds** as a ``float`` instead of the number of milliseconds. .. warning:: If you are accustomed to using `python-statsd`_, be aware that the ``timing`` method expects the number of - seconds as a :class:`float` instead of the number of milliseconds. + seconds as a ``float`` instead of the number of milliseconds. .. _python-statsd: https://statsd.readthedocs.io/en/latest/ diff --git a/setup.py b/setup.py index cfe6f32..61cc244 100755 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ #!/usr/bin/env python import setuptools + setuptools.setup() diff --git a/sprockets_statsd/statsd.py b/sprockets_statsd/statsd.py index 9571c2c..01d3121 100644 --- a/sprockets_statsd/statsd.py +++ b/sprockets_statsd/statsd.py @@ -486,7 +486,7 @@ class Processor: logger: logging.Logger protocol: typing.Optional[StatsdProtocol] - queue: asyncio.Queue[bytes] + queue: asyncio.Queue _create_transport: typing.Callable[[], typing.Coroutine[ typing.Any, typing.Any, typing.Tuple[asyncio.BaseTransport, StatsdProtocol]]] diff --git a/tox.ini b/tox.ini index 64481a1..0bdd33d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = lint,py37,py38,py39,tornado5 +envlist = lint,distcheck,py37,py38,py39,tornado5 toxworkdir = ./build/tox [testenv] @@ -10,8 +10,19 @@ commands = [testenv:lint] commands = - flake8 sprockets_statsd tests - yapf -dr sprockets_statsd tests + flake8 sprockets_statsd tests setup.py docs/conf.py + yapf -dr sprockets_statsd tests setup.py docs/conf.py + +[testenv:distcheck] +deps = + twine + wheel +commands = + rm -fr {envtmpdir}/dist + python setup.py sdist --dist-dir {envtmpdir}/dist + python setup.py bdist_wheel --dist-dir {envtmpdir}/dist + twine check {envtmpdir}/dist/* + rm -fr {envtmpdir}/dist [testenv:tornado5] deps =