Skip to content

Commit db5432b

Browse files
committed
nox: Install from a source distribution
1 parent f6d6904 commit db5432b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

noxfile.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,19 @@ def test(session):
101101
)
102102
session.log(msg)
103103

104-
# Install sources
105-
run_with_protected_pip(session, "install", ".")
104+
# Build source distribution
105+
sdist_dir = os.path.join(session.virtualenv.location, "sdist")
106+
session.run(
107+
"python", "setup.py", "sdist",
108+
"--formats=zip", "--dist-dir", sdist_dir,
109+
silent=True,
110+
)
111+
generated_files = os.listdir(sdist_dir)
112+
assert len(generated_files) == 1
113+
generated_sdist = os.path.join(sdist_dir, generated_files[0])
114+
115+
# Install source distribution
116+
run_with_protected_pip(session, "install", generated_sdist)
106117

107118
# Install test dependencies
108119
run_with_protected_pip(session, "install", "-r", REQUIREMENTS["tests"])

0 commit comments

Comments
 (0)