-
-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement tox environment provisioning
- Loading branch information
1 parent
d21b14d
commit 5582754
Showing
13 changed files
with
279 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Auto provision host tox requirements. In case the host tox does not satisfy either the | ||
:conf:`minversion` or the :conf:`requires`, tox will now automatically create a virtual environment | ||
under :conf:`provision_tox_env` that satisfies those constraints and delegate all calls to this | ||
meta environment. This should allow automatically satisfying constraints on your tox environment, | ||
given you have at least version ``3.8.0`` of tox. Plugins no longer need to be manually satisfied | ||
by the users, increasing their ease of use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""In case the tox environment is not correctly setup provision it and delegate execution""" | ||
import signal | ||
import subprocess | ||
|
||
|
||
def provision_tox(provision_venv, args): | ||
ensure_meta_env_up_to_date(provision_venv) | ||
process = start_meta_tox(args, provision_venv) | ||
result_out = wait_for_meta_tox(process) | ||
raise SystemExit(result_out) | ||
|
||
|
||
def ensure_meta_env_up_to_date(provision_venv): | ||
if provision_venv.setupenv(): | ||
provision_venv.finishvenv() | ||
|
||
|
||
def start_meta_tox(args, provision_venv): | ||
provision_args = [str(provision_venv.envconfig.envpython), "-m", "tox"] + args | ||
process = subprocess.Popen(provision_args) | ||
return process | ||
|
||
|
||
def wait_for_meta_tox(process): | ||
try: | ||
result_out = process.wait() | ||
except KeyboardInterrupt: | ||
# if we try to interrupt delegate interrupt to meta tox | ||
process.send_signal(signal.SIGINT) | ||
result_out = process.wait() | ||
return result_out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.