Skip to content

Commit

Permalink
[Bugfix] Fix VERSION FileNotFoundError bugs via pip installation (#285)
Browse files Browse the repository at this point in the history
* [BUGFIX] fix VERSION file not found error, which installed by pip

* Revert "[BUGFIX] fix VERSION file not found error, which installed by pip"

This reverts commit 3fcedba.

* re-commit for fixing version bugs
  • Loading branch information
senlyu163 authored Jan 24, 2025
1 parent 04fa448 commit ec61a8e
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit ec61a8e

Please sign in to comment.