Configuring a setup.py script

To package our project using setuptools, we need to create a setup script; by convention, this is called setup.py and is created in the application's root directory.

The basic structure of setup.py is as follows:

from setuptools import setup

setup(
    # Arguments
)

The vast majority of our configuration will be passed as arguments to the setup() function, defining the basic metadata for our package, what will be packaged, and providing some functionality after installation.

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.