pipenv
pipenv copied to clipboard
Allow configuring pipenv though a config file
Pipenv supports a lot of configurations though environmental variables. This is useful but those are not persistent and can't be pushed to a VCS. For example if we have a team of devs working on the same repo, I would like to commit a config file that Pipenv would pick up so all the devs have Pipenv configured the same way.
Thanks!
Have you tried adding them to a .env
file?
Have you tried adding them to a
.env
file?
https://github.com/pypa/pipenv/issues/2197#issuecomment-445754721
I've tried adding a .env file with PIPENV_VENV_IN_PROJECT=1
and it does not get used when creating the virtualenv on the master branch. Perhaps we can move the dotenv loading earlier in the process.
@matteius not sure about a .env, although anticipating dotenv loading would make sense on it's own.
It would be good to have a dedicated persistent config spec. One idea below - inspired on another package manager - but could be added (ideally) directly to the Pipfile.
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[virtualenvs]
in-project = true # default would be false
directory = ".venv" # default would be .venv as well
[packages]
pymongo = "*"
flask = "*"
# ...
My use case would be based such as in this .vscode/settings.json
. I just want to clone and do a pipenv install
without worrying about setting variables, or creating the .venv manually before installing. It's right there with the code.
{
"python.linting.pylintEnabled": true,
"python.linting.pylintPath": ".venv/bin/pylint",
"python.formatting.autopep8Path": ".venv/bin/autopep8"
}
@epomatti Any interest in working on a prototype PR of this?
@matteius sorry, won't be able to.
Essentially there are two styles of pipenv config --
1.) Config that is project wide and lives in the Pipfile 2.) Config that is environment specific and lives as an env var or in the .env file.
We are working to improve the interfaces to pipenv but I don't have bandwidth or necessarily think its a good idea to support a json config at this time. That being said we can extend the config options that are available to suit more use cases. If there are virtualenv or other options we want to support, please open new ticket(s) for these.