diff --git a/plugins/accelerated-peft/tox.ini b/plugins/accelerated-peft/tox.ini index eb53996e..c2b33772 100644 --- a/plugins/accelerated-peft/tox.ini +++ b/plugins/accelerated-peft/tox.ini @@ -38,16 +38,16 @@ commands = isort {posargs:.} -# [testenv:build] -# description = build wheel -# deps = -# build -# commands = python -m build -w -# skip_install = True -# -# [testenv:twinecheck] -# description = check wheel -# deps = -# twine -# commands = twine check dist/* -# skip_install = True +[testenv:build] +description = build wheel +deps = + build +commands = python -m build -w +skip_install = True + +[testenv:twinecheck] +description = check wheel +deps = + twine +commands = twine check dist/* +skip_install = True diff --git a/plugins/framework/src/fms_acceleration/cli.py b/plugins/framework/src/fms_acceleration/cli.py index 04ad263a..687a8c28 100644 --- a/plugins/framework/src/fms_acceleration/cli.py +++ b/plugins/framework/src/fms_acceleration/cli.py @@ -49,18 +49,30 @@ def install_plugin( pipmain(["install", *args, pkg_name]) return - if pkg_name.startswith(PLUGIN_PREFIX): - pkg_name = pkg_name.replace(PLUGIN_PREFIX, "") - # otherwise should be an internet install - pipmain( + response = pipmain( [ "install", *args, - f"git+https://{GITHUB_URL}#subdirectory=plugins/accelerated-{pkg_name}", + pkg_name, ] ) + # Reference from https://github.com/pypa/pip/blob/main/src/pip/_internal/cli/status_codes.py + if response > 0: + print("PyPi installation failed. Falling back to installation from Github.") + + if pkg_name.startswith(PLUGIN_PREFIX): + pkg_name = pkg_name.replace(PLUGIN_PREFIX, "") + + pipmain( + [ + "install", + *args, + f"git+https://{GITHUB_URL}#subdirectory=plugins/accelerated-{pkg_name}", + ] + ) + def list_plugins(): print( diff --git a/plugins/fused-ops-and-kernels/tox.ini b/plugins/fused-ops-and-kernels/tox.ini index 28a33423..6a667f53 100644 --- a/plugins/fused-ops-and-kernels/tox.ini +++ b/plugins/fused-ops-and-kernels/tox.ini @@ -45,16 +45,16 @@ commands = black --exclude .*unsloth.* tests isort . -# [testenv:build] -# description = build wheel -# deps = -# build -# commands = python -m build -w -# skip_install = True -# -# [testenv:twinecheck] -# description = check wheel -# deps = -# twine -# commands = twine check dist/* -# skip_install = True +[testenv:build] +description = build wheel +deps = + build +commands = python -m build -w +skip_install = True + +[testenv:twinecheck] +description = check wheel +deps = + twine +commands = twine check dist/* +skip_install = True