Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setup.py, makefile... What I need?

I've been reading a lot these days, and I'm not sure about the specific use of it. I need ask it, because cannot find someone who explain it to me. Now I'm lost..

The main problem is I need install my app (python + glade) in "/usr/share/name_app" and a ".desktop" file in "/usr/share/applications" in Ubuntu.

The solution that I've find is creating a ".deb" file because the installation is perfect. In ubuntu I can launch it with Unity clicking on the launcher, the ".desktop". (Probably I'll upload it to "Ubuntu Software Center").

For windows I could use "py2exe" or a similar, and another one for Mac.

But, like the code is in GitHub, it should have a "setup" or a "makefile" to install it.

After reading and reading (and reading), I think that "setup.py" is only for install a module and then import it with python. However if I have to install and app, how can I distribute it making a "setup.py" or a "makefile"? Which is better for install an app? Which is the diference? What I have to use?

Thanks:)

like image 357
pirobtumen Avatar asked Aug 31 '12 08:08

pirobtumen


People also ask

What should setup py contain?

The setup.py file may be the most significant file that should be placed at the root of the Python project directory. It primarily serves two purposes: It includes choices and metadata about the program, such as the package name, version, author, license, minimal dependencies, entry points, data files, and so on.

Does setup py install requirements?

Setup.py Build Environment Packages installed with setup.py have build requirements that developers must adhere to. However, some requirements are optional.

Does Python need a MakeFile?

Nothing in your Python code needs to know that make is being used. Your Makefile simply describes the commands you would otherwise run at the command line to build your executable, whatever those might be.


1 Answers

setup.py is used to deploy Python applications and modules with virtualenv http://www.virtualenv.org/en/latest/index.html setup.py is mostly useful for the application developers - you can run

  python setup.py develop

within virtualenv to set-up your development workspace with Python dependencies.

For each platform distribution (Windows, OSX, Linux) use the distribution tools as you are currently using.

You can also use setuptools tools to roll out packages from setup.py for the platform architecture. Eg. creating .deb from setup.py

http://pypi.python.org/pypi/stdeb/

More info about setup.py

http://packages.python.org/distribute/setuptools.html

like image 91
Mikko Ohtamaa Avatar answered Oct 17 '22 19:10

Mikko Ohtamaa