Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse package_env with --installpkg #2803

Merged
merged 1 commit into from Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/2442.bugfix.rst
@@ -0,0 +1 @@
Reuse package_env with ``--installpkg`` - by :user:`q0w`.
5 changes: 2 additions & 3 deletions src/tox/tox_env/runner.py
Expand Up @@ -87,9 +87,8 @@ def interrupt(self) -> None:
self._call_pkg_envs("interrupt")

def get_package_env_types(self) -> tuple[str, str] | None:
has_external_pkg = getattr(self.options, "install_pkg", None) is not None
if self._register_package_conf() or has_external_pkg:
has_external_pkg = has_external_pkg or self.conf["package"] == "external"
if self._register_package_conf():
has_external_pkg = self.conf["package"] == "external"
self.core.add_config(
keys=["package_env", "isolated_build_env"],
of_type=str,
Expand Down
Expand Up @@ -147,3 +147,14 @@ def test_tox_install_pkg_bad_wheel(tox_project: ToxProjectCreator, tmp_path: Pat

result.assert_failed()
assert "failed with no .dist-info inside " in result.out, result.out


def test_tox_install_pkg_with_skip_install(
tox_project: ToxProjectCreator,
demo_pkg_inline: Path,
demo_pkg_inline_wheel: Path,
) -> None:
ini = "[testenv:foo]\nskip_install = true"
project = tox_project({"tox.ini": ini, "pyproject.toml": (demo_pkg_inline / "pyproject.toml").read_text()})
result = project.run("-e", "py", "--installpkg", str(demo_pkg_inline_wheel))
result.assert_success()