Skip to content

Commit 0db3ae6

Browse files
rohangujarathiRohan Gujarathi
authored andcommitted
fix: do not delete temp folder generated by sdist (#1291)
Co-authored-by: Rohan Gujarathi <[email protected]>
1 parent c859e3b commit 0db3ae6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/integ/sagemaker/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ def _generate_sagemaker_sdk_tar(destination_folder):
248248
"""
249249
Run setup.py sdist to generate the PySDK tar file
250250
"""
251-
subprocess.run(f"python3 setup.py sdist -d {destination_folder}", shell=True)
251+
subprocess.run(
252+
f"python3 setup.py egg_info --egg-base {destination_folder} sdist -d {destination_folder} -k",
253+
shell=True,
254+
check=True,
255+
)
252256
destination_folder_contents = os.listdir(destination_folder)
253257
source_archive = [file for file in destination_folder_contents if file.endswith("tar.gz")][0]
254258

tests/integ/sagemaker/experiments/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def tempdir():
155155
@pytest.fixture(scope="module")
156156
def dev_sdk_tar():
157157
resource_dir = os.path.join(DATA_DIR, "experiment")
158-
os.system("python setup.py sdist")
158+
os.system("python setup.py sdist -k")
159159
sdist_path = max(glob.glob("dist/sagemaker-*"), key=os.path.getctime)
160160
sdk_file = os.path.join(resource_dir, _EXP_PLUS_SDK_TAR)
161161
shutil.copy(sdist_path, sdk_file)

0 commit comments

Comments
 (0)