Skip to content

Commit

Permalink
Format benchmark of README a bit more
Browse files Browse the repository at this point in the history
- Make project description consistent with GitHub description
- Add "-B" to hatch bench command to avoid bytecode caching.
-  Add a bit of whitespace to pyproject.toml for aesthetic.
  • Loading branch information
Sachaa-Thanasius committed Sep 1, 2024
1 parent e679287 commit 141d4a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ There are two ways of measuring activation and/or import time currently:
CPython 3.13 deferred 0.00253s (1.00x)
============== ======= ========== ===================

- ``python -m timeit -n 1 -r 1 -- "import deferred"`` (substitute ``deferred`` with other modules, e.g. ``slothy``, to compare). This has great variance, so only value the resulting time relative to another import's time.
- ``python -m timeit -n 1 -r 1 -- "import deferred"``
- Substitute ``deferred`` with other modules, e.g. ``slothy``, to compare.
- This has great variance, so only value the resulting time relative to another import's time in the same process if possible.


Why?
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "deferred"
description = "Yet another attempt at implementing lazy imports in Python."
description = "Lazy imports with regular syntax in pure Python."
requires-python = ">=3.9"
license = "MIT"
authors = [
Expand Down Expand Up @@ -55,7 +55,7 @@ features = ["benchmark"]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]

[tool.hatch.envs.benchmark.scripts]
bench = "python -m benchmark.bench_samples --remove-pycache"
bench = "python -B -m benchmark.bench_samples"


# -------- Test config
Expand Down Expand Up @@ -140,6 +140,7 @@ extend-ignore = [
"PD011", # Erroneous issue that triggers for any .values attribute access at all.
"PLR2004", # I'll determine what counts as a magic number.
"RUF002", # I'll determine what counts as an ambiguous character.

# ---- Recommended by Ruff when using Ruff format
"E111",
"E114",
Expand All @@ -149,6 +150,7 @@ extend-ignore = [
"E501",
"ISC001",
"ISC002",

# ---- Project-specific rules
]
unfixable = [
Expand Down Expand Up @@ -176,6 +178,7 @@ keep-runtime-typing = true
"src/deferred/_typing.py" = [
"F822", # __all__ has names that will be provided by module-level __getattr__.
]

# ---- Test code
"tests/**/*.py" = [
"T201", # Printing is fine.
Expand Down

0 comments on commit 141d4a9

Please sign in to comment.