Skip to content
Closed
Show file tree
Hide file tree
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
22 changes: 1 addition & 21 deletions src/sagemaker/serve/detector/dependency_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,7 @@ def capture_dependencies(dependencies: dict, work_dir: Path, capture_all: bool =
"""Placeholder docstring"""
path = work_dir.joinpath("requirements.txt")
if "auto" in dependencies and dependencies["auto"]:
command = [
sys.executable,
Path(__file__).parent.joinpath("pickle_dependencies.py"),
"--pkl_path",
work_dir.joinpath(PKL_FILE_NAME),
"--dest",
path,
]

if capture_all:
command.append("--capture_all")

subprocess.run(
command,
env={"SETUPTOOLS_USE_DISTUTILS": "stdlib"},
check=True,
)

with open(path, "r") as f:
autodetect_depedencies = f.read().splitlines()
autodetect_depedencies.append("sagemaker[huggingface]>=2.199")
raise ValueError("Auto requirements.txt generation is temporarily disabled in this version of sagemaker")
else:
autodetect_depedencies = ["sagemaker[huggingface]>=2.199"]

Expand Down
31 changes: 0 additions & 31 deletions src/sagemaker/serve/detector/pickle_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,25 +100,6 @@ def get_currently_used_packages():
return currently_used_packages


def get_requirements_for_pkl_file(pkl_path: Path, dest: Path):
"""Placeholder docstring"""
with open(pkl_path, mode="rb") as file:
cloudpickle.load(file)

currently_used_packages = get_currently_used_packages()

with open(dest, mode="w+") as out:
for x in get_all_installed_packages():
name = x["name"]
version = x["version"]
# skip only for dev
if name == "boto3":
boto3_version = boto3.__version__
out.write(f"boto3=={boto3_version}\n")
elif name in currently_used_packages:
out.write(f"{name}=={version}\n")


def get_all_requirements(dest: Path):
"""Placeholder docstring"""
all_installed_packages = get_all_installed_packages()
Expand Down Expand Up @@ -146,15 +127,3 @@ def parse_args():
args = parser.parse_args()
return (Path(args.pkl_path), Path(args.dest), args.capture_all)


def main():
"""Placeholder docstring"""
pkl_path, dest, capture_all = parse_args()
if capture_all:
get_all_requirements(dest)
else:
get_requirements_for_pkl_file(pkl_path, dest)


if __name__ == "__main__":
main()
141 changes: 0 additions & 141 deletions tests/unit/sagemaker/serve/detector/test_dependency_manager.py

This file was deleted.

Loading
Loading