-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dynamically determine the version of the pip package. (#3259)
Use the logic from https://github.com/pytorch/torcharrow/blob/15a7f7124d4c73c8c541547aef072264baab63b7/setup.py#L21 to play nicely with the pytorch ecosystem CI build environment. Test Plan: ``` $ ./install_requirements.sh ... Successfully installed executorch-0.2.0a0+1ba292a $ python >>> from executorch import version >>> version.__version__ '0.2.0a0+1ba292a' >>> version.git_version '1ba292ae4071c4eede8ea14e8f10ffd973a085b4' >>> ^D $ grep Version /home/dbort/.conda/envs/executorch-tmp/lib/python3.10/site-packages/executorch-0.2.0a0+1ba292a.dist-info/METADATA Metadata-Version: 2.1 Version: 0.2.0a0+1ba292a ``` Temporarily commented out the call to `setup()` in `setup.py` then imported it. ``` $ python >>> from setup import Version >>> Version.string '0.2.0a0+1ba292a' >>> Version.git_hash '1ba292ae4071c4eede8ea14e8f10ffd973a085b4' >>> Version.write_to_python_file("/tmp/version.py") >>> ^D $ cat /tmp/version.py from typing import Optional __all__ = ["__version__", "git_version"] __version__ = "0.2.0a0+1ba292a" git_version: Optional[str] = '1ba292ae4071c4eede8ea14e8f10ffd973a085b4' ``` ``` $ BUILD_VERSION="5.5.5" python >>> from setup import Version >>> Version.string '5.5.5' ```
- Loading branch information
Showing
2 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters