4242IS_ROCM = (torch .version .hip is not None ) and (ROCM_HOME is not None )
4343BUILD_CUDA_SOURCES = (torch .cuda .is_available () and ((CUDA_HOME is not None ) or IS_ROCM )) or FORCE_CUDA
4444
45- PACKAGE_NAME = " torchvision"
45+ package_name = os . getenv ( "TORCHVISION_PACKAGE_NAME" , " torchvision")
4646
4747print ("Torchvision build configuration:" )
4848print (f"{ FORCE_CUDA = } " )
@@ -98,7 +98,7 @@ def get_dist(pkgname):
9898 except DistributionNotFound :
9999 return None
100100
101- pytorch_dep = " torch"
101+ pytorch_dep = os . getenv ( "TORCH_PACKAGE_NAME" , " torch")
102102 if os .getenv ("PYTORCH_VERSION" ):
103103 pytorch_dep += "==" + os .getenv ("PYTORCH_VERSION" )
104104
@@ -561,7 +561,7 @@ def run(self):
561561 version , sha = get_version ()
562562 write_version_file (version , sha )
563563
564- print (f"Building wheel { PACKAGE_NAME } -{ version } " )
564+ print (f"Building wheel { package_name } -{ version } " )
565565
566566 with open ("README.md" ) as f :
567567 readme = f .read ()
@@ -573,7 +573,7 @@ def run(self):
573573 ]
574574
575575 setup (
576- name = PACKAGE_NAME ,
576+ name = package_name ,
577577 version = version ,
578578 author = "PyTorch Core Team" ,
579579@@ -583,7 +583,7 @@ def run(self):
583583 long_description_content_type = "text/markdown" ,
584584 license = "BSD" ,
585585 packages = find_packages (exclude = ("test" ,)),
586- package_data = {PACKAGE_NAME : ["*.dll" , "*.dylib" , "*.so" , "prototype/datasets/_builtin/*.categories" ]},
586+ package_data = {package_name : ["*.dll" , "*.dylib" , "*.so" , "prototype/datasets/_builtin/*.categories" ]},
587587 zip_safe = False ,
588588 install_requires = get_requirements (),
589589 extras_require = {
0 commit comments