diff --git a/docs/changelog/1047.feature.rst b/docs/changelog/1047.feature.rst new file mode 100644 index 0000000000..4c88f55eee --- /dev/null +++ b/docs/changelog/1047.feature.rst @@ -0,0 +1 @@ +level three verbosity (```-vvv``) show the packaging output - by :user:`gaborbernat` diff --git a/src/tox/package.py b/src/tox/package.py index 29548c6544..830058cbd6 100644 --- a/src/tox/package.py +++ b/src/tox/package.py @@ -137,10 +137,12 @@ def make_sdist_legacy(report, config, session): with session.newaction(None, "packaging") as action: action.setactivity("sdist-make", setup) session.make_emptydir(config.distdir) - action.popen( + build_log = action.popen( [sys.executable, setup, "sdist", "--formats=zip", "--dist-dir", config.distdir], cwd=config.setupdir, + returnout=True, ) + report.verbosity2(build_log) try: return config.distdir.listdir()[0] except py.error.ENOENT: @@ -189,7 +191,7 @@ def build_isolated(config, report, session): ) as action: package_venv.run_install_command(packages=build_requires_dep, action=action) session.finishvenv(package_venv) - return perform_isolated_build(build_info, package_venv, session, config) + return perform_isolated_build(build_info, package_venv, session, config, report) def get_build_info(folder, report): @@ -232,7 +234,7 @@ def abort(message): return BuildInfo(requires, module, "{}{}".format(module, obj)) -def perform_isolated_build(build_info, package_venv, session, config): +def perform_isolated_build(build_info, package_venv, session, config, report): with session.newaction( package_venv, "perform-isolated-build", package_venv.envconfig.envdir ) as action: @@ -257,6 +259,7 @@ def perform_isolated_build(build_info, package_venv, session, config): action=action, cwd=session.config.setupdir, ) + report.verbosity2(result) return config.distdir.join(result.split("\n")[-2]) diff --git a/src/tox/venv.py b/src/tox/venv.py index 12cd44cd95..29d5b644fe 100755 --- a/src/tox/venv.py +++ b/src/tox/venv.py @@ -91,7 +91,7 @@ def matches_with_reason(self, other, deps_matches_subset=False): if self_deps != other_deps: if deps_matches_subset: diff = other_deps - self_deps - if not diff: + if diff: return False, "missing in previous {!r}".format(diff) else: return False, "{!r}!={!r}".format(self_deps, other_deps) diff --git a/tests/unit/test_package.py b/tests/unit/test_package.py index e4c39a48be..05444e442f 100644 --- a/tests/unit/test_package.py +++ b/tests/unit/test_package.py @@ -404,3 +404,40 @@ def test_install_via_installpkg(mock_venv, initproj, cmd): fake_package = base.ensure(".tox", "dist", "pkg123-0.1.zip") result = cmd("-e", "py", "--notest", "--installpkg", str(fake_package.relto(base))) assert result.ret == 0, result.out + + +def test_verbose_isolated_build(initproj, mock_venv, cmd): + initproj( + "example123-0.5", + filedefs={ + "tox.ini": """ + [tox] + isolated_build = true + """, + "pyproject.toml": """ + [build-system] + requires = ["setuptools >= 35.0.2"] + build-backend = 'setuptools.build_meta' + """, + }, + ) + result = cmd("--sdistonly", "-vvv") + assert "running sdist" in result.out + assert "running egg_info" in result.out + assert "Writing example123-0.5/setup.cfg" in result.out + + +def test_verbose_legacy_build(initproj, mock_venv, cmd): + initproj( + "example123-0.5", + filedefs={ + "tox.ini": """ + [tox] + isolated_build = false + """ + }, + ) + result = cmd("--sdistonly", "-vvv") + assert "running sdist" in result.out + assert "running egg_info" in result.out + assert "Writing example123-0.5/setup.cfg" in result.out