It's true (see thread below) - I have been scared away from asking questions about distutils. But here I go... Can someone help me. I think this is quite a common problem but there doesn't appear to be any obvious answer: Can someone suggest how I can write a setup.py for a pure-Python application that should install on both Linux and Windows? The application includes a startup script, a package, and some data files (or package data) referred to by some modules in the package. The Linux version will be distributed as a source distribution. The Windows version will be distributed as a bdist_wininst, and should create a shortcut in the Start Menu folder. An answer will not only receive my heartfelt thanks, but be posted on the web (http://www.redbrick.dcu.ie/~noel/distutils), so that others will not have the same problem. A method that will work for both Python 2.3 and 2.4 would be the most appreciated. ---------contents of development directory setup.py README MANIFEST.in license.txt src/ startupscript.py mypkg/ __init__.py module_a.py help.html images/ shamrock.png Regards, Noel On Wed, 2005-12-07 at 14:22 -0500, Stephen Langer wrote:
On Dec 7, 2005, at 12:10 PM, Ian Bicking wrote:
Kevin Dangoor wrote:
-1
In the months that I've been subscribed to this list, I haven't really seen any *other* discussion that seems geared towards improving distribution of Python modules and add-ons.
Ditto. Setuptools is the most active distutils-related development right now, no surprise there's lots of messages on it. The volume is a *good* thing ;)
I guess the concern is that the dominance of setuptools message is scaring away people with old-fashioned distutils questions. There haven't been many of those lately, and some of them seem to have received no response. I don't think that splitting the list in two is a solution, though. There's not enough traffic to warrant that (except for a brief spurt a week or so ago...)
-- Steve
"Noel O'Boyle"
It's true (see thread below) - I have been scared away from asking questions about distutils. But here I go...
Can someone help me. I think this is quite a common problem but there doesn't appear to be any obvious answer:
Can someone suggest how I can write a setup.py for a pure-Python application that should install on both Linux and Windows?
The application includes a startup script, a package, and some data files (or package data) referred to by some modules in the package.
The Linux version will be distributed as a source distribution. The Windows version will be distributed as a bdist_wininst, and should create a shortcut in the Start Menu folder.
In bdist_wininst, you can create shortcuts (and do other fancy stuff) in the postinstall-script. It is badly documented, maybe even fragile, but looking into other setup scripts should get you started. Here are some pointers: PythonCard postinstall script: http://cvs.sourceforge.net/viewcvs.py/pythoncard/PythonCardPrototype/install-pythoncard.py?rev=1.4&view=auto Pywin32 postinstall script: http://cvs.sourceforge.net/viewcvs.py/pywin32/pywin32/pywin32_postinstall.py?rev=1.18&view=auto
An answer will not only receive my heartfelt thanks, but be posted on the web (http://www.redbrick.dcu.ie/~noel/distutils), so that others will not have the same problem. A method that will work for both Python 2.3 and 2.4 would be the most appreciated.
You should use the newest Python version (2.4.2) to build the installer. Thomas
At 01:58 PM 12/8/2005 +0000, Noel O'Boyle wrote:
Can someone suggest how I can write a setup.py for a pure-Python application that should install on both Linux and Windows?
The application includes a startup script, a package, and some data files (or package data) referred to by some modules in the package.
The Linux version will be distributed as a source distribution. The Windows version will be distributed as a bdist_wininst, and should create a shortcut in the Start Menu folder.
An answer will not only receive my heartfelt thanks, but be posted on the web (http://www.redbrick.dcu.ie/~noel/distutils), so that others will not have the same problem. A method that will work for both Python 2.3 and 2.4 would be the most appreciated.
---------contents of development directory setup.py README MANIFEST.in license.txt src/ startupscript.py mypkg/ __init__.py module_a.py help.html images/ shamrock.png
Regards, Noel
If your question is how to include the data files, you can do it by adding something like: package_data = {'mypkg': ['*.html', 'images/*.png']}, to your setup() call. See: http://python.org/doc/2.4.1/dist/node11.html for documentation. If you want to do this with Python 2.3, however, you'll need to either use setuptools, or write a custom extension to the distutils install_data command, as the Python 2.3 distutils don't support the package_data option (which was originally developed in setuptools and then added to the 2.4 distutils).
participants (3)
-
Noel O'Boyle
-
Phillip J. Eby
-
Thomas Heller