Managing Python Dependencies Transcripts
Chapter: Setting Up Reproducible Environments & Application Deploys
Lecture: Introduction to Requirements Files

Login or purchase this course to watch this video and the rest of the course contents.
0:01 You might have seen those requirements files before, they are usually called requirements.txt or sometimes also requirements.pip
0:10 and what they are is basically a list of pip install arguments placed in a text file.
0:16 So this is what a very simple requirements.txt file would look like. You can see here that the requirements file contains a list of package names.
0:26 So in this case, it includes the requests module, with a specific version using the version specifier syntax you learned about earlier,
0:35 and it also lists the schedule module with a similar version specifier. Now this is a very simple example but it's also quite typical
0:43 of what a real world requirements file would look like. One interesting thing you can do with these requirements files
0:49 is that you can add comments to these files, so you would just place the hash character and then you can place a comment.
0:56 This is often helpful to explain what is going on in your requirements files
1:01 or if you want to leave a comment for the next developer working on that file. Requirements files capture all of the third party dependencies
1:10 a Python program needs to run, and usually, they do that by specifying the exact package versions.
1:17 Using requirements files a Python environment can be reproduced in exactly the same way on a different machine or for different developer,
1:27 or even just in a different directory on your local machine. They are a key piece for achieving repeatability in your Python built environments.


Talk Python's Mastodon Michael Kennedy's Mastodon