Skip to content

Commit

Permalink
bump up versions
Browse files Browse the repository at this point in the history
1. bump rtoml to 0.11
2. bump tomlkit to 0.12.5
3. bump toml-test to 1.5.0
4. pytomlpp is excluded as it only supports python < 3.11
5. bump tomllib data to 3.12.4
  • Loading branch information
pwwang committed Jun 25, 2024
1 parent 3fa00f1 commit 9e835a7
Show file tree
Hide file tree
Showing 13 changed files with 754 additions and 1,259 deletions.
122 changes: 52 additions & 70 deletions README.md

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions README.raw.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ See also: [toml-lang](https://toml.io/en/) and [PEP 680](https://www.python.org/

## Other reports

- [Tests with `toml-test` v1.4.0](./reports/with_toml-test_v1.4.0.md)
- [Tests with `toml-test` v1.3.0](./reports/with_toml-test_v1.3.0.md)
- [Tests with `toml-test` v1.2.0](./reports/with_toml-test_v1.2.0.md)
- [Tests with `toml-test` v1.1.0](./reports/with_toml-test_v1.1.0.md)
- [Tests with `toml-test` v1.0.0](./reports/with_toml-test_v1.0.0.md)
- [Tests with python 3.11 (`tomllib` included)](./reports/with_python3.11.md)

## Run your own report

Expand Down
446 changes: 190 additions & 256 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[tool.poetry]
name = "toml-bench"
version = "0.3.1"
version = "0.4.0"
description = "Benchmarking for python toml libraries"
authors = ["pwwang <[email protected]>"]
license = "MIT"

[tool.poetry.dependencies]
benchwork = "^0.0.2"
python = "^3.9"
pyparam = "^0.5"
benchwork = "^0.0.2"
toml = "^0.10.2"
rtoml = "^0.9.0"
rtoml = "^0.11.0"
# pytomlpp does not support python 3.11 yet
pytomlpp = {version = "^1.0.13", python = "<3.11"}
tomli = "^2.0.1"
tomli-w = "^1.0.0"
qtoml = "^0.3.1"
tomlkit = "^0.11.8"
tomlkit = "^0.12.5"
python-dateutil = "^2.8.2"
importlib-metadata = "^5.0.0"
importlib-metadata = "^7.2.1"
# required by tomlkit, but cannot be inferred by poetry
regex = "^2022.10.31"
regex = "^2024.5.15"
argx = "^0.2.10"

[tool.poetry.dev-dependencies]

Expand Down
117 changes: 50 additions & 67 deletions reports/with_toml-test_latest.md

Large diffs are not rendered by default.

354 changes: 0 additions & 354 deletions reports/with_toml-test_v1.0.0.md

This file was deleted.

354 changes: 0 additions & 354 deletions reports/with_toml-test_v1.1.0.md

This file was deleted.

107 changes: 45 additions & 62 deletions reports/with_toml-test_v1.2.0.md

Large diffs are not rendered by default.

79 changes: 31 additions & 48 deletions reports/with_python3.11.md → reports/with_toml-test_v1.3.0.md

Large diffs are not rendered by default.

337 changes: 337 additions & 0 deletions reports/with_toml-test_v1.4.0.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from pathlib import Path

REPORTS = {
"latest": "1.3.0",
"latest": "1.5.0",
"v1.4.0": "1.4.0",
"v1.3.0": "1.3.0",
"v1.2.0": "1.2.0",
"v1.1.0": "1.1.0",
"v1.0.0": "1.0.0",
}


Expand All @@ -16,7 +16,7 @@ def run_test(comver):

outfile = f"reports/with_toml-test_{comver}.md"

cmd = f"python -m toml_bench --iter 1000 --comver {REPORTS[comver]} --report {outfile}"
cmd = f"python -m toml_bench --iter 5000 --comver {REPORTS[comver]} --report {outfile}"
os.system(cmd)


Expand Down
66 changes: 34 additions & 32 deletions toml_bench/__main__.py
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
from benchwork import run_suite
from pyparam import Params
from argx import ArgumentParser

from .suite import BenchSuite


def init_params() -> Params:
params = Params(
def init_params() -> ArgumentParser:
"""Init the parameters"""
parser = ArgumentParser(
prog="toml_bench",
help_on_void=False,
desc="Benchmarking on toml packages in python",
description="Benchmarking on toml packages in python",
)
params.add_param(
"datadir",
parser.add_argument(
"--datadir",
type="path",
default="/tmp/toml-bench",
desc="Where to put the test-data",
help="Where to put the test-data",
)
params.add_param(
"report",
default="<stdout>",
desc="If provided, the report will be written to this file",
parser.add_argument(
"--report",
type="path",
default="/dev/stdout",
help="If provided, the report will be written to this file",
)
params.add_param(
"title",
parser.add_argument(
"--title",
default="Report",
desc="The title of the report",
help="The title of the report",
)
params.add_param(
"comver",
default="1.3.0",
desc="The version of the toml-test to use in compliance tests",
parser.add_argument(
"--comver",
default="1.5.0",
help="The version of the toml-test to use in compliance tests",
)
params.add_param(
"cpyver",
default="3.11.0",
desc="The version (tag) of cpython to grab the tomllib test data",
parser.add_argument(
"--cpyver",
default="3.12.4",
help="The version (tag) of cpython to grab the tomllib test data",
)
params.add_param(
"nocache",
default=False,
desc="Do not use cached data, re-download them.",
parser.add_argument(
"--nocache",
action="store_true",
help="Do not use cached data, re-download them.",
)
params.add_param(
"iter",
parser.add_argument(
"--iter",
type="int",
default=5000,
desc="The number of iterations to run in speed tests",
help="The number of iterations to run in speed tests",
)
return params
return parser


def main():
"""Main entrance"""
args = init_params().parse()
args = init_params().parse_args()
run_suite(
BenchSuite,
args=args,
Expand Down
4 changes: 2 additions & 2 deletions toml_bench/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
BenchSetComplianceInvalid,
BenchSetTomllibComplianceValid,
BenchSetTomllibComplianceInvalid,
BenchSetSpeedWithPytomlppData,
# BenchSetSpeedWithPytomlppData,
BenchSetSpeedWithRtomlData,
BenchSetSpeedWithTomliData,
)
Expand All @@ -43,7 +43,7 @@ class BenchSuite(BenchSuite):
BenchSetComplianceInvalid,
BenchSetTomllibComplianceValid,
BenchSetTomllibComplianceInvalid,
BenchSetSpeedWithPytomlppData,
# BenchSetSpeedWithPytomlppData,
BenchSetSpeedWithRtomlData,
BenchSetSpeedWithTomliData,
]

0 comments on commit 9e835a7

Please sign in to comment.