Make setup.py python 2 friendly (#46317)
Summary:
import print_function to make setup.py invoked by Python2 print human readable error:
```
% python2 setup.py
Python 2 has reached end-of-life and is no longer supported by PyTorch.
```
Also, remove `future` from the list of the PyTorch package install dependencies
Pull Request resolved: https://github.com/pytorch/pytorch/pull/46317
Reviewed By: walterddr, bugra
Differential Revision: D24305004
Pulled By: malfet
fbshipit-source-id: 9181186170562384dd2c0e6a8ff0b1e93508f221
diff --git a/setup.py b/setup.py
index 49fb8a2..54f170e 100644
--- a/setup.py
+++ b/setup.py
@@ -165,7 +165,8 @@
# When turned on, the following cmake variables will be toggled as well:
# USE_SYSTEM_CPUINFO=ON USE_SYSTEM_SLEEF=ON BUILD_CUSTOM_PROTOBUF=OFF
-
+# This future is needed to print Python2 EOL message
+from __future__ import print_function
import sys
if sys.version_info < (3,):
print("Python 2 has reached end-of-life and is no longer supported by PyTorch.")
@@ -341,7 +342,6 @@
# the list of runtime dependencies required by this built package
install_requires = [
- 'future',
'typing_extensions',
'dataclasses; python_version < "3.7"'
]