9

Everyday Project Packaging With pyproject.toml

 1 year ago
source link: https://realpython.com/courses/packaging-with-pyproject-toml/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Everyday Project Packaging With pyproject.toml

Packaging is often associated with publishing a project on PyPI, which can make you bypass packaging as something you don’t need to worry about at the start of your project. Python packaging has also had a long history and can be overwhelming for all levels of programmers. But it doesn’t have to be a scary process!

In this Code Conversation, you’ll follow a chat between Ian and Geir Arne demonstrating the relatively new, officially sanctioned way of setting up your Python projects using a pyproject.toml file and installing your package with pip. This offers nice benefits, such as:

  • Being able to call your project from anywhere
  • Playing on the same team as the import system
  • Allowing for consistent imports
  • Having one file that’ll work for many build systems

Along the way, you’ll:

  • Structure files and folders in your project
  • Understand different ways to run your script
  • Explore how the import system works
  • Explore the Python packaging world
  • Write a pyproject.toml file to configure your package
  • Install your pacakge with pip

You’ll also dive into various rabbit holes along the way as Ian and Geir Arne talk about all the aspects of the process.

To get the most out of this Code Conversation, you should have a handle on Python basics, be able to create a virtual environment and install packages, and have some exposure to the import system. Ideally, you have some experience fighting against the import system and thinking that there must be a better way.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK