Skip to content

Commit 6e1194d

Browse files
Refactor mechanisms of building TF wheel and storing TF project version.
This change introduces a uniform way of building the TF wheel and controlling the filename version suffixes. A new repository rule `python_wheel_version_suffix_repository` provides information about project and wheel version suffixes. The final value depends on environment variables passed to Bazel command: `_ML_WHEEL_WHEEL_TYPE, _ML_WHEEL_BUILD_DATE, _ML_WHEEL_GIT_HASH, _ML_WHEEL_VERSION_SUFFIX` `tf_version.bzl` defines the TF project version and loads the version suffix information calculated by `python_wheel_version_suffix_repository`. The targets `//tensorflow/core/public:release_version, //tensorflow:tensorflow_bzl //tensorflow/tools/pip_package:setup_py` use the version chunks defined above. The version of the wheel in the build rule output depends on the environment variables. Environment variables combinations for creating wheels with different versions: * snapshot (default build rule behavior): `--repo_env=ML_WHEEL_TYPE=snapshot` * release: `--repo_env=ML_WHEEL_TYPE=release` * release candidate: `--repo_env=ML_WHEEL_TYPE=release --repo_env=ML_WHEEL_VERSION_SUFFIX=-rc1` * nightly build with date as version suffix: `--repo_env=ML_WHEEL_TYPE=nightly --repo_env=ML_WHEEL_BUILD_DATE=<YYYYmmdd>` * build with git data as version suffix: `--repo_env=ML_WHEEL_TYPE=custom --repo_env=ML_WHEEL_BUILD_DATE=$(git show -s --format=%as HEAD) --repo_env=ML_WHEEL_GIT_HASH=$(git rev-parse HEAD)` PiperOrigin-RevId: 733444080
1 parent 9d688b8 commit 6e1194d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: site/en/install/source.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ environment, omit the `--user` argument):
3939

4040
Note: A `pip` version >19.0 is required to install the TensorFlow 2 `.whl`
4141
package. Additional required dependencies are listed in the
42-
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/setup.py" class="external"><code>setup.py</code></a>
42+
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/setup.py.tpl" class="external"><code>setup.py.tpl</code></a>
4343
file under `REQUIRED_PACKAGES`.
4444

4545
### Install Bazel

0 commit comments

Comments
 (0)