Skip to content

Multiple fixes enabling Windows support, environment benchmarking #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 30, 2022

Conversation

nicholasjng
Copy link
Owner

No description provided.

…s, make auto-install optional

This commit fixes a bug where packages installed or uninstalled in `pybm env install/uninstall` commands would not be added to / removed from the environment TOML file due to a missing context manager.

Secondly, the post-venv-creation step of installing runner requirements into the new virtual environment is not made optional, controlled through a config option `builder.autoinstall`.
This commit enables pybm benchmark runs on Windows systems by fixing the git version tuple parsing from the output of `git version`. Previously, parsing would fail due to a trailing dot in the string match
obtained from the regex matching, which happened because git versions on Windows are of the form MAJ.MIN.PATCH.windows.X. With the previous regex, the dot after PATCH would be picked up, leading to an
empty string in the string split, causing it to fail. The new regex picks up groups of dots AND THEN numbers, ensuring that a capture group never ends on a dot.

Additionally, a method to find the local config in the main worktree with git was added, which previously broke benchmarking in repositories with the pybm config ignored from source control.
This commit simplifies the TimeitRunner class. A loop was removed by passing the repetitions argument to the Timer.repeat API of timeit, which then returns a list that can be distributed into multiple JSON
results. At the end, benchmark results are assembled as a shallow copy of a local benchmark template constructed at the beginning of the run.
@nicholasjng nicholasjng merged commit cc086ed into master Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant