Port changes from 2.4 branch w.r.t project renaming.

PiperOrigin-RevId: 341855619
Change-Id: I513906ce05e672c779ee6ad5603d33fcaac3b6a6
This commit is contained in:
Mihai Maruseac 2020-11-11 10:15:10 -08:00 committed by TensorFlower Gardener
parent cc39a32e86
commit 82f6703420
18 changed files with 27 additions and 26 deletions

View File

@ -46,7 +46,7 @@ mkdir pip_pkg
# Copy and rename to tf_nightly
for f in $(ls pip_pkg/tf_nightly_cpu-*dev*macosx*.whl); do
copy_to_new_project_name "${f}" tf_nightly
copy_to_new_project_name "${f}" tf_nightly python
done
# Upload the built packages to pypi.

View File

@ -44,7 +44,7 @@ mkdir pip_pkg
# Copy and rename to tf_nightly
for f in $(ls pip_pkg/tf_nightly_cpu-*dev*macosx*.whl); do
copy_to_new_project_name "${f}" tf_nightly
copy_to_new_project_name "${f}" tf_nightly python
done
# Upload the built packages to pypi.

View File

@ -44,7 +44,7 @@ mkdir pip_pkg
# Copy and rename to tf_nightly
for f in $(ls pip_pkg/tf_nightly_cpu-*dev*macosx*.whl); do
copy_to_new_project_name "${f}" tf_nightly
copy_to_new_project_name "${f}" tf_nightly python
done
# Upload the built packages to pypi.

View File

@ -44,7 +44,7 @@ mkdir pip_pkg
# Copy and rename to tf_nightly
for f in $(ls pip_pkg/tf_nightly_cpu-*dev*macosx*.whl); do
copy_to_new_project_name "${f}" tf_nightly
copy_to_new_project_name "${f}" tf_nightly python
done
# Upload the built packages to pypi.

View File

@ -22,7 +22,7 @@ sudo pip install --upgrade twine
# Copy and rename to tf_nightly
for f in $(ls "${KOKORO_GFILE_DIR}"/tf_nightly_gpu*dev*cp3*-cp3*-win_amd64.whl); do
copy_to_new_project_name "${f}" tf_nightly
copy_to_new_project_name "${f}" tf_nightly /c/Python36/python
done
# Upload the built packages to pypi.

View File

@ -46,7 +46,7 @@ export TF_TEST_FLAGS="--test_tag_filters=${TF_TEST_FILTER_TAGS} --build_tag_filt
export TF_TEST_TARGETS="${DEFAULT_BAZEL_TARGETS} -//tensorflow/lite/... "
export TF_PIP_TESTS="test_pip_virtualenv_non_clean test_pip_virtualenv_clean"
#export IS_NIGHTLY=0 # Not nightly; uncomment if building from tf repo.
export TF_PROJECT_NAME="tensorflow_gpu"
export TF_PROJECT_NAME="tensorflow" # single pip package!
export TF_PIP_TEST_ROOT="pip_test"
# To build both tensorflow and tensorflow-gpu pip packages

View File

@ -46,7 +46,7 @@ export TF_TEST_FLAGS="--test_tag_filters=${TF_TEST_FILTER_TAGS} --build_tag_filt
export TF_TEST_TARGETS="${DEFAULT_BAZEL_TARGETS} -//tensorflow/lite/... "
export TF_PIP_TESTS="test_pip_virtualenv_non_clean test_pip_virtualenv_clean"
#export IS_NIGHTLY=0 # Not nightly; uncomment if building from tf repo.
export TF_PROJECT_NAME="tensorflow_gpu"
export TF_PROJECT_NAME="tensorflow" # single pip package!
export TF_PIP_TEST_ROOT="pip_test"
# To build both tensorflow and tensorflow-gpu pip packages

View File

@ -46,7 +46,7 @@ export TF_TEST_FLAGS="--test_tag_filters=${TF_TEST_FILTER_TAGS} --build_tag_filt
export TF_TEST_TARGETS="${DEFAULT_BAZEL_TARGETS} -//tensorflow/lite/... "
export TF_PIP_TESTS="test_pip_virtualenv_non_clean test_pip_virtualenv_clean"
#export IS_NIGHTLY=0 # Not nightly; uncomment if building from tf repo.
export TF_PROJECT_NAME="tensorflow_gpu"
export TF_PROJECT_NAME="tensorflow" # single pip package!
export TF_PIP_TEST_ROOT="pip_test"
# To build both tensorflow and tensorflow-gpu pip packages

View File

@ -21,6 +21,5 @@ if "%IS_NIGHTLY%" == "1" (
call tensorflow\tools\ci_build\windows\gpu\pip\run.bat --extra_test_flags "--test_env=TF2_BEHAVIOR=1"
) else (
call tensorflow\tools\ci_build\windows\gpu\pip\run.bat --release_build --extra_test_flags "--test_env=TF2_BEHAVIOR=1" --project_name "tensorflow"
for %%a in ("%~dp0\.") do set "PARENT_DIR=%%~nxa"
bash -l tensorflow\tools\ci_build\release\windows\%PARENT_DIR%\release_pip_rename.sh
bash -l tensorflow\tools\ci_build\release\windows\gpu_py36_full\release_pip_rename.sh
)

View File

@ -21,6 +21,5 @@ if "%IS_NIGHTLY%" == "1" (
call tensorflow\tools\ci_build\windows\gpu\pip\run.bat --extra_test_flags "--test_env=TF2_BEHAVIOR=1"
) else (
call tensorflow\tools\ci_build\windows\gpu\pip\run.bat --release_build --extra_test_flags "--test_env=TF2_BEHAVIOR=1" --project_name "tensorflow"
for %%a in ("%~dp0\.") do set "PARENT_DIR=%%~nxa"
bash -l tensorflow\tools\ci_build\release\windows\%PARENT_DIR%\release_pip_rename.sh
bash -l tensorflow\tools\ci_build\release\windows\gpu_py37_full\release_pip_rename.sh
)

View File

@ -21,6 +21,5 @@ if "%IS_NIGHTLY%" == "1" (
call tensorflow\tools\ci_build\windows\gpu\pip\run.bat --extra_test_flags "--test_env=TF2_BEHAVIOR=1"
) else (
call tensorflow\tools\ci_build\windows\gpu\pip\run.bat --release_build --extra_test_flags "--test_env=TF2_BEHAVIOR=1" --project_name "tensorflow"
for %%a in ("%~dp0\.") do set "PARENT_DIR=%%~nxa"
bash -l tensorflow\tools\ci_build\release\windows\%PARENT_DIR%\release_pip_rename.sh
bash -l tensorflow\tools\ci_build\release\windows\gpu_py38_full\release_pip_rename.sh
)

View File

@ -223,6 +223,7 @@ function maybe_skip_v1 {
function copy_to_new_project_name {
WHL_PATH="$1"
NEW_PROJECT_NAME="$2"
PYTHON_CMD="$3"
ORIGINAL_WHL_NAME=$(basename "${WHL_PATH}")
ORIGINAL_WHL_DIR=$(realpath "$(dirname "${WHL_PATH}")")
@ -231,13 +232,14 @@ function copy_to_new_project_name {
NEW_WHL_NAME="${NEW_PROJECT_NAME}-${FULL_TAG}"
VERSION="$(echo "${FULL_TAG}" | cut -d '-' -f 1)"
TMP_DIR="$(mktemp -d)"
wheel unpack "${WHL_PATH}" -d "${TMP_DIR}"
TMP_UNPACKED_DIR="$(ls -d "${TMP_DIR}"/* | head -n 1)"
pushd "${TMP_UNPACKED_DIR}"
ORIGINAL_WHL_DIR_PREFIX="${ORIGINAL_PROJECT_NAME}-${VERSION}"
NEW_WHL_DIR_PREFIX="${NEW_PROJECT_NAME}-${VERSION}"
TMP_DIR="$(mktemp -d)"
${PYTHON_CMD} -m wheel unpack "${WHL_PATH}"
mv "${ORIGINAL_WHL_DIR_PREFIX}" "${TMP_DIR}"
pushd "${TMP_DIR}/${ORIGINAL_WHL_DIR_PREFIX}"
mv "${ORIGINAL_WHL_DIR_PREFIX}.dist-info" "${NEW_WHL_DIR_PREFIX}.dist-info"
if [[ -d "${ORIGINAL_WHL_DIR_PREFIX}.data" ]]; then
mv "${ORIGINAL_WHL_DIR_PREFIX}.data" "${NEW_WHL_DIR_PREFIX}.data"
@ -247,7 +249,9 @@ function copy_to_new_project_name {
NEW_PROJECT_NAME_DASH="${NEW_PROJECT_NAME//_/-}"
sed -i.bak "s/${ORIGINAL_PROJECT_NAME_DASH}/${NEW_PROJECT_NAME_DASH}/g" "${NEW_WHL_DIR_PREFIX}.dist-info/METADATA"
wheel pack "${TMP_UNPACKED_DIR}" -d "${ORIGINAL_WHL_DIR}"
${PYTHON_CMD} -m wheel pack .
mv *.whl "${ORIGINAL_WHL_DIR}"
popd
rm -rf "${TMP_DIR}"
}

View File

@ -20,6 +20,6 @@ source tensorflow/tools/ci_build/release/common.sh
# Rename to tensorflow_cpu
for f in $(ls py_test_dir/tensorflow-*cp3*-cp3*m-win_amd64.whl); do
copy_to_new_project_name "${f}" tensorflow_cpu
copy_to_new_project_name "${f}" tensorflow_cpu /c/Python36/python
rm "${f}"
done

View File

@ -20,6 +20,6 @@ source tensorflow/tools/ci_build/release/common.sh
# Rename to tensorflow_cpu
for f in $(ls py_test_dir/tensorflow-*cp3*-cp3*m-win_amd64.whl); do
copy_to_new_project_name "${f}" tensorflow_cpu
copy_to_new_project_name "${f}" tensorflow_cpu /c/Python37/python
rm "${f}"
done

View File

@ -20,6 +20,6 @@ source tensorflow/tools/ci_build/release/common.sh
# Rename to tensorflow_cpu
for f in $(ls py_test_dir/tensorflow-*cp3*-cp3*m-win_amd64.whl); do
copy_to_new_project_name "${f}" tensorflow_cpu
copy_to_new_project_name "${f}" tensorflow_cpu /c/Python38/python
rm "${f}"
done

View File

@ -20,5 +20,5 @@ source tensorflow/tools/ci_build/release/common.sh
# Copy and rename to tensorflow
for f in $(ls py_test_dir/tensorflow-*cp3*-cp3*m-win_amd64.whl); do
copy_to_new_project_name "${f}" tensorflow_gpu
copy_to_new_project_name "${f}" tensorflow_gpu /c/Python36/python
done

View File

@ -20,5 +20,5 @@ source tensorflow/tools/ci_build/release/common.sh
# Copy and rename to tensorflow
for f in $(ls py_test_dir/tensorflow-*cp3*-cp3*m-win_amd64.whl); do
copy_to_new_project_name "${f}" tensorflow_gpu
copy_to_new_project_name "${f}" tensorflow_gpu /c/Python37/python
done

View File

@ -20,5 +20,5 @@ source tensorflow/tools/ci_build/release/common.sh
# Copy and rename to tensorflow
for f in $(ls py_test_dir/tensorflow-*cp3*-cp3*-win_amd64.whl); do
copy_to_new_project_name "${f}" tensorflow_gpu
copy_to_new_project_name "${f}" tensorflow_gpu /c/Python38/python
done