Expand environment variables in path field
See original GitHub issueIt would be nice if the injection of environment variables worked for the path variable too
@njgrisafi from #1688
It would be nice if we can have environment variables loaded throughout the entire Pipfile. E.g.
[dev-packages] my-package = {path="${PATH_TO_REPO}", editable = true}
Is your feature request related to a problem? Please describe.
Environment expansion does not work for path
or file
as observed in #2317
Describe the solution you’d like
I’d like the variable expansion to work for the path/file fields. Unfortunately, this probably involves an expansion in the Pipfile.lock
too, so that both can truly be portable with respect to the environment variable
Describe alternatives you’ve considered
I tried this in pipenv/project.py
as a failed POC.
def _parse_pipfile(self, contents):
from pipfile.api import PipfileParser
try:
d = tomlkit.parse(contents)
except Exception:
# We lose comments here, but it's for the best.)
# Fallback to toml parser, for large files.
d = toml.loads(contents)
return PipfileParser().inject_environment_variables(d)
I will have to use symlinks in the meantime
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Expand environment variables in path - Stack Overflow
I want to expand environment variables in R like ...
Read more >Certain Variables won't expand in Windows System ...
For some reason there are certain Environment Variables that won't expand when used in the "PATH" variable in the System Variables.
Read more >How to correctly add a path to PATH? - Unix Stack Exchange
PATH is just an environment variable, and if you want to add to the PATH, you have to rebuild the variable with exactly...
Read more >Environment.ExpandEnvironmentVariables(String) Method
Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then...
Read more >Use environment variables in the configuration - Elastic
If you need to use a special character in your configuration file, use $ to escape the expansion. For example, you can escape...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would be nice to have this feature. Currently we need to install an #egg from a private gitlab repo and the ability to inject the user token would be nice, such as:
mypkg = {git = "https://oauth2:$GITLAB_TOKEN@gitlaburl.com/my-repo#egg=mypkg"}
@bkemmer Your Pipfile is not valid,
[[source]]
is for PyPI index, not VCS repo.