-
Notifications
You must be signed in to change notification settings - Fork 10
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
Extend and improve acre #2
Open
aardschok
wants to merge
19
commits into
BigRoy:master
Choose a base branch
from
aardschok:FUS-32
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c078784
Added function to make it independent
aardschok c641d75
Added launcher module
aardschok e3b789c
added execute to api
aardschok d27d388
changed log.debug to log.error, removed launch function
aardschok bcefa99
removed empty line
aardschok 062e590
Refactored to use PATH and PATHEXT from env, extended docstrings
aardschok 39350fb
refactored to match signature
aardschok f55eaec
Merge branch 'master' of https://github.com/BigRoy/acre into FUS-32
aardschok f5409df
added launch module to make acre standalone
aardschok ca765bc
Refactored execute to
aardschok 920c665
refactored conflicting names
aardschok 733f31d
Delete launch files
aardschok 0d38e75
refactored function names, extended docstrings
aardschok b63a261
Refactored function name, append --> join
aardschok 7d75d8f
Added platform separator replacement
aardschok ad409c9
Added check for url values to skip those
aardschok 8557b2a
refactored launch module, added time.sleep to counter rapid closing
aardschok d58213d
added launch module
aardschok ba24285
changed launch to __main__
aardschok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,39 @@ | ||
import os | ||
import pprint | ||
|
||
from . import api | ||
|
||
|
||
def launch(tools, executable, args): | ||
|
||
tools_env = api.get_tools(tools.split(";")) | ||
env = api.compute(tools_env) | ||
|
||
env = api.merge(env, current_env=dict(os.environ)) | ||
print("Environment:\n%s" % pprint.pformat(env, indent=4)) | ||
|
||
# Search for the executable within the tool's environment | ||
# by temporarily taking on its `PATH` settings | ||
exe = api.which(executable, env) | ||
if not exe: | ||
raise ValueError("Unable to find executable: %s" % executable) | ||
|
||
print("Launching: %s" % exe) | ||
api.execute(exe, environment=env, args=args) | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
import argparse | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--tools", | ||
help="The tool environments to include. " | ||
"These should be separated by `;`", | ||
required=True) | ||
parser.add_argument("--executable", | ||
help="The executable to run. ", | ||
required=True) | ||
|
||
kwargs, args = parser.parse_known_args() | ||
|
||
launch(tools=kwargs.tools, executable=kwargs.executable, args=args) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for refactoring this to
execute
. It's the same method as in Avalon pipeline currently, but there it's called launch? Any reason why the original was a bad name?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aardschok should we still refactor this to
launch
?