Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setup.py examples?

Tags:

python

rpm

After studying this page:

http://docs.python.org/distutils/builtdist.html

I am hoping to find some setup.py files to study so as to make my own (with the goal of making a fedora rpm file).

Could the s.o. community point me towards some good examples?

like image 627
jedierikb Avatar asked Jan 19 '11 20:01

jedierikb


People also ask

What is setup py file?

setup.py is a python file, the presence of which is an indication that the module/package you are about to install has likely been packaged and distributed with Distutils, which is the standard for distributing Python Modules. This allows you to easily install Python packages.

How do I use setup py files?

Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.

Is setup py outdated?

py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. I found a very detailed write-up explaining this issue: "Why you shouldn't invoke setup.py directly" (October 2021).


1 Answers

Complete walkthrough of writing setup.py scripts here. (with some examples)

If you'd like a real-world example, I could point you towards the setup.py scripts of a couple major projects. Django's is here, pyglet's is here. You can just browse the source of other projects for a file named setup.py for more examples.

These aren't simple examples; the tutorial link I gave has those. These are more complex, but also more practical.

like image 117
Rafe Kettler Avatar answered Sep 19 '22 00:09

Rafe Kettler