Skip to content

Adds an override for the location of the .benchpark directory #803

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ilumsden
Copy link
Collaborator

@ilumsden ilumsden commented Jun 4, 2025

Description

This feature adds a simple override for the location of the .benchpark directory via a BENCHPARK_HOME environment variable.

This is a bit of a niche feature, but it can be useful e.g., when trying to install Benchpark in a container.

Adding/modifying core functionality, CI, or documentation:

  • Update docs (should I really do this? Or should this be kept an internal feature?)

@ilumsden ilumsden self-assigned this Jun 4, 2025
@ilumsden ilumsden added the feature New feature or request label Jun 4, 2025
@ilumsden ilumsden requested a review from pearce8 June 4, 2025 23:24
@michaelmckinsey1 michaelmckinsey1 self-requested a review June 5, 2025 20:22
Comment on lines +20 to +23
try:
benchpark_home = pathlib.Path(os.environ["BENCHPARK_HOME"])
except KeyError:
benchpark_home = pathlib.Path(os.path.expanduser("~/.benchpark"))
Copy link
Collaborator

@michaelmckinsey1 michaelmckinsey1 Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not do

Suggested change
try:
benchpark_home = pathlib.Path(os.environ["BENCHPARK_HOME"])
except KeyError:
benchpark_home = pathlib.Path(os.path.expanduser("~/.benchpark"))
# If location is not set, use user home as default location
benchpark_home = pathlib.Path(os.getenv("BENCHPARK_HOME", os.path.expanduser("~/.benchpark")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants