Skip to content

Commit 1091df8

Browse files
committed
Add parsing for torch nightlies/dev back in
Note that this does currenlty not work properly on pip 19.0.1 due to a bug: pypa/pip#6163
1 parent 32911e3 commit 1091df8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

setup.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ def find_version(*file_paths):
2828
version = find_version("gpytorch", "__init__.py")
2929

3030

31+
torch_min = "1.0.1"
32+
install_requires = [">=".join(["torch", torch_min])]
33+
# if recent dev version of PyTorch is installed, no need to install stable
34+
try:
35+
import torch
36+
if torch.__version__ >= torch_min:
37+
install_requires = []
38+
except ImportError:
39+
pass
40+
41+
3142
# Run the setup
3243
setup(
3344
name="gpytorch",
@@ -45,7 +56,7 @@ def find_version(*file_paths):
4556
classifiers=["Development Status :: 4 - Beta", "Programming Language :: Python :: 3"],
4657
packages=find_packages(),
4758
python_requires=">=3.6",
48-
install_requires=["torch>=1.0.1"],
59+
install_requires=install_requires,
4960
extras_require={
5061
"dev": [
5162
"black",

0 commit comments

Comments
 (0)