Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable local versions based on environment variable #12997

Merged
merged 2 commits into from
Sep 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,17 +518,25 @@ def finalize_options(self):
# To support the package consisting of both openvino and training modules part of it
package_name = "onnxruntime-training"

# we want put default training packages to pypi. pypi does not accept package with a local version.
if not default_training_package_device or nightly_build:
if cuda_version:
# removing '.' to make Cuda version number in the same form as Pytorch.
local_version = "+cu" + cuda_version.replace(".", "")
elif rocm_version:
# removing '.' to make Rocm version number in the same form as Pytorch.
local_version = "+rocm" + rocm_version.replace(".", "")
else:
# cpu version for documentation
local_version = "+cpu"
disable_local_version = environ.get("ORT_DISABLE_PYTHON_PACKAGE_LOCAL_VERSION", "0")
disable_local_version = (
disable_local_version == "1"
or disable_local_version.lower() == "true"
or disable_local_version.lower() == "yes"
)
# local version should be disabled for internal feeds.
if not disable_local_version:
# we want put default training packages to pypi. pypi does not accept package with a local version.
if not default_training_package_device or nightly_build:
if cuda_version:
# removing '.' to make Cuda version number in the same form as Pytorch.
local_version = "+cu" + cuda_version.replace(".", "")
elif rocm_version:
# removing '.' to make Rocm version number in the same form as Pytorch.
local_version = "+rocm" + rocm_version.replace(".", "")
else:
# cpu version for documentation
local_version = "+cpu"

if package_name == "onnxruntime-nuphar":
packages += ["onnxruntime.nuphar"]
Expand Down