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

401 - Add venv command #610

Closed

Conversation

zymergen-luke
Copy link

This makes it easier to programmatically access paths relative to the
virtualenv. A common use case is to activate the virtualenv

source ${poetry venv}/bin/activate

This programmatic access can be used to automate virtualenvs upon cd-ing
into a project or as an alias, for example

#401

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

I'm basing this change on the master branch, as the develop branch appears to be behind master. For example, the MockEnv class does not exist yet on develop, despite existing in master.

I'm just throwing this up here to get this ticket started, but I'm up to alternative ideas about implementation.

A few other thoughts:

  1. Maybe we should have an info command which is like debug:info but returns a single field. e.g. poetry info:venv would return the venv while poetry info:python_version would return the python version.
  2. Or perhaps we merge this with debug:info so that it's something like debug:info:venv (although given that it would become api, I wouldn't like the debug prefix), while debug:info gives you all the info
  3. I could also imagine a command to directly get the activate script. Either returning the path to the script:
    source ${poetry activate}
    or the contents of the activate script:
    eval ${poetry activate}

This makes it easier to programmatically access paths relative to the
virtualenv.  A common use case is to activate the virtualenv

    source ${poetry venv}/bin/activate

This programmatic access can be used to automate virtualenvs upon cd-ing
into a project or as an alias, for example
@zymergen-luke
Copy link
Author

@sdispater - Can I get your thoughts on this?

@sdispater
Copy link
Member

Thanks for taking the time to make this PR and sorry for not getting back to you sooner.

However, I will close this PR since it is superseded by #731.

@sdispater sdispater closed this Dec 12, 2018
@zymergen-luke
Copy link
Author

Thanks for getting that feature in!

Copy link

github-actions bot commented Mar 1, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants