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

Add support to read name of Pipfile from environment variable #999

Closed
DonJayamanne opened this issue Mar 9, 2018 · 4 comments · Fixed by #1092
Closed

Add support to read name of Pipfile from environment variable #999

DonJayamanne opened this issue Mar 9, 2018 · 4 comments · Fixed by #1092
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@DonJayamanne
Copy link

Name of the Pipfile is currently hardcoded in the extension.
This could come from an environment variable (see here https://github.com/pypa/pipenv/blob/5f48233637adc99bb16e6c601a728dc641bd5cd2/pipenv/environments.py#L29)

TODO: Confirm this is the case and create necessary PR accordingly.

@DonJayamanne DonJayamanne self-assigned this Mar 9, 2018
@DonJayamanne DonJayamanne added this to the March 2018 milestone Mar 9, 2018
@DonJayamanne DonJayamanne added feature-request Request for new features or functionality feature-extension labels Mar 9, 2018
@brettcannon
Copy link
Member

In this instance we may need to just use pipenv --venv or some such command to do the detection appropriately.

@MikhailArkhipov
Copy link

Yes, running command is a better test, but watch out for performance. This was the reason for the file check. Interpreter selection and startup time.

@DonJayamanne
Copy link
Author

@brettcannon @MikhailArkhipov
Not sure what you two are referring to here. Running any pipenv command will not tell us the name of the Pipfile. The name of the Pip file can be provided in the environment variable:

# Specify a custom Pipfile location.
PIPENV_PIPFILE = os.environ.get('PIPENV_PIPFILE')

All we need to do is:

  • Use the environment variable if it has been defined and the file exists
  • Else we fall back to the default of Pipfile (current behavior)

@brettcannon
Copy link
Member

What I'm saying is we simply don't care about a Pipfile and instead just care if pipenv knows of a virtual environment for the directory.

DonJayamanne added a commit that referenced this issue Mar 17, 2018
* ✨ support for pip environment variable to get pipfile name

* 📝 news entry
* Fixes #999
@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants