What is pip's equivalent of `npm install package --save-dev`?

前端 未结 8 1977
生来不讨喜
生来不讨喜 2021-01-29 20:07

In nodejs, I can do npm install package --save-dev to save the installed package into the package.

How do I achieve the same thing in Python package manager

8条回答
  •  青春惊慌失措
    2021-01-29 20:56

    I've created python package that wraps around the actual pip called pipm. All pip commands will work as it is, plus they will be reflected in the requirements file. Unlike pip-save(similar tool I found and wasn't able to use) it can handle many files and environments(test, dev, production, etc. ). It also has command to upgrade all/any of your dependencies.

    installation

    pipm install pkg-name

    installation as development dependency

    pipm install pkg-name --dev

    installation as testing dependency

    pipm install pkg-name --test

    removal

    pipm uninstall pkg-name

    update all your dependencies

    pipm update

    install all your dependencies from the requirements file

    pipm install

    including development dependencies

    pipm install --dev

提交回复
热议问题