Skip to content

Commit ec61a8e

Browse files
authored
[Bugfix] Fix VERSION FileNotFoundError bugs via pip installation (#285)
* [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
1 parent 04fa448 commit ec61a8e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bitblas/version.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
# Get the absolute path of the current Python script's directory
77
current_dir = os.path.dirname(os.path.abspath(__file__))
88

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

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

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

0 commit comments

Comments
 (0)