Commit b5a7c5f9 authored by ptrblck's avatar ptrblck Committed by mcarilli
Browse files

add WAR for pip>=19.3.1 (#652)

* add WAR for pip>=19.3.1

* remove pipmain, use extras_require instead
parent 0ce8ad3e
...@@ -2,7 +2,6 @@ import torch ...@@ -2,7 +2,6 @@ import torch
from setuptools import setup, find_packages from setuptools import setup, find_packages
import subprocess import subprocess
from pip._internal import main as pipmain
import sys import sys
import warnings import warnings
import os import os
...@@ -31,10 +30,11 @@ if TORCH_MAJOR == 0 and TORCH_MINOR < 4: ...@@ -31,10 +30,11 @@ if TORCH_MAJOR == 0 and TORCH_MINOR < 4:
cmdclass = {} cmdclass = {}
ext_modules = [] ext_modules = []
extras = {}
if "--pyprof" in sys.argv: if "--pyprof" in sys.argv:
with open('requirements.txt') as f: with open('requirements.txt') as f:
required_packages = f.read().splitlines() required_packages = f.read().splitlines()
pipmain(["install"] + required_packages) extras['pyprof'] = required_packages
try: try:
sys.argv.remove("--pyprof") sys.argv.remove("--pyprof")
except: except:
...@@ -209,4 +209,5 @@ setup( ...@@ -209,4 +209,5 @@ setup(
description='PyTorch Extensions written by NVIDIA', description='PyTorch Extensions written by NVIDIA',
ext_modules=ext_modules, ext_modules=ext_modules,
cmdclass=cmdclass, cmdclass=cmdclass,
extras_require=extras,
) )
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