Skip to content
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

[Bugfix] Fix VERSION FileNotFoundError bugs via pip installation #285

Merged
merged 3 commits into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions bitblas/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
# Get the absolute path of the current Python script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))

# Get the absolute path of the project root directory (one level above the current directory)
project_root_dir = os.path.abspath(os.path.join(current_dir, ".."))
# Define the path to the VERSION file located in the package directory
version_file_path = os.path.join(current_dir, "VERSION")

# Define the path to the VERSION file located in the project root directory
version_file_path = os.path.join(project_root_dir, "VERSION")
# If the VERSION file is not found, locate it in the project root directory instead
if not os.path.exists(version_file_path):
version_file_path = os.path.join(current_dir, "..", "VERSION")

# Read and store the version information from the VERSION file
# Use 'strip()' to remove any leading/trailing whitespace or newline characters
Expand Down