Configurations

Configurations of to-requirements.txt allows you to customize the way the package deal with requirements.txt the way you like.

There is two sets of configs: local and global. Local settings applies to your current folder. Global settings are used as default as local settings are not specified.

View the config

The following command will output the local config or to-requirements.txt:

requirements-txt config

The following command will output the global config or to-requirements.txt:

requirements-txt config --global

Enable / Disable the package

  • Name: disable

  • Values: 0, 1

  • Default: 0

To disable the package use the following command:

requirements-txt config disable 1

To enable the package use the following command:

requirements-txt config disable 0

Only git repository

  • Name: only_git

  • Values: 0, 1

  • Default: 0

Enable only git repositories

Enable saving to requirements.txt only in git repositories:

requirements-txt config only_git 1

Enable saving to requirements.txt only in git repositories globally:

requirements-txt config --global only_git 1

Disable only git repositories

Disable saving to requirements.txt only in git repositories:

requirements-txt config only_git 1

Disable saving to requirements.txt only in git repositories globally:

requirements-txt config --global only_git 1

Allow create requirements.txt

  • Name: allow_create

  • Values: 0, 1

  • Default: 0

Allow requirements.txt creation

To allow the package to create requirements.txt if it does not exist:

requirements-txt config allow_create 1

To allow the package to create requirements.txt if it does not exist globally:

requirements-txt config --global allow_create 1

Disallow requirements.txt creation

To disallow the package to create requirements.txt if it does not exist:

requirements-txt config allow_create 0

To disallow the package to create requirements.txt if it does not exist globally:

requirements-txt config --global allow_create 0

Config files

Local settings are stored in the current directory.

./.to-requirements.txt/default.ini

Global settings are stored in the user folder. For Linux:

/home/<user>/.to-requirements.txt/default.ini