From db5432bf9c49704fd7de2ec0b3baf56037065cb2 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Mon, 7 Oct 2019 15:43:00 +0530 Subject: [PATCH] nox: Install from a source distribution --- noxfile.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 3244add5f..3ddd0c8aa 100644 --- a/noxfile.py +++ b/noxfile.py @@ -101,8 +101,19 @@ def test(session): ) session.log(msg) - # Install sources - run_with_protected_pip(session, "install", ".") + # Build source distribution + sdist_dir = os.path.join(session.virtualenv.location, "sdist") + session.run( + "python", "setup.py", "sdist", + "--formats=zip", "--dist-dir", sdist_dir, + silent=True, + ) + generated_files = os.listdir(sdist_dir) + assert len(generated_files) == 1 + generated_sdist = os.path.join(sdist_dir, generated_files[0]) + + # Install source distribution + run_with_protected_pip(session, "install", generated_sdist) # Install test dependencies run_with_protected_pip(session, "install", "-r", REQUIREMENTS["tests"])