Elliot Simpson

Elliot started attending PyCons in 2010 and has been using Python ever since, most recently in his role as Software Engineer at Crown Equipment (picking things up and putting them down). In his free time, he has written games, a vocabulary application, and translation tools.


Session

08-24
14:40
30min
Python Package Management - Rye Is All You Need
Elliot Simpson

Python the language is great - Python the package management experience, not so much.

It's easy to get into also sorts of painful trouble as a beginner. You start pip installing libraries to your machine and everything works - until there is a conflict between the versions you need for different projects. Or maybe you want to share your code but don't have a good way of explaining what dependencies they need to install to get it working. Or an important library only works on a previous version of Python. It's time to learn some basic package management.

Until recently it has been hard to know what to advise newcomers to use for package management - there are so many choices. The Lean Python project recommends rye for both beginner and advanced use cases so that's what we'll cover here. Rye can replace all the other tools you're using. In addition to showing off some of the main features of rye we'll discuss the purposes of package management and some of the specific tasks we want package management software to handle for us:

  • Dependency management for our code (e.g. we might need pandas >= 2.0):
  • Creating and managing a virtual environment so our project is isolated from other projects - potentially using a different version of Python and different libraries and versions of those libraries from other projects. We also avoid breaking system Python. If you don't know what a virtual environment is, rye makes them much easier to use.
  • Pinning to a specific Python version
  • Building wheels so others can painlessly install your code

At the end of this presentation you'll know how to use rye for package management with a few easy-to-remember commands. Even experienced developers will learn something useful.

Breakout Room