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

Conversation

senlyu163
Copy link
Contributor

This pr fix version bugs via pip installation. It can reproduce by pip install git+https://github.com/microsoft/BitBLAS.git

After installing BitBLAS, verify the installation by running:

Python 3.10.12 (main, Jan 17 2025, 14:35:34) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bitblas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/bitblas/__init__.py", line 156, in <module>
    from .version import __version__  # noqa: F401
  File "/usr/local/lib/python3.10/dist-packages/bitblas/version.py", line 17, in <module>
    with open(version_file_path, "r") as version_file:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.10/dist-packages/VERSION'

This bug occurs because during the pip installation, the VERSION file is copied to /usr/local/lib/python3.10/dist-packages/bitblas/VERSION, while the version.py file reads from an incorrect path.

Improvement: Consolidate the version number management of BitBLAS by placing it directly into the version.py file.

Please cc: @LeiWang1999

@LeiWang1999
Copy link
Contributor

LeiWang1999 commented Jan 24, 2025

�thanks @senlyu163 for your awesome contributions! I think it’s still important to maintain a VERSION text file in the root of the project to clearly indicate the version.

A better solution might be to modify version.py to detect the paths of two VERSION files. If one of them is missing, we can fall back to the other. This approach ensures flexibility while keeping the versioning clear and consistent. And that way is more aligned with the UNIX design philosophy.

@senlyu163
Copy link
Contributor Author

�thanks @senlyu163 for your awesome contributions! I think it’s still important to maintain a VERSION text file in the root of the project to clearly indicate the version.

A better solution might be to modify version.py to detect the paths of two VERSION files. If one of them is missing, we can fall back to the other. This approach ensures flexibility while keeping the versioning clear and consistent. And that way is more aligned with the UNIX design philosophy.

Thanks for your review. I will re-commit based on your suggestions.

@senlyu163
Copy link
Contributor Author

Hi, lei. I've made changes to the PR based on your previous comments. Could you please review the changes again and let me know if this makes sense?

@LeiWang1999
Copy link
Contributor

thanks for your awesome contribution! LGTM, Merged :)

@LeiWang1999 LeiWang1999 merged commit ec61a8e into microsoft:main Jan 24, 2025
1 check passed
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.

2 participants