Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Other Useful Python Packaging Tools

Give Feedback

This is the last lesson of the course and can be seen as a kind of appendix. It provides you a collection of additional useful Python packaging tools you may want to check out.

00:00 Now that you have an understanding of how to upload a project to PyPI, this will be kind of like an appendix video and cover a couple tools you can use to better manage your projects. Feel free to try them out on your next one.

00:13 The first thing we’ll cover are virtual environments. Now, we didn’t talk much about virtual environments, but they can help you with managing your dependencies. Because it’s so easy to pip install everything, your main Python distribution might end up with lots of things that conflict or aren’t easy to share with others. Virtual environments simplify this for you by giving you what’s basically a fresh install of Python to work with, and allow you to make sure your setup.py file has everything you need.

00:42 Another useful tool is Cookiecutter. Cookiecutter is based on setting up projects based on a template and a series of questions. Once you find a template that you would like to use, you can go ahead and run it with the link to that template, and you’ll get a series of prompts that you fill out and it’ll generate a project for you.

01:01 A good thing about Cookiecutter is there’s plenty of documentation out there for you to look at if you run into trouble or want to try something new. But it’s very general, and there are some other tools that we can use that are a bit more specific to publishing packages to PyPI. So let’s talk about Flit.

01:18 Flit is based on the thought that using an executable like setup.py is not ideal for building a package. PEP 518 recommends to use a .toml file, instead. TOML files are human readable and not too complex.

01:35 What Flit will do is it will work like Cookiecutter and ask you a series of questions, and then it will set up your project based on your answers to those questions.

01:44 A cool thing about Flit is that you can build using Flit and then you can even publish directly to PyPI from Flit. Finally, we’ll talk about Poetry. Poetry is very similar to Flit in that it will ask you a series of questions to structure your project.

02:01 You can then also build your package and upload it to PyPI through Poetry. Where Poetry is different is that it’s more focused on dependency management, and it works well with virtual environments.

02:14 Another cool thing about Poetry is it will add classifiers based on the license you select and the Python versions you indicate. By now, you know that you spend a good bit of time setting up the structure of your projects before you can get them onto PyPI, so take a look at some of these tools and see if they can help you speed up that process. There are links below to the documentation for each, so you can jump around and see if anything catches your eye. And that’s it!

02:40 Being able to upload packages to PyPI is an incredibly powerful tool for you to use as a developer and allows you to get your work in front of the entire Python community. Now it’s time to go out and see what you can do.

02:53 Thanks for watching.

derekm on Jan. 16, 2020

Good overview of how to package/publish.

johnbarney772 on March 27, 2020

Thank You

ibrahim suleiman on March 29, 2020

thanks alot i really do appreciate

Abdullah Alhadab on April 3, 2020

Thank you so much. It is a great course

hmhassanmehmood on April 15, 2020

Thanks for sharing!

Neeraj on May 28, 2020

Thanks for tutorial.

shivharep on May 29, 2020

Very helpful tutorial

Marcelo Garbarino on June 11, 2020

Thanks!

Ceteris Paribus on June 12, 2020

Thank you. Very interesting and informative.

laurentprat on Sept. 9, 2020

Thank you. Really important stuff btw

vlizana on Sept. 10, 2020

Nice tutorial! It seems that pip is taking over dependency management with its new resolver. As further reading I would recommend cookiecutter’s pypackage template, which even though the repo is a bit outdated, it has a lot of new features to learn like continuous integration.

Become a Member to join the conversation.