mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-04 04:07:22 +00:00
Disable local versions based on environment variable (#12997)
This commit is contained in:
parent
b48f71fcfc
commit
4ed5a5b2a8
1 changed files with 19 additions and 11 deletions
30
setup.py
30
setup.py
|
|
@ -518,17 +518,25 @@ if enable_training:
|
|||
# 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"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue