File tree Expand file tree Collapse file tree 4 files changed +18
-55
lines changed
Expand file tree Collapse file tree 4 files changed +18
-55
lines changed Original file line number Diff line number Diff line change 2424 - name : Run tests
2525 run : tox
2626
27- benchmark :
28- runs-on : ubuntu-latest
29- steps :
30- - uses : actions/checkout@v2
31- - name : Setup Python
32- uses : actions/setup-python@v2
33- with :
34- python-version : 3.9
35- - name : Install tox
36- run : |
37- python -m pip install tox
38- - name : Run benchmarks
39- run : tox
40- env :
41- TOXENV : perf{,-ref}
42-
4327 diffcov :
4428 runs-on : ubuntu-latest
4529 steps :
Original file line number Diff line number Diff line change 1+ [discovery]
2+ warmup = import importlib_metadata
3+ exercise = importlib_metadata.distribution(" ipython" )
4+
5+ [entry_points()]
6+ warmup = import importlib_metadata
7+ exercise = importlib_metadata.entry_points()
8+
9+ [cached distribution]
10+ warmup = import importlib_metadata; importlib_metadata.distribution("ipython")
11+ exercise = importlib_metadata.distribution(" ipython" )
12+
13+ [uncached distribution]
14+ warmup = import importlib, importlib_metadata
15+ exercise = importlib.invalidate_caches(); importlib_metadata.distribution("ipython")
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ testing =
5151 pep517
5252 pyfakefs
5353 flufl.flake8
54+ pytest-perf
5455
5556docs =
5657 # upstream
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ toxworkdir={env:TOX_WORK_DIR:.tox}
1010deps =
1111commands =
1212 pytest {posargs}
13+ passenv =
14+ HOME
1315usedevelop = True
1416extras = testing
1517setenv =
@@ -33,45 +35,6 @@ commands =
3335 diff-cover coverage.xml --compare-branch =origin/main --html-report diffcov.html
3436 diff-cover coverage.xml --compare-branch =origin/main --fail-under =100
3537
36- [perf]
37- deps =
38- ipython
39- pyperf
40- path
41- commands =
42- python -c " import path; path.Path('{env:SCOPE}.json').remove_p()"
43-
44- python -m pyperf timeit --name discovery --append {env:SCOPE}.json -s ' import importlib_metadata' ' importlib_metadata.distribution("ipython")'
45-
46- python -m pyperf timeit --name ' entry_points()' --append {env:SCOPE}.json -s ' import importlib_metadata' ' importlib_metadata.entry_points()'
47-
48- python -m pyperf timeit --name ' cached distribution' --append {env:SCOPE}.json -s ' import importlib_metadata; importlib_metadata.distribution("ipython")' ' importlib_metadata.distribution("ipython")'
49-
50- python -m pyperf timeit --name ' uncached distribution' --append {env:SCOPE}.json -s ' import importlib, importlib_metadata' ' importlib.invalidate_caches(); importlib_metadata.distribution("ipython")'
51-
52- [testenv:perf]
53- use_develop = False
54- # change dir to avoid picking up local package.
55- changedir = {toxworkdir}
56- setenv =
57- SCOPE = local
58- deps = {[perf]deps}
59- commands = {[perf]commands}
60-
61- [testenv:perf-ref]
62- # compare perf results to the main branch
63- skip_install = True
64- # change dir to avoid picking up local package.
65- changedir = {toxworkdir}
66- setenv =
67- SCOPE = main
68- deps =
69- {[perf]deps}
70- git+https://github.com/python/importlib_metadata
71- commands =
72- {[perf]commands}
73- python -m pyperf compare_to --verbose main.json local.json --table
74-
7538[testenv:release]
7639skip_install = True
7740deps =
You can’t perform that action at this time.
0 commit comments