Modern Python Projects Transcripts
Chapter: Managing Python project
Lecture: Separate requirements files

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Another common practice with requirements files is to have a separate set of.
0:04 dependencies required to run your application, and a separate set of dependencies used only
0:10 by developers. For example, your production server doesn't need to run pytest,
0:15 so there is no need to install pytest at all.
0:18 But you, as a developer,
0:19 need to have pytest to run tests.
0:22 So you make two requirements files, one that is called requirements.txt
0:26 It contains the dependencies that you want to install everywhere,
0:31 so on a production server, but also on your computer.
0:34 And then you create another one called Requirements-dev that installs all the dependencies from
0:40 the requirements.txt file and some additional ones like pytests and it's plugins.
0:47 You use this file on your computer when you develop your application, with the separation of
0:52 requirements, you only install the necessary packages on your production server.
0:56 There is no need for you to have pytest installed on your production,
1:00 and the less packages you installed.
1:03 The lower is the risk that some of them will have a security vulnerability that hackers
1:08 can use, and it will also be slightly faster to installed packages on your production server.