2023-07-10 17:43:49 +08:00
|
|
|
[build-system]
|
2024-12-04 01:42:57 +08:00
|
|
|
requires = ["setuptools"]
|
2023-07-10 17:43:49 +08:00
|
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
|
|
|
|
[project]
|
|
|
|
name = "google_benchmark"
|
|
|
|
description = "A library to benchmark code snippets."
|
2024-09-05 00:42:07 +08:00
|
|
|
requires-python = ">=3.10"
|
|
|
|
license = { file = "LICENSE" }
|
2023-07-10 17:43:49 +08:00
|
|
|
keywords = ["benchmark"]
|
|
|
|
|
2024-09-05 00:42:07 +08:00
|
|
|
authors = [{ name = "Google", email = "benchmark-discuss@googlegroups.com" }]
|
2023-07-10 17:43:49 +08:00
|
|
|
|
|
|
|
classifiers = [
|
|
|
|
"Development Status :: 4 - Beta",
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"Intended Audience :: Science/Research",
|
|
|
|
"License :: OSI Approved :: Apache Software License",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
|
|
|
"Programming Language :: Python :: 3.11",
|
2023-10-23 20:04:39 +08:00
|
|
|
"Programming Language :: Python :: 3.12",
|
2023-07-10 17:43:49 +08:00
|
|
|
"Topic :: Software Development :: Testing",
|
|
|
|
"Topic :: System :: Benchmark",
|
|
|
|
]
|
|
|
|
|
|
|
|
dynamic = ["readme", "version"]
|
|
|
|
|
2024-09-05 00:42:07 +08:00
|
|
|
dependencies = ["absl-py>=0.7.1"]
|
2023-07-10 17:43:49 +08:00
|
|
|
|
Add pre-commit config and GitHub Actions job (#1688)
* Add pre-commit config and GitHub Actions job
Contains the following hooks:
* buildifier - for formatting and linting Bazel files.
* mypy, ruff, isort, black - for Python typechecking, import hygiene,
static analysis, and formatting.
The pylint CI job was changed to be a pre-commit CI job, where pre-commit
is bootstrapped via Python.
Pylint is currently no longer part of the
code checks, but can be re-added if requested. The reason to drop was
that it does not play nicely with pre-commit, and lots of its
functionality and responsibilities are actually covered in ruff.
* Add dev extra to pyproject.toml for development installs
* Clarify that pre-commit contains only Python and Bazel hooks
* Add one-line docstrings to Bazel modules
* Apply buildifier pre-commit fixes to Bazel files
* Apply pre-commit fixes to Python files
* Supply --profile=black to isort to prevent conflicts
* Fix nanobind build file formatting
* Add tooling configs to `pyproject.toml`
In particular, set line length 80 for all Python files.
* Reformat all Python files to line length 80, fix return type annotations
Also ignores the `tools/compare.py` and `tools/gbench/report.py` files
for mypy, since they emit a barrage of errors which we can deal with
later. The errors are mostly related to dynamic classmethod definition.
2023-10-30 23:35:37 +08:00
|
|
|
[project.optional-dependencies]
|
2024-09-05 00:42:07 +08:00
|
|
|
dev = ["pre-commit>=3.3.3"]
|
Add pre-commit config and GitHub Actions job (#1688)
* Add pre-commit config and GitHub Actions job
Contains the following hooks:
* buildifier - for formatting and linting Bazel files.
* mypy, ruff, isort, black - for Python typechecking, import hygiene,
static analysis, and formatting.
The pylint CI job was changed to be a pre-commit CI job, where pre-commit
is bootstrapped via Python.
Pylint is currently no longer part of the
code checks, but can be re-added if requested. The reason to drop was
that it does not play nicely with pre-commit, and lots of its
functionality and responsibilities are actually covered in ruff.
* Add dev extra to pyproject.toml for development installs
* Clarify that pre-commit contains only Python and Bazel hooks
* Add one-line docstrings to Bazel modules
* Apply buildifier pre-commit fixes to Bazel files
* Apply pre-commit fixes to Python files
* Supply --profile=black to isort to prevent conflicts
* Fix nanobind build file formatting
* Add tooling configs to `pyproject.toml`
In particular, set line length 80 for all Python files.
* Reformat all Python files to line length 80, fix return type annotations
Also ignores the `tools/compare.py` and `tools/gbench/report.py` files
for mypy, since they emit a barrage of errors which we can deal with
later. The errors are mostly related to dynamic classmethod definition.
2023-10-30 23:35:37 +08:00
|
|
|
|
2023-07-10 17:43:49 +08:00
|
|
|
[project.urls]
|
|
|
|
Homepage = "https://github.com/google/benchmark"
|
|
|
|
Documentation = "https://github.com/google/benchmark/tree/main/docs"
|
|
|
|
Repository = "https://github.com/google/benchmark.git"
|
|
|
|
Discord = "https://discord.gg/cz7UX7wKC2"
|
|
|
|
|
|
|
|
[tool.setuptools]
|
2024-09-05 00:42:07 +08:00
|
|
|
package-dir = { "" = "bindings/python" }
|
2023-07-10 17:43:49 +08:00
|
|
|
zip-safe = false
|
|
|
|
|
|
|
|
[tool.setuptools.packages.find]
|
|
|
|
where = ["bindings/python"]
|
|
|
|
|
|
|
|
[tool.setuptools.dynamic]
|
|
|
|
readme = { file = "README.md", content-type = "text/markdown" }
|
2024-09-05 00:42:07 +08:00
|
|
|
version = { attr = "google_benchmark.__version__" }
|
2023-11-01 17:48:01 +08:00
|
|
|
|
Add pre-commit config and GitHub Actions job (#1688)
* Add pre-commit config and GitHub Actions job
Contains the following hooks:
* buildifier - for formatting and linting Bazel files.
* mypy, ruff, isort, black - for Python typechecking, import hygiene,
static analysis, and formatting.
The pylint CI job was changed to be a pre-commit CI job, where pre-commit
is bootstrapped via Python.
Pylint is currently no longer part of the
code checks, but can be re-added if requested. The reason to drop was
that it does not play nicely with pre-commit, and lots of its
functionality and responsibilities are actually covered in ruff.
* Add dev extra to pyproject.toml for development installs
* Clarify that pre-commit contains only Python and Bazel hooks
* Add one-line docstrings to Bazel modules
* Apply buildifier pre-commit fixes to Bazel files
* Apply pre-commit fixes to Python files
* Supply --profile=black to isort to prevent conflicts
* Fix nanobind build file formatting
* Add tooling configs to `pyproject.toml`
In particular, set line length 80 for all Python files.
* Reformat all Python files to line length 80, fix return type annotations
Also ignores the `tools/compare.py` and `tools/gbench/report.py` files
for mypy, since they emit a barrage of errors which we can deal with
later. The errors are mostly related to dynamic classmethod definition.
2023-10-30 23:35:37 +08:00
|
|
|
[tool.mypy]
|
|
|
|
check_untyped_defs = true
|
|
|
|
disallow_incomplete_defs = true
|
|
|
|
pretty = true
|
|
|
|
python_version = "3.11"
|
|
|
|
strict_optional = false
|
|
|
|
warn_unreachable = true
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = ["yaml"]
|
|
|
|
ignore_missing_imports = true
|
|
|
|
|
|
|
|
[tool.ruff]
|
2023-10-31 18:05:37 +08:00
|
|
|
# explicitly tell ruff the source directory to correctly identify first-party package.
|
|
|
|
src = ["bindings/python"]
|
2023-12-13 22:26:15 +08:00
|
|
|
|
2023-10-31 18:05:37 +08:00
|
|
|
line-length = 80
|
2023-11-10 18:40:31 +08:00
|
|
|
target-version = "py311"
|
2023-12-13 22:26:15 +08:00
|
|
|
|
2024-03-07 20:28:55 +08:00
|
|
|
[tool.ruff.lint]
|
2023-10-31 18:05:37 +08:00
|
|
|
# Enable pycodestyle (`E`, `W`), Pyflakes (`F`), and isort (`I`) codes by default.
|
|
|
|
select = ["E", "F", "I", "W"]
|
Add pre-commit config and GitHub Actions job (#1688)
* Add pre-commit config and GitHub Actions job
Contains the following hooks:
* buildifier - for formatting and linting Bazel files.
* mypy, ruff, isort, black - for Python typechecking, import hygiene,
static analysis, and formatting.
The pylint CI job was changed to be a pre-commit CI job, where pre-commit
is bootstrapped via Python.
Pylint is currently no longer part of the
code checks, but can be re-added if requested. The reason to drop was
that it does not play nicely with pre-commit, and lots of its
functionality and responsibilities are actually covered in ruff.
* Add dev extra to pyproject.toml for development installs
* Clarify that pre-commit contains only Python and Bazel hooks
* Add one-line docstrings to Bazel modules
* Apply buildifier pre-commit fixes to Bazel files
* Apply pre-commit fixes to Python files
* Supply --profile=black to isort to prevent conflicts
* Fix nanobind build file formatting
* Add tooling configs to `pyproject.toml`
In particular, set line length 80 for all Python files.
* Reformat all Python files to line length 80, fix return type annotations
Also ignores the `tools/compare.py` and `tools/gbench/report.py` files
for mypy, since they emit a barrage of errors which we can deal with
later. The errors are mostly related to dynamic classmethod definition.
2023-10-30 23:35:37 +08:00
|
|
|
ignore = [
|
2023-12-13 22:26:15 +08:00
|
|
|
"E501", # line too long
|
Add pre-commit config and GitHub Actions job (#1688)
* Add pre-commit config and GitHub Actions job
Contains the following hooks:
* buildifier - for formatting and linting Bazel files.
* mypy, ruff, isort, black - for Python typechecking, import hygiene,
static analysis, and formatting.
The pylint CI job was changed to be a pre-commit CI job, where pre-commit
is bootstrapped via Python.
Pylint is currently no longer part of the
code checks, but can be re-added if requested. The reason to drop was
that it does not play nicely with pre-commit, and lots of its
functionality and responsibilities are actually covered in ruff.
* Add dev extra to pyproject.toml for development installs
* Clarify that pre-commit contains only Python and Bazel hooks
* Add one-line docstrings to Bazel modules
* Apply buildifier pre-commit fixes to Bazel files
* Apply pre-commit fixes to Python files
* Supply --profile=black to isort to prevent conflicts
* Fix nanobind build file formatting
* Add tooling configs to `pyproject.toml`
In particular, set line length 80 for all Python files.
* Reformat all Python files to line length 80, fix return type annotations
Also ignores the `tools/compare.py` and `tools/gbench/report.py` files
for mypy, since they emit a barrage of errors which we can deal with
later. The errors are mostly related to dynamic classmethod definition.
2023-10-30 23:35:37 +08:00
|
|
|
]
|
2023-11-01 17:48:01 +08:00
|
|
|
|
2024-03-07 20:28:55 +08:00
|
|
|
[tool.ruff.lint.isort]
|
2023-11-01 17:48:01 +08:00
|
|
|
combine-as-imports = true
|