Python3: Should you include dependencies that you don't necessarily use in the project in the requirements.txt?

In Python, let's say I'm using a library like flake8 to do style guide enforcement for my project and I've also told my fellow coders working on the same project that flake8 guidelines is what we will be using as the style guide. However, I'm not using it for anything directly in my project. I run flake8 in the command line to check if my project follows flake8 guidelines, but don't use it in my project for anything other that. If this is the case, Is flake8 something that belongs in the requirements.txt file? Or can it be omitted and only the dependencies actually used in the project need to go inside the requirements.txt file?

1 answer

  • answered 2018-07-11 02:56 Ron Wellman

    A requirements file should only include required dependencies of your program. Since flake8 is a supporting module to ensure styling consistency it does not fall into this category. I would not include it.