Managing Python Dependencies Transcripts
Chapter: Setting Up Reproducible Environments & Application Deploys
Lecture: Lesson Overview

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Welcome to the setting up reproducible environments and application deploys module. Here is where you are right now in the course,
0:08 so you've learned how to manage third party dependencies with pip, you know how to isolate your dependencies with virtual environments
0:14 and you also just learned how to find and identify quality Python packages, now let's talk about another very important topic
0:22 when it comes to dependency management in Python. Let's say you're working on a Python program, and the project has matured quite a bit,
0:31 and so now finally, you want to share it with other people. If you're using third party packages, in your Python program,
0:37 then that might not be so easy. How can you make sure that someone else trying out your program can get the exact same set of dependencies?
0:46 Even the slightest version conflicts can make installing someone else's Python program a very frustrating experience.
0:54 So the real question here is how do you reliably specify all of the dependencies that a Python program needs.
1:01 And this is not only about sharing your programs with other people, there are many environments your Python program can run in,
1:09 for example, there is likely going to be a local development environment and ideally, that development environment should be the same
1:15 across all of the developers working on the project. Then there might be automated tests that are being run on a continuous integration infrastructure.
1:25 Again, all of these tests should run under the same set of dependencies, depending on the complexity of your program,
1:31 there might be several deployment targets, for example, if you're building a web application, there might be a staging server and a production server.
1:39 How can you make sure that all of those environments use the exact same set of dependencies,
1:44 because using the same set of dependencies across all of these environments, with the exact same packages and the exact same version numbers,
1:53 is very important to achieve a reliable deployment process. So really, the goal here is that all environments
2:00 are going to use the same set of dependencies. So this is the goal that we're aiming for here.
2:06 Now, how do you make dependency installs repeatable in Python? And the answer is requirements files.
2:15 In this module in the course you are going to learn how to use requirements files to make your application deploys
2:22 and Python project installs fully repeatable. First, you are going to go through a quick introduction to requirements files,
2:28 to learn what they are, what they look like and how to use them. Right after that, you are going to learn how to capture
2:35 project dependencies automatically using pip. In the third lesson in this module, you are going to learn
2:40 how to restore captured dependencies in order to deploy your application. Next, you're going to learn some tricks on how to separate
2:46 your development and production dependencies; to conclude the module, you are going to learn some best practices
2:52 around requirements files that will make working with them a lot easier. Alright, time to make your Python application deploys
2:57 fully repeatable, let's jump right in.


Talk Python's Mastodon Michael Kennedy's Mastodon