Skip to content

Commit

Permalink
Add Tox plugin to work around cyclic dependency on verifai (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfremont committed Apr 27, 2024
1 parent 9da70c3 commit 960a5f1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions toxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import tox.plugin


@tox.plugin.impl
def tox_on_install(tox_env, arguments, section, of_type):
# Add extra installation stage to install Scenic *before* its dependencies,
# so that if we install VerifAI we won't pull in a different version of
# Scenic that might have different dependencies. (This is currently
# necessary since Tox installs the dependencies and Scenic in 2 different
# invocations of pip. See https://github.com/tox-dev/tox/discussions/3273
# for a discussion.)
if section == "RunToxEnv" and of_type == "package":
assert len(arguments) == 1
package = arguments[0]
path = package.path
install_args = ["--force-reinstall", "--no-deps", str(path)]
tox_env.installer._execute_installer(install_args, "package_early")

0 comments on commit 960a5f1

Please sign in to comment.