Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Python packaging tutorial
Rating: 4.1 out of 5(4 ratings)
26 students

Python packaging tutorial

Create a Python package on PyPI, add data with setuptools, twine, TOML and flit and C++ extensions (manylinux,musllinux)
Created byPython Explode
Last updated 12/2024
English
English [Auto],

What you'll learn

  • Create a Python package
  • Publish a python package in PyPI index
  • Attach data to package using several ways (MANIFEST, data_files, py_modules, extension modules, scripts)
  • Create executable scripts and entry points for packages
  • Build C++ extension binding as Python package
  • Build package for multiple Linux platforms using manylinux and musllinux (alpine) images
  • Build package using TOML and Flit

Course content

7 sections44 lectures1h 23m total length
  • Intro0:37

    Explore the basics of Python packaging, learn to create and reuse a simple component, and publish Python packages using pip, building toward more advanced topics.

  • Write Python module2:22

    Create a local Python package by adding a module with a simple add function and an __init__.py. Package with Setuptools to import and reuse the code across projects.

  • Write first setup.py file1:07

    Write the first setup.py file by importing the setup function from setup tools, then configure the package with name and version at the project root to define dependencies and requirements.

  • Install first local package0:29

    Install the project locally by running pip install -e ., enabling editable mode so code changes reflect instantly from the current working directory.

  • Use created package0:34

    Verify the created package is installed with pip list and grep, then test it outside the project folder by importing add and confirming two plus three equals five.

  • Update package1:35

    Learn how to update a Python package by editing setup.py, performing pip install -e ., and verifying the update in editable mode, then uninstall to confirm removal.

  • Local Python package

Requirements

  • Python and Linux basics

Description

Python packaging is a critical aspect of software development that allows developers to distribute and share their code with others efficiently. Whether you're a novice programmer or an experienced developer, understanding how to package and distribute your Python projects is essential. This comprehensive course is designed to equip you with the knowledge and skills needed to navigate the world of Python packaging confidently.


In this course, you will embark on a journey through the fundamental concepts, best practices, and tools that are essential for Python packaging. You will learn how to structure your Python projects and create reusable modules.


As you progress, you will explore the various packaging formats, including source distributions (sdist) and binary distributions (bdist), and discover how to create Python packages that can be easily distributed and installed on different platforms. This course will cover the use of setuptools, the de facto standard tool for Python packaging, and introduce you to modern packaging tools like TOML and Flit.


Additionally, you will gain a deep understanding of the Python Package Index (PyPI), the central repository for Python packages, and learn how to upload your packages to PyPI, making them accessible to the global Python community.


You will learn how to build C++ extensions for Python and how to build packages for multiple platforms (manylinux and musllinux). You will also learn how to create executable scripts and entry points for packages (console scripts, GUI scripts, and plugins). Whether you are developing libraries for open-source contributions or deploying applications within your organization, Python packaging is a crucial skill that will enhance your Python programming journey.


Join the course and unlock the power to share your Python creations with the world. Prepare to take your Python development skills to the next level and ensure that your code is not only functional but also accessible and maintainable. Enroll today to become a proficient Python packager and distributor.

Who this course is for:

  • Python programmers