Skip to content

Commit 0f48706

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Allow custom package name for CI builds of torchvision (#8659)
Reviewed By: vmoens Differential Revision: D68021984 fbshipit-source-id: 4c0ac73e8270a46eda80268caa548d13e5da50dd
1 parent bb090da commit 0f48706

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
IS_ROCM = (torch.version.hip is not None) and (ROCM_HOME is not None)
4343
BUILD_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

4747
print("Torchvision build configuration:")
4848
print(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
author_email="[email protected]",
@@ -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

Comments
 (0)