Files
rally/pyproject.toml
Andriy Kurilin fd689728e7 Declare project licence according to PEP 639
Change-Id: Iefcff1021fbd3d8e80371d023cbf34ddb4f170de
Signed-off-by: Andriy Kurilin <andr.kurilin@gmail.com>
2026-10-28 21:25:30 +01:00

354 lines
11 KiB
TOML

[build-system]
requires = [
"pbr>=6.1.1",
"setuptools>=77.0.0",
]
build-backend = "pbr.build"
[project]
name = "rally"
description = "Generic Testing Framework & Tool that unifies all types of testing"
authors = [
{name = "OpenStack", email = "openstack-discuss@lists.openstack.org"},
]
readme = { file = "README.rst", content-type = "text/x-rst" }
license = "Apache-2.0"
license-files = ["LICENSE"]
classifiers = [
"Environment :: OpenStack",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = ["version", "dependencies"]
requires-python = ">=3.11"
[project.urls]
Homepage = "https://rally.readthedocs.io/"
Issues = "https://bugs.launchpad.net/rally"
Source = "https://opendev.org/openstack/rally"
Github = "https://github.com/openstack/rally"
Changelog = "https://github.com/openstack/rally/blob/master/CHANGELOG.rst"
[tool.setuptools]
include-package-data = true
[tool.setuptools.data-files]
"etc/bash_completion.d" = ["etc/rally.bash_completion"]
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
[project.optional-dependencies]
mysql = [
"PyMySQL>=0.9.0" # MIT
]
postgres = [
"psycopg[binary]>=3" # LGPL
]
[tool.setuptools.packages.find]
where = ["."]
include = ["rally", "rally.*"]
exclude = ["tests", "tests.*"]
[project.scripts]
rally = "rally.cli.main:main"
[project.entry-points."oslo.config.opts"]
rally = "rally.common.opts:list_opts"
[project.entry-points."oslo.config.opts.defaults"]
rally = "rally.common.opts:update_opt_defaults"
[tool.mypy]
files = [
"rally",
"doc/ext"
]
python_version = "3.11"
disallow_untyped_defs = true
check_untyped_defs = true
allow_redefinition = true
strict_equality = true
# disable warnings on missing `return None` at the end of functions that
# declare optional result
no_warn_no_return = true
# oslo.log ships no type information (no py.typed marker).
[[tool.mypy.overrides]]
module = "oslo_log.*"
ignore_missing_imports = true
# FIXME(andreykurilin): all the following should be fixed
[[tool.mypy.overrides]]
module = "rally.api"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.cli.cliutils"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.cli.envutils"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.cli.task_results_loader"
disable_error_code = ["attr-defined", "no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.cli.yamlutils"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.common.broker"
disable_error_code = ["no-untyped-def", "var-annotated"]
[[tool.mypy.overrides]]
module = "rally.common.db.api"
disable_error_code = ["arg-type", "assignment", "import-untyped", "no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.common.db.models"
disable_error_code = ["attr-defined", "misc", "no-untyped-def", "valid-type", "union-attr"]
[[tool.mypy.overrides]]
module = "rally.common.db.sa_types"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.common.db.schema"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.common.logging"
disable_error_code = ["attr-defined", "import-untyped", "name-defined", "no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.common.objects.deploy"
disable_error_code = ["import-not-found", "no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.common.objects.task"
disable_error_code = ["assignment", "index", "no-untyped-def", "operator"]
[[tool.mypy.overrides]]
module = "rally.common.objects.verification"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.common.objects.verifier"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.common.opts"
disable_error_code = ["no-untyped-def", "var-annotated"]
[[tool.mypy.overrides]]
module = "rally.common.streaming_algorithms"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.plugins.task.exporters.elastic.client"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.plugins.task.exporters.elastic.exporter"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.plugins.task.exporters.elastic.flatten"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.plugins.task.exporters.html"
disable_error_code = ["no-untyped-def", "var-annotated"]
[[tool.mypy.overrides]]
module = "rally.plugins.task.exporters.json_exporter"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.plugins.task.exporters.junit"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.plugins.task.exporters.old_json_results"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.plugins.task.exporters.trends"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.plugins.verification.reporters"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.plugins.verification.testr"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.task.engine"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.task.exporter"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.task.functional"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.task.processing.charts"
disable_error_code = ["index", "no-untyped-def", "override", "var-annotated"]
[[tool.mypy.overrides]]
module = "rally.task.processing.plot"
disable_error_code = ["assignment", "attr-defined", "no-untyped-def", "var-annotated"]
[[tool.mypy.overrides]]
module = "rally.task.processing.utils"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.task.service"
disable_error_code = ["call-overload", "no-untyped-def", "var-annotated"]
[[tool.mypy.overrides]]
module = "rally.task.task_cfg"
disable_error_code = ["assignment", "attr-defined", "no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.task.utils"
disable_error_code = ["index", "no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.ui.utils"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.utils.sshutils"
disable_error_code = ["assignment", "attr-defined", "no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.verification.context"
disable_error_code = ["no-untyped-def", "var-annotated"]
[[tool.mypy.overrides]]
module = "rally.verification.manager"
disable_error_code = ["no-untyped-def", "var-annotated"]
[[tool.mypy.overrides]]
module = "rally.verification.reporter"
disable_error_code = ["no-untyped-def"]
[[tool.mypy.overrides]]
module = "rally.verification.utils"
disable_error_code = ["assignment", "method-assign", "no-untyped-def"]
[tool.ruff]
line-length = 79
target-version = "py311"
[tool.ruff.lint]
# Ruff owns pycodestyle (E/W) and pyflakes (F); flake8 runs the remaining
# hacking (H), Rally-specific (N3xx) and continuation-line indentation (E12x,
# which ruff does not implement) checks. The rest of the selections enforce
# Rally's style and import conventions.
select = [
"B012", # no `return`/`break`/`continue` inside `finally`
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort: import grouping and ordering
"UP", # pyupgrade: modernise syntax for the target Python
"C4", # flake8-comprehensions
"Q", # flake8-quotes: quote style below
"ICN", # flake8-import-conventions: aliases and bans below
"TID", # flake8-tidy-imports: banned APIs below
"PGH003", # `type: ignore` must name the specific error code
"PGH004", # `noqa` must name the specific rule code
"PLC0414", # band redundant aliases
]
ignore = [
"E731", # do not assign a lambda expression, use a def
"UP031", # keep printf-style `%` formatting
"C402", # allow generators passed to dict()
"C408", # allow dict()/list()/tuple() calls over literals
]
[tool.ruff.lint.isort]
# Imports are grouped: stdlib, third-party, OpenStack (oslo & friends), then
# Rally's own code (rally + tests).
known-first-party = ["rally", "tests"]
force-single-line = true
force-sort-within-sections = true
lines-after-imports = 2
section-order = [
"future",
"standard-library",
"third-party",
"openstack",
"first-party",
"local-folder",
]
[tool.ruff.lint.isort.sections]
openstack = ["oslo_config", "oslo_db", "oslo_log", "oslo_utils", "subunit"]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"
multiline-quotes = "double"
docstring-quotes = "double"
[tool.ruff.lint.flake8-import-conventions.aliases]
datetime = "dt"
typing = "t"
typing_extensions = "te"
"rally.common.logging" = "logging"
[tool.ruff.lint.flake8-import-conventions]
# Builtins are imported as modules: forbid `from <stdlib> import ...` so the
# standard library is imported whole (e.g. `import os`, then `os.path`).
# `__future__` and `unittest` (`from unittest import mock`) stay allowed, as
# does `importlib` (`from importlib.metadata import version`).
banned-from = [
"abc", "argparse", "ast", "asyncio", "base64", "bisect", "builtins",
"calendar", "cmath", "codecs", "collections", "configparser",
"contextlib", "copy", "csv", "ctypes", "dataclasses", "datetime",
"decimal", "difflib", "dis", "email", "enum", "errno", "functools", "gc",
"getpass", "gettext", "glob", "gzip", "hashlib", "heapq", "hmac", "html",
"http", "inspect", "io", "ipaddress", "itertools", "json", "logging",
"math", "mimetypes", "multiprocessing", "numbers", "operator", "os",
"pathlib", "pickle", "platform", "pprint", "queue", "random", "re",
"secrets", "select", "shlex", "shutil", "signal", "socket", "sqlite3",
"ssl", "stat", "string", "struct", "subprocess", "sys", "tempfile",
"textwrap", "threading", "time", "token", "tokenize", "traceback",
"types", "typing", "typing_extensions", "unicodedata", "urllib", "uuid",
"warnings", "weakref", "xml", "zipfile", "zlib",
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"logging".msg = "Use rally.common.logging instead."
"oslo_log".msg = "Use rally.common.logging instead of oslo_log."
"oslo_config".msg = "Use rally.common.cfg instead of oslo_config."
[tool.ruff.lint.per-file-ignores]
# modules that legitimately touch the logging/config libraries directly
"rally/common/logging.py" = ["TID251"]
"rally/common/cfg.py" = ["TID251"]
"tests/unit/common/test_logging.py" = ["TID251"]
"tests/ci/rally_verify.py" = ["TID251"]
"tests/ci/sync_requirements.py" = ["TID251"]