Python dependency management practice

Now I am participating in the node.js project, and I like the "node way" of dependecy control.

I will give some examples for those who have not worked with npm

  • npm install package_name --save- establishes package_namehow production relationship
  • npm install package name --save-dev- establish package_namehow to depend on development.

All depots are stored in a file package.jsonthat is indexed by the version control system. When I clone a repo, I just type npm installin the terminal and it installs everything. As far as I know, I am pip freezeable to do this, but:

On a production server I can type npm install --production, and all my build tools, testing framework, etc. not installed. Just production prints.

So the question is:

How do you separate the dependency of production and development from pip (or another tool)?

+5
source share
2 answers

There is a good solution, this is a completely new tool called pipenv . Seems like an npm analogue for python.

0
source

I would create two virtualenvs ( venv for Python 3) with a separate file requirements.txtfor each, for example requirements-production.txtand requirements-develop.txt, but this looks a little strange to me.

git /. develop, requirements.txt ( ). / , master. .

+4

All Articles