DevOps - Gold-Everything/Search-Engine GitHub Wiki
Unit testing library
If you're familiar with node_modules
and package.json
, we're looking for the Python solution to this problem. Pipenv solves this problem by having the files Pipfile
and Pipfile.lock
.
We have a project we need to be able to share to other people and ensure it runs like how we committed it. Pip installs packages globally, not to a project. While there is a convention for using Pip to achieve some form of dependency management (e.g. requirements.txt), Pipenv allows for a cleaner and more reliable workflow. It utilizes virtualenv which is a way to "containerize" a Python project so it includes all the relevant dependencies. Pipenv encompasses this and some other technologies to bring a more friendly and high level interface similar to Pip.
Relevant documentation I found helpful
Instead of doing pip install <pkg>
you're generally going to want to do pipenv install <pkg>
pipenv install
will install the package in the python virtual environment by default.
pipenv run [usual python command here]
will run the python command inside the virtual environment.
If you want to continue having the dependencies locally installed, i.e. not in the virtual environment
pipenv install --system
will locally install all the dependencies from pipfile.lock
( It took forever to figure this out. Relevant links: Docs, Github issue )
.env specifies all the environment variables for the Python instance