From 493c90081008b193fb865b96671067f801c3cdcb Mon Sep 17 00:00:00 2001 From: Pavel Belevich Date: Thu, 3 Oct 2019 12:05:33 -0700 Subject: [PATCH] Extract version to version.txt (#27149) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/27149 Extract version to version.txt and add reading version logic to setup.py and fb/torch_version.py ghstack-source-id: 91271883 Test Plan: N/A Reviewed By: gchanan, ezyang Differential Revision: D17689307 fbshipit-source-id: 21899502027cec71b63d9dc151e09ff5ff3f279d --- setup.py | 2 +- version.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 version.txt diff --git a/setup.py b/setup.py index 0e457541ebfe..ad94b94eb21e 100644 --- a/setup.py +++ b/setup.py @@ -257,7 +257,7 @@ cmake_python_include_dir = distutils.sysconfig.get_python_inc() # Version, create_version_file, and package_name ################################################################################ package_name = os.getenv('TORCH_PACKAGE_NAME', 'torch') -version = '1.3.0a0' +version = open('version.txt', 'r').read().strip() sha = 'Unknown' try: diff --git a/version.txt b/version.txt new file mode 100644 index 000000000000..c4150fa5bb51 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.3.0a0