Commit c05498c8 authored by Andrey Talman's avatar Andrey Talman Committed by Facebook GitHub Bot
Browse files

Retrieve version from version.txt (#2434)

Summary:
Retrieve version from version.txt
These improvement introduced in following PR: https://github.com/pytorch/vision/pull/6117
In addition to this we add version.txt file to help us manage torchaudio version

Pull Request resolved: https://github.com/pytorch/audio/pull/2434

Reviewed By: mthrok

Differential Revision: D36867886

Pulled By: atalman

fbshipit-source-id: 14b6d653e46489d8db1c5ae2016a8202c632861e
parent ceee6912
...@@ -7,7 +7,7 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ...@@ -7,7 +7,7 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. "$script_dir/pkg_helpers.bash" . "$script_dir/pkg_helpers.bash"
export BUILD_TYPE="conda" export BUILD_TYPE="conda"
setup_env 0.12.0 setup_env
export SOURCE_ROOT_DIR="$PWD" export SOURCE_ROOT_DIR="$PWD"
setup_conda_pytorch_constraint setup_conda_pytorch_constraint
setup_conda_cudatoolkit_constraint setup_conda_cudatoolkit_constraint
......
...@@ -7,7 +7,7 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ...@@ -7,7 +7,7 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. "$script_dir/pkg_helpers.bash" . "$script_dir/pkg_helpers.bash"
export BUILD_TYPE="wheel" export BUILD_TYPE="wheel"
setup_env 0.12.0 setup_env
setup_wheel_python setup_wheel_python
pip_install numpy future cmake ninja pip_install numpy future cmake ninja
setup_pip_pytorch_version setup_pip_pytorch_version
......
...@@ -97,10 +97,15 @@ setup_cuda() { ...@@ -97,10 +97,15 @@ setup_cuda() {
# BUILD_VERSION (e.g., 0.2.0.dev20190807+cpu) # BUILD_VERSION (e.g., 0.2.0.dev20190807+cpu)
# #
# Fill BUILD_VERSION if it doesn't exist already with a nightly string # Fill BUILD_VERSION if it doesn't exist already with a nightly string
# Usage: setup_build_version 0.2.0 # Or retrieve it from the version.txt
# Usage: setup_build_version
setup_build_version() { setup_build_version() {
if [[ -z "$BUILD_VERSION" ]]; then if [[ -z "$BUILD_VERSION" ]]; then
export BUILD_VERSION="$1.dev$(date "+%Y%m%d")$VERSION_SUFFIX" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# version.txt for some reason has `a` character after major.minor.rev
# command below yields 0.10.0 from version.txt containing 0.10.0a0
_VERSION_BASE=$( cut -f 1 -d a "$SCRIPT_DIR/../version.txt" )
export BUILD_VERSION="$_VERSION_BASE.dev$(date "+%Y%m%d")$VERSION_SUFFIX"
else else
export BUILD_VERSION="$BUILD_VERSION$VERSION_SUFFIX" export BUILD_VERSION="$BUILD_VERSION$VERSION_SUFFIX"
fi fi
...@@ -119,7 +124,7 @@ setup_macos() { ...@@ -119,7 +124,7 @@ setup_macos() {
setup_env() { setup_env() {
git submodule update --init --recursive git submodule update --init --recursive
setup_cuda setup_cuda
setup_build_version "$1" setup_build_version
setup_macos setup_macos
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment