Should every python program be redistributed with setup.py?

Disclaimer: I'm still not sure I fully understand what setup.py does.

From what I understand, using the setup.py file is convenient for packages that need to be compiled, or for notifying Disutils that a package has been installed and can be used by another program. setup.py is thus great for libraries or modules.

But what about super simple packages that only have to run foo.py? Can a setup.py file make packaging for a Linux repository easier?

+3


source to share


1 answer


Using a setup.py

script is only useful if:

  • Your code is a C extension and then depends on platform specific features that you really don't want to manually define.
  • Your code is pure Python, but depends on other modules, in which case the dependencies can be resolved automatically.


For a single file or multiple sets of files that don't rely on anything else, writing one isn't worth the hassle. As a side note, your code is likely to be more appealing to people if it doesn't require complex customization to try. An "install" is simply copying a directory or one file into one directory of the project.

+4


source







All Articles