Skip to content

Commit 1246054

Browse files
committed
fix: use tarfile instead
Signed-off-by: Henry Schreiner <[email protected]>
1 parent bb64a2d commit 1246054

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

noxfile.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
import datetime
99
import difflib
1010
import glob
11+
import io
1112
import os
1213
import re
1314
import shutil
1415
import subprocess
1516
import sys
17+
import tarfile
1618
import tempfile
1719
import textwrap
1820
import time
21+
import urllib.request
1922
from pathlib import Path
2023
from typing import IO, Generator
2124

@@ -74,7 +77,9 @@ def tests(session: nox.Session) -> None:
7477
)
7578

7679

77-
PROJECTS = {"packaging_legacy": "https://github.com/di/packaging_legacy.git"}
80+
PROJECTS = {
81+
"packaging_legacy": "https://github.com/di/packaging_legacy/archive/refs/tags/23.0.post0.tar.gz"
82+
}
7883

7984

8085
@nox.parametrize("project", list(PROJECTS))
@@ -86,8 +91,12 @@ def downstream(session: nox.Session, project: str) -> None:
8691
session.chdir(tmp_dir)
8792

8893
shutil.rmtree(project, ignore_errors=True)
89-
session.run("git", "clone", PROJECTS[project], external=True)
90-
session.chdir(project)
94+
with urllib.request.urlopen(PROJECTS[project]) as resp:
95+
data = resp.read()
96+
with tarfile.open(fileobj=io.BytesIO(data), mode="r:gz") as tf:
97+
tf.extractall(project)
98+
(inner_dir,) = Path(project).iterdir()
99+
session.chdir(inner_dir)
91100

92101
if project == "packaging_legacy":
93102
session.install("-r", "tests/requirements.txt")

0 commit comments

Comments
 (0)