Merge pull request #10 from dave-shawley/fix-build

Fix build
This commit is contained in:
dave-shawley 2021-07-21 12:30:49 -04:00 committed by GitHub
commit 310e975ad5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 9 deletions

View file

@ -21,15 +21,21 @@ jobs:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies
run: | 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 '.[dev]'
python -m pip install -e . python -m pip install -e .
- name: Lint - name: Lint
run: | run: |
flake8 sprockets_statsd tests flake8 sprockets_statsd tests setup.py docs/conf.py
- name: Check format - name: Check format
run: | 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 - name: Run tests
run: | run: |
coverage run -m unittest coverage run -m unittest

View file

@ -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. 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 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. milliseconds.
.. warning:: .. warning::
If you are accustomed to using `python-statsd`_, be aware that the ``timing`` method expects the number of 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/ .. _python-statsd: https://statsd.readthedocs.io/en/latest/

View file

@ -1,3 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python
import setuptools import setuptools
setuptools.setup() setuptools.setup()

View file

@ -486,7 +486,7 @@ class Processor:
logger: logging.Logger logger: logging.Logger
protocol: typing.Optional[StatsdProtocol] protocol: typing.Optional[StatsdProtocol]
queue: asyncio.Queue[bytes] queue: asyncio.Queue
_create_transport: typing.Callable[[], typing.Coroutine[ _create_transport: typing.Callable[[], typing.Coroutine[
typing.Any, typing.Any, typing.Tuple[asyncio.BaseTransport, typing.Any, typing.Any, typing.Tuple[asyncio.BaseTransport,
StatsdProtocol]]] StatsdProtocol]]]

17
tox.ini
View file

@ -1,5 +1,5 @@
[tox] [tox]
envlist = lint,py37,py38,py39,tornado5 envlist = lint,distcheck,py37,py38,py39,tornado5
toxworkdir = ./build/tox toxworkdir = ./build/tox
[testenv] [testenv]
@ -10,8 +10,19 @@ commands =
[testenv:lint] [testenv:lint]
commands = commands =
flake8 sprockets_statsd tests flake8 sprockets_statsd tests setup.py docs/conf.py
yapf -dr sprockets_statsd tests 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] [testenv:tornado5]
deps = deps =