1

I keep seeing this kind of code a lot in python setup.py files.

from distutils.core import setup
setup(
        name            = 'SOMETHINGHERE',
        version         = 'SOMETHINGHERE',
        py_modules      = ['SOMETHINGHERE'],
        author          = 'SOMETHINGHERE',
        author_email    = 'SOMETHINGHERE',
        url             = 'http://www.example.com',
        description     = 'SOMETHINGHERE',
        )

What exactly does it mean? How does it work? I'm trying to understand the code. ps: sorry about my poor english xP

FRD
  • 2,234
  • 3
  • 19
  • 24

1 Answers1

3

This is described in detail in the Distutils documentation.

Basically setup is a function that checks which command distutils was invoked with and performs the appropriate action on the package (e.g. installing it, downloading it, building a binary distribution, etc.). The arguments provide any package-specific information that setup needs to carry out these tasks.

David Z
  • 122,461
  • 26
  • 246
  • 274