Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-oslo.metrics for
openSUSE:Factory checked in at 2026-03-09 16:11:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-oslo.metrics (Old)
and /work/SRC/openSUSE:Factory/.python-oslo.metrics.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-oslo.metrics"
Mon Mar 9 16:11:18 2026 rev:10 rq:1337531 version:0.15.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-oslo.metrics/python-oslo.metrics.changes
2025-11-10 19:18:53.524247009 +0100
+++
/work/SRC/openSUSE:Factory/.python-oslo.metrics.new.8177/python-oslo.metrics.changes
2026-03-09 16:11:44.501918956 +0100
@@ -1,0 +2,19 @@
+Sun Mar 8 21:09:44 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 0.15.1:
+ * Fix broken log format
+ * mypy: Disabling warnings for untyped imports
+ * Fix mypy errors
+ * Add typing classifier
+ * feat: add option to configure metrics serving address
+ * Add typing
+ * Add ruff
+ * Delay string interpolations at logging calls
+ * Migrate setup configuration to pyproject.toml
+ * reno: Update master for unmaintained/2024.1
+ * Drop Python 3.9 support
+ * Update master for stable/2025.2
+ * Silent WSGI server like a prometheus server
+ * Exclude test code from coverage report
+
+-------------------------------------------------------------------
Old:
----
oslo_metrics-0.13.0.tar.gz
New:
----
oslo_metrics-0.15.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-oslo.metrics.spec ++++++
--- /var/tmp/diff_new_pack.OvkkPV/_old 2026-03-09 16:11:45.361954506 +0100
+++ /var/tmp/diff_new_pack.OvkkPV/_new 2026-03-09 16:11:45.365954671 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-oslo.metrics
#
-# Copyright (c) 2025 SUSE LLC and contributors
+# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: python-oslo.metrics
-Version: 0.13.0
+Version: 0.15.1
Release: 0
Summary: Collect metrics data from other Oslo libraries
License: Apache-2.0
++++++ oslo_metrics-0.13.0.tar.gz -> oslo_metrics-0.15.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/.coveragerc
new/oslo_metrics-0.15.1/.coveragerc
--- old/oslo_metrics-0.13.0/.coveragerc 1970-01-01 01:00:00.000000000 +0100
+++ new/oslo_metrics-0.15.1/.coveragerc 2026-02-23 17:40:08.000000000 +0100
@@ -0,0 +1,7 @@
+[run]
+branch = True
+source = oslo_metrics
+omit = oslo_metrics/tests/*
+
+[report]
+ignore_errors = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/.pre-commit-config.yaml
new/oslo_metrics-0.15.1/.pre-commit-config.yaml
--- old/oslo_metrics-0.13.0/.pre-commit-config.yaml 2025-08-25
14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/.pre-commit-config.yaml 2026-02-23
17:40:08.000000000 +0100
@@ -1,35 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v5.0.0
+ rev: v6.0.0
hooks:
- id: trailing-whitespace
- # Replaces or checks mixed line ending
- id: mixed-line-ending
args: ['--fix', 'lf']
exclude: '.*\.(svg)$'
- # Forbid files which have a UTF-8 byte-order marker
- - id: check-byte-order-marker
- # Checks that non-binary executables have a proper shebang
+ - id: fix-byte-order-marker
- id: check-executables-have-shebangs
- # Check for files that contain merge conflict strings.
- id: check-merge-conflict
- # Check for debugger imports and py37+ breakpoint()
- # calls in python source
- id: debug-statements
- id: check-yaml
files: .*\.(yaml|yml)$
+ - repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.14.8
+ hooks:
+ - id: ruff-check
+ args: ['--fix', '--unsafe-fixes']
+ - id: ruff-format
- repo: https://opendev.org/openstack/hacking
- rev: 7.0.0
+ rev: 8.0.0
hooks:
- id: hacking
additional_dependencies: []
- - repo: https://github.com/PyCQA/bandit
- rev: 1.7.10
- hooks:
- - id: bandit
- args: ['-x', 'tests']
- - repo: https://github.com/asottile/pyupgrade
- rev: v3.18.0
- hooks:
- - id: pyupgrade
- args: [--py3-only]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/AUTHORS
new/oslo_metrics-0.15.1/AUTHORS
--- old/oslo_metrics-0.13.0/AUTHORS 2025-08-25 14:47:03.000000000 +0200
+++ new/oslo_metrics-0.15.1/AUTHORS 2026-02-23 17:40:54.000000000 +0100
@@ -10,6 +10,7 @@
Hervé Beraud <[email protected]>
Masahito Muroi <[email protected]>
OpenStack Release Bot <[email protected]>
+Stephen Finucane <[email protected]>
Takashi Kajinami <[email protected]>
Thierry Carrez <[email protected]>
maaoyu <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/ChangeLog
new/oslo_metrics-0.15.1/ChangeLog
--- old/oslo_metrics-0.13.0/ChangeLog 2025-08-25 14:47:03.000000000 +0200
+++ new/oslo_metrics-0.15.1/ChangeLog 2026-02-23 17:40:54.000000000 +0100
@@ -1,6 +1,32 @@
CHANGES
=======
+0.15.1
+------
+
+* Fix broken log format
+
+0.15.0
+------
+
+* mypy: Disabling warnings for untyped imports
+* Fix mypy errors
+* Add typing classifier
+* feat: add option to configure metrics serving address
+* Add typing
+* Add ruff
+* Delay string interpolations at logging calls
+* Migrate setup configuration to pyproject.toml
+
+0.14.0
+------
+
+* reno: Update master for unmaintained/2024.1
+* Drop Python 3.9 support
+* Update master for stable/2025.2
+* Silent WSGI server like a prometheus server
+* Exclude test code from coverage report
+
0.13.0
------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/PKG-INFO
new/oslo_metrics-0.15.1/PKG-INFO
--- old/oslo_metrics-0.13.0/PKG-INFO 2025-08-25 14:47:03.536528000 +0200
+++ new/oslo_metrics-0.15.1/PKG-INFO 2026-02-23 17:40:54.156673700 +0100
@@ -1,30 +1,34 @@
-Metadata-Version: 2.1
+Metadata-Version: 2.4
Name: oslo.metrics
-Version: 0.13.0
-Summary: Oslo Metrics API
-Home-page: https://opendev.org/openstack/oslo.metrics
-Author: OpenStack
-Author-email: [email protected]
+Version: 0.15.1
+Summary: Oslo Metrics library
+Author-email: OpenStack <[email protected]>
+Project-URL: Homepage, https://docs.openstack.org/oslo.metrics
+Project-URL: Repository, https://opendev.org/openstack/oslo.metrics
Classifier: Environment :: OpenStack
-Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
+Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
-Classifier: Operating System :: OS Independent
+Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
+Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
-Requires-Python: >=3.9
+Classifier: Typing :: Typed
+Requires-Python: >=3.10
+Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: pbr>=3.1.1
Requires-Dist: oslo.utils>=3.41.0
Requires-Dist: oslo.log>=3.44.0
Requires-Dist: oslo.config>=6.9.0
Requires-Dist: prometheus-client>=0.6.0
+Dynamic: license-file
+Dynamic: requires-dist
====================
Oslo Metrics Library
@@ -32,4 +36,3 @@
This Oslo metrics API supports collecting metrics data from other Oslo
libraries and exposing the metrics data to monitoring system.
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/doc/source/conf.py
new/oslo_metrics-0.15.1/doc/source/conf.py
--- old/oslo_metrics-0.13.0/doc/source/conf.py 2025-08-25 14:46:36.000000000
+0200
+++ new/oslo_metrics-0.15.1/doc/source/conf.py 2026-02-23 17:40:08.000000000
+0100
@@ -34,9 +34,7 @@
# sphinxcontrib.apidoc options
apidoc_module_dir = '../../oslo_metrics'
apidoc_output_dir = 'reference/api'
-apidoc_excluded_paths = [
- 'tests'
-]
+apidoc_excluded_paths = ['tests']
# The suffix of source filenames.
source_suffix = '.rst'
@@ -70,16 +68,19 @@
# html_static_path = ['static']
# Output file base name for HTML help builder.
-htmlhelp_basename = '%sdoc' % project
+htmlhelp_basename = f'{project}doc'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
- ('index',
- '%s.tex' % project,
- '%s Documentation' % project,
- 'OpenStack Foundation', 'manual'),
+ (
+ 'index',
+ f'{project}.tex',
+ f'{project} Documentation',
+ 'OpenStack Foundation',
+ 'manual',
+ )
]
intersphinx_mapping = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/oslo.metrics.egg-info/PKG-INFO
new/oslo_metrics-0.15.1/oslo.metrics.egg-info/PKG-INFO
--- old/oslo_metrics-0.13.0/oslo.metrics.egg-info/PKG-INFO 2025-08-25
14:47:03.000000000 +0200
+++ new/oslo_metrics-0.15.1/oslo.metrics.egg-info/PKG-INFO 2026-02-23
17:40:54.000000000 +0100
@@ -1,30 +1,34 @@
-Metadata-Version: 2.1
+Metadata-Version: 2.4
Name: oslo.metrics
-Version: 0.13.0
-Summary: Oslo Metrics API
-Home-page: https://opendev.org/openstack/oslo.metrics
-Author: OpenStack
-Author-email: [email protected]
+Version: 0.15.1
+Summary: Oslo Metrics library
+Author-email: OpenStack <[email protected]>
+Project-URL: Homepage, https://docs.openstack.org/oslo.metrics
+Project-URL: Repository, https://opendev.org/openstack/oslo.metrics
Classifier: Environment :: OpenStack
-Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
+Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
-Classifier: Operating System :: OS Independent
+Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
+Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
-Requires-Python: >=3.9
+Classifier: Typing :: Typed
+Requires-Python: >=3.10
+Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: pbr>=3.1.1
Requires-Dist: oslo.utils>=3.41.0
Requires-Dist: oslo.log>=3.44.0
Requires-Dist: oslo.config>=6.9.0
Requires-Dist: prometheus-client>=0.6.0
+Dynamic: license-file
+Dynamic: requires-dist
====================
Oslo Metrics Library
@@ -32,4 +36,3 @@
This Oslo metrics API supports collecting metrics data from other Oslo
libraries and exposing the metrics data to monitoring system.
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/oslo_metrics-0.13.0/oslo.metrics.egg-info/SOURCES.txt
new/oslo_metrics-0.15.1/oslo.metrics.egg-info/SOURCES.txt
--- old/oslo_metrics-0.13.0/oslo.metrics.egg-info/SOURCES.txt 2025-08-25
14:47:03.000000000 +0200
+++ new/oslo_metrics-0.15.1/oslo.metrics.egg-info/SOURCES.txt 2026-02-23
17:40:54.000000000 +0100
@@ -1,3 +1,4 @@
+.coveragerc
.pre-commit-config.yaml
.stestr.conf
.zuul.yaml
@@ -32,20 +33,25 @@
oslo_metrics/__main__.py
oslo_metrics/message_router.py
oslo_metrics/message_type.py
+oslo_metrics/py.typed
oslo_metrics/metrics/__init__.py
oslo_metrics/metrics/oslo_messaging.py
oslo_metrics/tests/__init__.py
oslo_metrics/tests/test_message_process.py
oslo_metrics/tests/test_message_validation.py
releasenotes/notes/add-reno-0cc4d7566599aebd.yaml
+releasenotes/notes/add-wsgi_silent_server-9c1ff4d47bf4e6d8.yaml
releasenotes/notes/port-config-ac5d9ee247a8ff9b.yaml
releasenotes/notes/remove-py38-16eda9eaf9fe00d0.yaml
+releasenotes/notes/remove-py39-8e530aaa0908d4b0.yaml
+releasenotes/notes/server-address-6baf333c21788995.yaml
releasenotes/notes/socket-permission-4081813647fcc8ac.yaml
releasenotes/source/2023.1.rst
releasenotes/source/2023.2.rst
releasenotes/source/2024.1.rst
releasenotes/source/2024.2.rst
releasenotes/source/2025.1.rst
+releasenotes/source/2025.2.rst
releasenotes/source/conf.py
releasenotes/source/index.rst
releasenotes/source/unreleased.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/oslo.metrics.egg-info/pbr.json
new/oslo_metrics-0.15.1/oslo.metrics.egg-info/pbr.json
--- old/oslo_metrics-0.13.0/oslo.metrics.egg-info/pbr.json 2025-08-25
14:47:03.000000000 +0200
+++ new/oslo_metrics-0.15.1/oslo.metrics.egg-info/pbr.json 2026-02-23
17:40:54.000000000 +0100
@@ -1 +1 @@
-{"git_version": "276d34d", "is_release": true}
\ No newline at end of file
+{"git_version": "f5fba0c", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/oslo_metrics/__main__.py
new/oslo_metrics-0.15.1/oslo_metrics/__main__.py
--- old/oslo_metrics-0.13.0/oslo_metrics/__main__.py 2025-08-25
14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/oslo_metrics/__main__.py 2026-02-23
17:40:08.000000000 +0100
@@ -19,7 +19,10 @@
import socket
import sys
import threading
+from types import FrameType
+from typing import Any
from wsgiref.simple_server import make_server
+from wsgiref.simple_server import WSGIRequestHandler
from oslo_config import cfg
from oslo_log import log as logging
@@ -29,14 +32,35 @@
oslo_metrics_configs = [
- cfg.StrOpt('metrics_socket_file',
- default='/var/tmp/metrics_collector.sock', # nosec
- help='Unix domain socket file to be used'
- ' to send rpc related metrics'),
- cfg.PortOpt('prometheus_port', default=3000,
- help='Port number to expose metrics in prometheus format.'),
- cfg.IntOpt('metrics_socket_perm', default=0o660,
- help='Permission set to the unix domain socket file'),
+ cfg.StrOpt(
+ 'metrics_socket_file',
+ default='/var/tmp/metrics_collector.sock', # noqa: S108
+ help='Unix domain socket file to be used to send rpc related metrics',
+ ),
+ cfg.StrOpt(
+ 'prometheus_host',
+ default='',
+ help='Hostname or IP address to serve metrics. An empty value '
+ '(the default) makes the server bind to all network '
+ 'interfaces, equivalent to 0.0.0.0.',
+ ),
+ cfg.PortOpt(
+ 'prometheus_port',
+ default=3000,
+ help='Port number to expose metrics in prometheus format.',
+ ),
+ cfg.IntOpt(
+ 'metrics_socket_perm',
+ default=0o660,
+ help='Permission set to the unix domain socket file',
+ ),
+ cfg.BoolOpt(
+ 'wsgi_silent_server',
+ default=True,
+ help='Whether to silence the WSGI server. If disabled, the '
+ 'WSGI server will print all requests it receives on '
+ 'STDOUT. This could be very verbose.',
+ ),
]
cfg.CONF.register_opts(oslo_metrics_configs, group='oslo_metrics')
@@ -47,9 +71,8 @@
logging.setup(CONF, 'oslo-metrics')
-class MetricsListener():
-
- def __init__(self, socket_path):
+class MetricsListener:
+ def __init__(self, socket_path: str) -> None:
self.socket_path = socket_path
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
self.unlink(socket_path)
@@ -58,17 +81,18 @@
self.start = True
self.router = message_router.MessageRouter()
- def unlink(self, socket_path):
+ def unlink(self, socket_path: str) -> None:
try:
os.unlink(socket_path)
except OSError:
if os.path.exists(socket_path):
raise
- def serve(self):
+ def serve(self) -> None:
while self.start:
readable, writable, exceptional = select.select(
- [self.socket], [], [], 1)
+ [self.socket], [], [], 1
+ )
if len(readable) == 0:
continue
try:
@@ -77,24 +101,35 @@
msg = self.socket.recv(65565)
LOG.debug("got message")
self.router.process(msg)
- except socket.timeout:
+ except TimeoutError:
pass
- def stop(self):
+ def stop(self) -> None:
self.socket.close()
self.start = False
+class _SilentHandler(WSGIRequestHandler):
+ """WSGI handler that does not log requests."""
+
+ def log_message(self, format: str, *args: Any) -> None:
+ """Log nothing."""
+
+
httpd = None
-def handle_sigterm(_signum, _frame):
+def handle_sigterm(_signum: int, _frame: FrameType | None) -> None:
+ if httpd is None:
+ # this should never happen
+ raise RuntimeError('httpd is uninitialized')
+
LOG.debug("Caught sigterm")
shutdown_thread = threading.Thread(target=httpd.shutdown)
shutdown_thread.start()
-def main():
+def main() -> None:
cfg.CONF(sys.argv[1:])
socket_path = cfg.CONF.oslo_metrics.metrics_socket_file
m = MetricsListener(socket_path)
@@ -107,10 +142,25 @@
mt.start()
app = make_wsgi_app()
+
+ global httpd
+ if cfg.CONF.oslo_metrics.wsgi_silent_server:
+ httpd = make_server(
+ CONF.oslo_metrics.prometheus_host,
+ CONF.oslo_metrics.prometheus_port,
+ app,
+ handler_class=_SilentHandler,
+ )
+ else:
+ httpd = make_server(
+ CONF.oslo_metrics.prometheus_host,
+ CONF.oslo_metrics.prometheus_port,
+ app,
+ )
+
+ signal.signal(signal.SIGTERM, handle_sigterm)
+
try:
- global httpd
- httpd = make_server('', CONF.oslo_metrics.prometheus_port, app)
- signal.signal(signal.SIGTERM, handle_sigterm)
httpd.serve_forever()
except KeyboardInterrupt:
pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/oslo_metrics/message_router.py
new/oslo_metrics-0.15.1/oslo_metrics/message_router.py
--- old/oslo_metrics-0.13.0/oslo_metrics/message_router.py 2025-08-25
14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/oslo_metrics/message_router.py 2026-02-23
17:40:08.000000000 +0100
@@ -21,31 +21,28 @@
LOG = logging.getLogger(__name__)
-MODULE_LISTS = [
- "oslo_metrics.metrics.oslo_messaging",
-]
+MODULE_LISTS = ["oslo_metrics.metrics.oslo_messaging"]
-class MessageRouter():
-
- def __init__(self):
+class MessageRouter:
+ def __init__(self) -> None:
self.modules = {}
for m_str in MODULE_LISTS:
mod = importutils.try_import(m_str, False)
if not mod:
- LOG.error("Failed to load module %s" % m_str)
+ LOG.error("Failed to load module %s", m_str)
self.modules[m_str.split('.')[-1]] = mod
- def process(self, raw_string):
+ def process(self, raw_string: bytes) -> None:
try:
metric = message_type.Metric.from_json(raw_string.decode())
self.dispatch(metric)
except Exception as e:
LOG.error("Failed to parse: %s", e)
- def dispatch(self, metric):
+ def dispatch(self, metric: message_type.Metric) -> None:
if metric.module not in self.modules:
- LOG.error("Failed to lookup modules by %s" % metric.module)
+ LOG.error("Failed to lookup modules by %s", metric.module)
return
mod = self.modules.get(metric.module)
@@ -53,7 +50,7 @@
try:
metric_definition = getattr(mod, metric.name)
except AttributeError as e:
- LOG.error("Failed to load metrics {}: {}".format(metric.name, e))
+ LOG.error("Failed to load metrics %s: %s", metric.name, e)
return
# Get labels
@@ -61,10 +58,13 @@
metric_with_label = getattr(metric_definition, "labels")
metric_with_label = metric_with_label(**metric.labels)
except AttributeError as e:
- LOG.error("Failed to load labels func from metrics %s: %s" %
- (metric.name, e))
+ LOG.error(
+ "Failed to load labels func from metrics %s: %s",
+ metric.name,
+ e,
+ )
return
- LOG.debug("Get labels with {}: {}".format(metric.name, metric.labels))
+ LOG.debug("Get labels with %s: %s", metric.name, metric.labels)
# perform action
try:
@@ -74,8 +74,15 @@
else:
embed_action()
except AttributeError as e:
- LOG.error("Failed to perform metric actionv %s, %s: %s" %
- (metric.action.action, metric.action.value, e))
+ LOG.error(
+ "Failed to perform metric actionv %s, %s: %s",
+ metric.action.action,
+ metric.action.value,
+ e,
+ )
return
- LOG.debug("Perform action %s for %s metrics" %
- (metric.action.action, metric.name))
+ LOG.debug(
+ "Perform action %s for %s metrics",
+ metric.action.action,
+ metric.name,
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/oslo_metrics/message_type.py
new/oslo_metrics-0.15.1/oslo_metrics/message_type.py
--- old/oslo_metrics-0.13.0/oslo_metrics/message_type.py 2025-08-25
14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/oslo_metrics/message_type.py 2026-02-23
17:40:08.000000000 +0100
@@ -14,77 +14,87 @@
# under the License.
import json
+from typing import Any, TypedDict
class UnSupportedMetricActionError(Exception):
- def __init__(self, message=None):
+ def __init__(self, message: str | None = None) -> None:
self.message = message
class MetricValidationError(Exception):
- def __init__(self, message=None):
+ def __init__(self, message: str | None = None) -> None:
self.message = message
-class MetricAction():
+class _MetricActionDict(TypedDict, total=False):
+ action: str
+ value: str
+
+
+class MetricAction:
actions = ['inc', 'observe']
- def __init__(self, action, value):
+ def __init__(self, action: str, value: str) -> None:
if action not in self.actions:
raise UnSupportedMetricActionError(
- "%s action is not supported" % action)
+ f"{action} action is not supported"
+ )
self.action = action
self.value = value
@classmethod
- def validate(cls, metric_action_dict):
+ def validate(cls, metric_action_dict: _MetricActionDict) -> None:
if "value" not in metric_action_dict:
raise MetricValidationError("action need 'value' field")
if "action" not in metric_action_dict:
raise MetricValidationError("action need 'action' field")
if metric_action_dict["action"] not in cls.actions:
raise MetricValidationError(
- "action should be choosen from %s" % cls.actions)
+ f"action should be choosen from {cls.actions}"
+ )
@classmethod
- def from_dict(cls, metric_action_dict):
- return cls(
- metric_action_dict["action"],
- metric_action_dict["value"]
- )
+ def from_dict(
+ cls, metric_action_dict: _MetricActionDict
+ ) -> 'MetricAction':
+ return cls(metric_action_dict["action"], metric_action_dict["value"])
-class Metric():
- def __init__(self, module, name, action, **labels):
+class Metric:
+ def __init__(
+ self, module: str, name: str, action: MetricAction, **labels: str
+ ) -> None:
self.module = module
self.name = name
self.action = action
self.labels = labels
- def to_json(self):
+ def to_json(self) -> str:
raw = {
"module": self.module,
"name": self.name,
"action": {
"value": self.action.value,
- "action": self.action.action
+ "action": self.action.action,
},
- "labels": self.labels
+ "labels": self.labels,
}
return json.dumps(raw)
@classmethod
- def from_json(cls, encoded):
+ def from_json(cls, encoded: str) -> 'Metric':
metric_dict = json.loads(encoded)
cls._validate(metric_dict)
return Metric(
metric_dict["module"],
metric_dict["name"],
MetricAction.from_dict(metric_dict["action"]),
- **metric_dict["labels"])
+ **metric_dict["labels"],
+ )
@classmethod
- def _validate(cls, metric_dict):
+ def _validate(cls, metric_dict: dict[str, Any]) -> None:
if "module" not in metric_dict:
raise MetricValidationError("module should be specified")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/oslo_metrics-0.13.0/oslo_metrics/metrics/oslo_messaging.py
new/oslo_metrics-0.15.1/oslo_metrics/metrics/oslo_messaging.py
--- old/oslo_metrics-0.13.0/oslo_metrics/metrics/oslo_messaging.py
2025-08-25 14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/oslo_metrics/metrics/oslo_messaging.py
2026-02-23 17:40:08.000000000 +0100
@@ -16,17 +16,46 @@
import prometheus_client
rpc_server_common_labels = [
- 'exchange', 'topic', 'server', 'endpoint', 'namespace',
- 'version', 'method', 'process'
+ 'exchange',
+ 'topic',
+ 'server',
+ 'endpoint',
+ 'namespace',
+ 'version',
+ 'method',
+ 'process',
]
rpc_client_common_labels = [
- 'call_type', 'exchange', 'topic', 'namespace', 'version',
- 'server', 'fanout', 'process', 'method', 'timeout'
+ 'call_type',
+ 'exchange',
+ 'topic',
+ 'namespace',
+ 'version',
+ 'server',
+ 'fanout',
+ 'process',
+ 'method',
+ 'timeout',
]
rpc_processing_seconds_buckets = [
- 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0,
- 2.5, 5.0, 7.5, 10.0, 25.0, 50.0, 75.0, 100
+ 0.01,
+ 0.025,
+ 0.05,
+ 0.075,
+ 0.1,
+ 0.25,
+ 0.5,
+ 0.75,
+ 1.0,
+ 2.5,
+ 5.0,
+ 7.5,
+ 10.0,
+ 25.0,
+ 50.0,
+ 75.0,
+ 100,
]
# RPC Server Metrics
@@ -34,42 +63,50 @@
'oslo_messaging_rpc_server_invocation_start_total',
'Total number of RPC invocation start. This doesn\'t count'
'if rpc server failed to find method from endpoints.',
- rpc_server_common_labels)
+ rpc_server_common_labels,
+)
rpc_server_invocation_end_total = prometheus_client.Counter(
'oslo_messaging_rpc_server_invocation_end_total',
'Total number of RPC invocation end.',
- rpc_server_common_labels)
+ rpc_server_common_labels,
+)
rpc_server_processing_seconds = prometheus_client.Histogram(
'oslo_messaging_rpc_server_processing_seconds',
'Duration of RPC processing.',
rpc_server_common_labels,
- buckets=rpc_processing_seconds_buckets)
+ buckets=rpc_processing_seconds_buckets,
+)
rpc_server_exception_total = prometheus_client.Counter(
'oslo_messaging_rpc_server_exception_total',
'Total number of exception while RPC processing.',
- rpc_server_common_labels + ['exception'])
+ rpc_server_common_labels + ['exception'],
+)
# RPC Client Metrics
rpc_client_invocation_start_total = prometheus_client.Counter(
'oslo_messaging_rpc_client_invocation_start_total',
'Total number of RPC invocation start.',
- rpc_client_common_labels)
+ rpc_client_common_labels,
+)
rpc_client_invocation_end_total = prometheus_client.Counter(
'oslo_messaging_rpc_client_invocation_end_total',
'Total number of RPC invocation end.',
- rpc_client_common_labels)
+ rpc_client_common_labels,
+)
rpc_client_processing_seconds = prometheus_client.Histogram(
'oslo_messaging_rpc_client_processing_seconds',
'Duration of RPC processing.',
rpc_client_common_labels,
- buckets=rpc_processing_seconds_buckets)
+ buckets=rpc_processing_seconds_buckets,
+)
rpc_client_exception_total = prometheus_client.Counter(
'oslo_messaging_rpc_client_exception_total',
'Total number of exception while RPC processing.',
- rpc_client_common_labels + ['exception', ])
+ rpc_client_common_labels + ['exception'],
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/oslo_metrics-0.13.0/oslo_metrics/tests/test_message_process.py
new/oslo_metrics-0.15.1/oslo_metrics/tests/test_message_process.py
--- old/oslo_metrics-0.13.0/oslo_metrics/tests/test_message_process.py
2025-08-25 14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/oslo_metrics/tests/test_message_process.py
2026-02-23 17:40:08.000000000 +0100
@@ -13,6 +13,7 @@
"""
test_message_process
--------------------
+
Check that messages are processed correctly
"""
@@ -24,7 +25,6 @@
class TestProcessMessage(base.BaseTestCase):
-
def setUp(self):
super().setUp()
@@ -48,9 +48,7 @@
}
}"""
- with mock.patch.object(
- prometheus_client.Counter, 'inc',
- ) as mock_inc:
+ with mock.patch.object(prometheus_client.Counter, 'inc') as mock_inc:
router = message_router.MessageRouter()
router.process(received_json)
mock_inc.assert_called_once_with()
@@ -78,7 +76,7 @@
}"""
with mock.patch.object(
- prometheus_client.Histogram, 'observe',
+ prometheus_client.Histogram, 'observe'
) as mock_inc:
router = message_router.MessageRouter()
router.process(received_json)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/oslo_metrics-0.13.0/oslo_metrics/tests/test_message_validation.py
new/oslo_metrics-0.15.1/oslo_metrics/tests/test_message_validation.py
--- old/oslo_metrics-0.13.0/oslo_metrics/tests/test_message_validation.py
2025-08-25 14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/oslo_metrics/tests/test_message_validation.py
2026-02-23 17:40:08.000000000 +0100
@@ -12,11 +12,14 @@
"""
test_message_validation
---------------------
+-----------------------
+
Check that messages validation is working properly
"""
import json
+from typing import Any
+
from oslo_metrics import message_type
from oslotest import base
@@ -29,41 +32,51 @@
try:
func(*args, **kwargs)
self.assertFail()
- except Exception as e:
+ except (
+ message_type.MetricValidationError,
+ message_type.UnSupportedMetricActionError,
+ ) as e:
self.assertEqual(message, e.message)
def test_message_validation(self):
- metric = dict()
+ metric: dict[str, Any] = {}
message = "module should be specified"
self.assertRaisesWithMessage(
- message, message_type.Metric.from_json, json.dumps(metric))
+ message, message_type.Metric.from_json, json.dumps(metric)
+ )
metric['module'] = "test"
message = "name should be specified"
self.assertRaisesWithMessage(
- message, message_type.Metric.from_json, json.dumps(metric))
+ message, message_type.Metric.from_json, json.dumps(metric)
+ )
metric['name'] = "test"
message = "action should be specified"
self.assertRaisesWithMessage(
- message, message_type.Metric.from_json, json.dumps(metric))
+ message, message_type.Metric.from_json, json.dumps(metric)
+ )
metric['action'] = "test"
message = "labels should be specified"
self.assertRaisesWithMessage(
- message, message_type.Metric.from_json, json.dumps(metric))
+ message, message_type.Metric.from_json, json.dumps(metric)
+ )
metric['labels'] = "test_label"
message = "action need 'value' field"
self.assertRaisesWithMessage(
- message, message_type.Metric.from_json, json.dumps(metric))
+ message, message_type.Metric.from_json, json.dumps(metric)
+ )
metric['action'] = {"value": "1"}
message = "action need 'action' field"
self.assertRaisesWithMessage(
- message, message_type.Metric.from_json, json.dumps(metric))
+ message, message_type.Metric.from_json, json.dumps(metric)
+ )
metric['action']['action'] = "test"
message = "action should be choosen from ['inc', 'observe']"
self.assertRaisesWithMessage(
- message, message_type.Metric.from_json, json.dumps(metric))
+ message, message_type.Metric.from_json, json.dumps(metric)
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/pyproject.toml
new/oslo_metrics-0.15.1/pyproject.toml
--- old/oslo_metrics-0.13.0/pyproject.toml 2025-08-25 14:46:36.000000000
+0200
+++ new/oslo_metrics-0.15.1/pyproject.toml 2026-02-23 17:40:08.000000000
+0100
@@ -1,3 +1,72 @@
[build-system]
requires = ["pbr>=6.1.1"]
build-backend = "pbr.build"
+
+[project]
+name = "oslo.metrics"
+description = "Oslo Metrics library"
+readme = "README.rst"
+authors = [
+ {name = "OpenStack", email = "[email protected]"},
+]
+requires-python = ">=3.10"
+classifiers = [
+ "Environment :: OpenStack",
+ "Intended Audience :: Information Technology",
+ "Intended Audience :: System Administrators",
+ "License :: OSI Approved :: Apache Software License",
+ "Operating System :: POSIX :: Linux",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+ "Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3 :: Only",
+ "Programming Language :: Python :: Implementation :: CPython",
+ "Typing :: Typed",
+]
+dynamic = ["version", "dependencies"]
+
+[project.scripts]
+oslo-metrics = "oslo_metrics.__main__:main"
+
+[project.urls]
+Homepage = "https://docs.openstack.org/oslo.metrics"
+Repository = "https://opendev.org/openstack/oslo.metrics"
+
+[tool.setuptools]
+packages = ["oslo_metrics"]
+
+[tool.mypy]
+python_version = "3.10"
+show_column_numbers = true
+show_error_context = true
+strict = true
+disable_error_code = ["import-untyped"]
+exclude = '(?x)(doc | examples | releasenotes)'
+
+[[tool.mypy.overrides]]
+module = ["oslo_metrics.tests.*"]
+disallow_untyped_calls = false
+disallow_untyped_defs = false
+disallow_subclassing_any = false
+disallow_any_generics = false
+
+[tool.ruff]
+line-length = 79
+
+[tool.ruff.lint]
+select = ["C4", "E4", "E5", "E7", "E9", "F", "S", "UP"]
+ignore = [
+ # we only use asserts for type narrowing
+ "S101",
+]
+
+[tool.ruff.lint.per-file-ignores]
+"oslo_metrics/tests/*" = ["S"]
+
+[tool.ruff.format]
+quote-style = "preserve"
+docstring-code-format = true
+skip-magic-trailing-comma = true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/oslo_metrics-0.13.0/releasenotes/notes/add-wsgi_silent_server-9c1ff4d47bf4e6d8.yaml
new/oslo_metrics-0.15.1/releasenotes/notes/add-wsgi_silent_server-9c1ff4d47bf4e6d8.yaml
---
old/oslo_metrics-0.13.0/releasenotes/notes/add-wsgi_silent_server-9c1ff4d47bf4e6d8.yaml
1970-01-01 01:00:00.000000000 +0100
+++
new/oslo_metrics-0.15.1/releasenotes/notes/add-wsgi_silent_server-9c1ff4d47bf4e6d8.yaml
2026-02-23 17:40:08.000000000 +0100
@@ -0,0 +1,7 @@
+---
+other:
+ - |
+ Add a new option ``wsgi_silent_server`` to enable/disable STDOUT logs on
+ oslo.metrics wsgi prometheus exporter.
+ By default this new option will be set to ``True``, which means logs are
+ **not** going to be printed anymore.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/oslo_metrics-0.13.0/releasenotes/notes/remove-py39-8e530aaa0908d4b0.yaml
new/oslo_metrics-0.15.1/releasenotes/notes/remove-py39-8e530aaa0908d4b0.yaml
---
old/oslo_metrics-0.13.0/releasenotes/notes/remove-py39-8e530aaa0908d4b0.yaml
1970-01-01 01:00:00.000000000 +0100
+++
new/oslo_metrics-0.15.1/releasenotes/notes/remove-py39-8e530aaa0908d4b0.yaml
2026-02-23 17:40:08.000000000 +0100
@@ -0,0 +1,5 @@
+---
+upgrade:
+ - |
+ Support for Python 3.9 has been removed. Now the minimum python version
+ supported is 3.10.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/oslo_metrics-0.13.0/releasenotes/notes/server-address-6baf333c21788995.yaml
new/oslo_metrics-0.15.1/releasenotes/notes/server-address-6baf333c21788995.yaml
---
old/oslo_metrics-0.13.0/releasenotes/notes/server-address-6baf333c21788995.yaml
1970-01-01 01:00:00.000000000 +0100
+++
new/oslo_metrics-0.15.1/releasenotes/notes/server-address-6baf333c21788995.yaml
2026-02-23 17:40:08.000000000 +0100
@@ -0,0 +1,5 @@
+---
+features:
+ - |
+ Added `prometheus_host` option to configure server address for
+ serving metrics.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/releasenotes/source/2024.1.rst
new/oslo_metrics-0.15.1/releasenotes/source/2024.1.rst
--- old/oslo_metrics-0.13.0/releasenotes/source/2024.1.rst 2025-08-25
14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/releasenotes/source/2024.1.rst 2026-02-23
17:40:08.000000000 +0100
@@ -3,4 +3,4 @@
===========================
.. release-notes::
- :branch: stable/2024.1
+ :branch: unmaintained/2024.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/releasenotes/source/2025.2.rst
new/oslo_metrics-0.15.1/releasenotes/source/2025.2.rst
--- old/oslo_metrics-0.13.0/releasenotes/source/2025.2.rst 1970-01-01
01:00:00.000000000 +0100
+++ new/oslo_metrics-0.15.1/releasenotes/source/2025.2.rst 2026-02-23
17:40:08.000000000 +0100
@@ -0,0 +1,6 @@
+===========================
+2025.2 Series Release Notes
+===========================
+
+.. release-notes::
+ :branch: stable/2025.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/releasenotes/source/conf.py
new/oslo_metrics-0.15.1/releasenotes/source/conf.py
--- old/oslo_metrics-0.13.0/releasenotes/source/conf.py 2025-08-25
14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/releasenotes/source/conf.py 2026-02-23
17:40:08.000000000 +0100
@@ -33,10 +33,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
-extensions = [
- 'openstackdocstheme',
- 'reno.sphinxext',
-]
+extensions = ['openstackdocstheme', 'reno.sphinxext']
# openstackdocstheme options
openstackdocs_repo_name = 'openstack/oslo.metrics'
@@ -194,10 +191,8 @@
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
-
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
-
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
@@ -206,9 +201,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- ('index', 'oslo.metricsReleaseNotes.tex',
- 'oslo.metrics Release Notes Documentation',
- 'oslo.metrics Developers', 'manual'),
+ (
+ 'index',
+ 'oslo.metricsReleaseNotes.tex',
+ 'oslo.metrics Release Notes Documentation',
+ 'oslo.metrics Developers',
+ 'manual',
+ )
]
# The name of an image file (relative to this directory) to place at the top of
@@ -236,9 +235,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'oslo.metricsReleaseNotes',
- 'oslo.metrics Release Notes Documentation',
- ['oslo.metrics Developers'], 1)
+ (
+ 'index',
+ 'oslo.metricsReleaseNotes',
+ 'oslo.metrics Release Notes Documentation',
+ ['oslo.metrics Developers'],
+ 1,
+ )
]
# If true, show URL addresses after external links.
@@ -250,11 +253,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- ('index', 'oslo.metricsReleaseNotes',
- 'oslo.metrics Release Notes Documentation',
- 'oslo.metrics Developers', 'oslo.metricsReleaseNotes',
- 'One line description of project.',
- 'Miscellaneous'),
+ (
+ 'index',
+ 'oslo.metricsReleaseNotes',
+ 'oslo.metrics Release Notes Documentation',
+ 'oslo.metrics Developers',
+ 'oslo.metricsReleaseNotes',
+ 'One line description of project.',
+ 'Miscellaneous',
+ )
]
# Documents to append as an appendix to all manuals.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/releasenotes/source/index.rst
new/oslo_metrics-0.15.1/releasenotes/source/index.rst
--- old/oslo_metrics-0.13.0/releasenotes/source/index.rst 2025-08-25
14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/releasenotes/source/index.rst 2026-02-23
17:40:08.000000000 +0100
@@ -6,6 +6,7 @@
:maxdepth: 1
unreleased
+ 2025.2
2025.1
2024.2
2024.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/setup.cfg
new/oslo_metrics-0.15.1/setup.cfg
--- old/oslo_metrics-0.13.0/setup.cfg 2025-08-25 14:47:03.536528000 +0200
+++ new/oslo_metrics-0.15.1/setup.cfg 2026-02-23 17:40:54.156673700 +0100
@@ -1,34 +1,5 @@
[metadata]
name = oslo.metrics
-author = OpenStack
-author_email = [email protected]
-summary = Oslo Metrics API
-description_file =
- README.rst
-home_page = https://opendev.org/openstack/oslo.metrics
-python_requires = >=3.9
-classifier =
- Environment :: OpenStack
- Intended Audience :: Developers
- Intended Audience :: Information Technology
- License :: OSI Approved :: Apache Software License
- Operating System :: OS Independent
- Programming Language :: Python
- Programming Language :: Python :: 3
- Programming Language :: Python :: 3.9
- Programming Language :: Python :: 3.10
- Programming Language :: Python :: 3.11
- Programming Language :: Python :: 3.12
- Programming Language :: Python :: 3 :: Only
- Programming Language :: Python :: Implementation :: CPython
-
-[files]
-packages =
- oslo_metrics
-
-[entry_points]
-console_scripts =
- oslo-metrics = oslo_metrics.__main__:main
[egg_info]
tag_build =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/setup.py
new/oslo_metrics-0.15.1/setup.py
--- old/oslo_metrics-0.13.0/setup.py 2025-08-25 14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/setup.py 2026-02-23 17:40:08.000000000 +0100
@@ -15,6 +15,4 @@
import setuptools
-setuptools.setup(
- setup_requires=['pbr>=2.0.0'],
- pbr=True)
+setuptools.setup(setup_requires=['pbr>=2.0.0'], pbr=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo_metrics-0.13.0/tox.ini
new/oslo_metrics-0.15.1/tox.ini
--- old/oslo_metrics-0.13.0/tox.ini 2025-08-25 14:46:36.000000000 +0200
+++ new/oslo_metrics-0.15.1/tox.ini 2026-02-23 17:40:08.000000000 +0100
@@ -7,17 +7,30 @@
find
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
+ -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.pyc" -delete
stestr run --slowest {posargs}
[testenv:pep8]
-skip_install = true
+description =
+ Run style checks.
deps =
pre-commit
+ {[testenv:mypy]deps}
commands =
pre-commit run -a
+ {[testenv:mypy]commands}
+
+[testenv:mypy]
+description =
+ Run type checks.
+deps =
+ {[testenv]deps}
+ mypy
+commands =
+ mypy --cache-dir="{envdir}/mypy_cache" {posargs:oslo_metrics}
[testenv:venv]
commands = {posargs}
@@ -41,13 +54,15 @@
coverage xml -o cover/coverage.xml
[flake8]
+# We only enable the hacking (H) checks
+select = H
show-source = True
-ignore = H405,W504,F405
-builtins = _
-exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
+# H904: Delay string interpolations at logging calls
+enable-extensions = H904
[hacking]
import_exceptions =
+ typing
[testenv:releasenotes]
allowlist_externals =