-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
virtualenv's main should take arguments #172
Comments
I don't necessarily have a problem with this change - but if you want to use virtualenv as an API just call the existing create_environment() function, that's a much nicer API than putting together a fake sys.argv. |
Unfortunately, this doesn't work either since logger is defined in main: │python -c 'import virtualenv; virtualenv.create_environment("/home/jhammel/foo")' While I would like this change, I'm open to other possibilities, with the caveat that I do (for silly reasons that I can go into if desired) need to run |
You must be using an old version of virtualenv. That was fixed last March in ea1786 and works fine in at least 1.6 and up. |
Ah, true enough. Thanks! |
I can confirm that the missing global logger is not an issue anymore (I'm using 1.9.1), and that calling |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions. |
https://github.com/pypa/virtualenv/blob/develop/virtualenv.py#L672
Should be
def main(args=sys.argv[1:]):
where
args
are later passed to parser.parse_args; this lets virtualenv be (more) meaningfully used as an APIThe text was updated successfully, but these errors were encountered: