Merge pull request #14 from dave-shawley/quiet-now

Remove debug logging of "processing metric"
This commit is contained in:
Gavin M. Roy 2023-07-28 11:17:27 -04:00 committed by GitHub
commit c39b1ff6c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 48 additions and 31 deletions

View file

@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.repository == 'sprockets/sprockets-statsd'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7 # use 3.7 for wheel compatibility
- name: Install builder
@ -22,7 +22,7 @@ jobs:
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Upload packages
uses: pypa/gh-action-pypi-publish@v1.4.2
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}

View file

@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9, 3.11]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
@ -42,7 +42,7 @@ jobs:
coverage report
coverage xml -o ./coverage.xml
- name: Send coverage to codecov.io
uses: codecov/codecov-action@v1.3.2
uses: codecov/codecov-action@v3.1.4
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml
@ -50,7 +50,7 @@ jobs:
fail_ci_if_error: true
- name: Save coverage report
if: ${{ matrix.python-version == '3.9' }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: coverage.xml
path: ./coverage.xml

2
.gitignore vendored
View file

@ -4,3 +4,5 @@ env/
*.egg-info
*.pyc
.*
!/.gitignore
!/.github

View file

@ -1,15 +1,18 @@
version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.11"
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: true
python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- readthedocs
system_packages: true

View file

@ -1,3 +1,8 @@
Next
----
- Removed debug-level logging of processing metric
- Stop testing Python 3.7
:tag:`1.0.0 <0.1.0...1.0.0>` (20-Jul-2021)
------------------------------------------
- Added ``Connector.timer`` method (addresses :issue:`8`)

View file

@ -1,4 +1,4 @@
Copyright 2021 AWeber Communications, Inc.
Copyright 2021-2023 AWeber Communications, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View file

@ -3,8 +3,10 @@ import sprockets_statsd
project = 'sprockets-statsd'
version = sprockets_statsd.version
copyright = '2021 AWeber Communications, Inc.'
html_theme = 'pyramid'
html_theme = 'python_docs_theme'
extensions = []
html_static_path = ['.']
html_css_files = ['custom.css']
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
extensions.append('sphinx.ext.autodoc')
@ -19,9 +21,10 @@ intersphinx_mapping = {
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
extensions.append('sphinx.ext.extlinks')
extlinks = {
'issue': ("https://github.com/sprockets/sprockets-statsd/issues/%s", "#"),
'issue':
("https://github.com/sprockets/sprockets-statsd/issues/%s", "#%s"),
'tag': ("https://github.com/sprockets/sprockets-statsd/compare/%s", "%s"),
}
# https://pypi.org/project/sphinx-autodoc-typehints/
extensions.append('sphinx_autodoc_typehints')
# extensions.append('sphinx_autodoc_typehints')

1
docs/custom.css Normal file
View file

@ -0,0 +1 @@
div.sphinxsidebarwrapper { overflow-x: scroll }

View file

@ -23,6 +23,7 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Communications
Topic :: Internet
Topic :: Software Development
@ -36,18 +37,17 @@ install_requires =
tornado =
tornado>=5
dev =
asynctest==0.13.0
coverage==5.5
coverage==7.2.7
flake8==3.9.2
flake8-import-order==0.18.1
sphinx==4.1.1
sphinx-autodoc-typehints==1.12.0
python-docs-theme==2023.5
sphinx>=7,<8
sprockets.http==2.2.0
tornado>=5
yapf==0.31.0
readthedocs =
sphinx==4.1.1
sphinx-autodoc-typehints==1.12.0
python-docs-theme==2023.5
sphinx>=7,<8
tornado>=5
[options.packages.find]

View file

@ -636,7 +636,6 @@ class Processor:
try:
metric = await asyncio.wait_for(self.queue.get(),
self._wait_timeout)
self.logger.debug('received %r from queue', metric)
self.queue.task_done()
except asyncio.TimeoutError:
# we still want to invoke the protocol send in case

View file

@ -6,23 +6,16 @@ import time
import typing
import unittest.mock
import asynctest
from sprockets_statsd import statsd
from tests import helpers
class ProcessorTestCase(asynctest.TestCase):
class ProcessorTestCase(unittest.IsolatedAsyncioTestCase):
ip_protocol: int
async def setUp(self):
def setUp(self):
self.test_timeout = 5.0
super().setUp()
await self.asyncSetUp()
async def tearDown(self):
await self.asyncTearDown()
super().tearDown()
async def wait_for(self, fut):
try:
@ -31,6 +24,7 @@ class ProcessorTestCase(asynctest.TestCase):
self.fail('future took too long to resolve')
async def asyncSetUp(self):
await super().asyncSetUp()
self.statsd_server = helpers.StatsdServer(self.ip_protocol)
self.statsd_task = asyncio.create_task(self.statsd_server.run())
await self.statsd_server.wait_running()
@ -38,6 +32,7 @@ class ProcessorTestCase(asynctest.TestCase):
async def asyncTearDown(self):
self.statsd_server.close()
await self.statsd_server.wait_closed()
await super().asyncTearDown()
class ProcessorTests(ProcessorTestCase):

11
tox.ini
View file

@ -1,5 +1,5 @@
[tox]
envlist = lint,distcheck,py37,py38,py39,tornado5
envlist = lint,distcheck,py38,py39,py311,tornado5,docs
toxworkdir = ./build/tox
[testenv]
@ -14,6 +14,8 @@ commands =
yapf -dr sprockets_statsd tests setup.py docs/conf.py
[testenv:distcheck]
allowlist_externals =
rm
deps =
twine
wheel
@ -25,6 +27,13 @@ commands =
rm -fr {envtmpdir}/dist
[testenv:tornado5]
base_python = py39
deps =
tornado>=5,<6
.[dev]
[testenv:docs]
deps =
.[readthedocs]
commands =
python -m sphinx -b html -aE docs build/sphinx