473,978 Members | 5,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

distutils - how to get more flexible configuration

Hello

I'm writing a package that has cgi-bin scripts, html
files and data files (templates used by cgi scripts).
I find that using distutils in the standard way
does not give me enough flexibilty, even if I use
a setup.cfg.

For example, I want certain data files to go to
markedly different locations.

However, I have come up with a solution, that looks
like it will work for me, and I'd welcome comments.

Here's the MANIFEST file
===
setup.py
myproj_cfg.py
data/wibble.txt
data/wobble.txt
===

And here's the setup.py file I've written
===
from distutils.core import setup
import myproj_cfg

data_files = [
(myproj_cfg.wib ble, ['data/wibble.txt']),
(myproj_cfg.wob ble, ['data/wobble.txt']),
]

setup(data_file s=data_files)
===

The user is asked to create a myproj_cfg.py file,
which might look like
===
wibble = '/wibble'
wobble = '/wobble'
===

And when a distribution is created and installed
we get
===
$ python setup.py install
running install
running build
running install_data
creating /wibble
copying data/wibble.txt -/wibble
creating /wobble
copying data/wobble.txt -/wobble
===

This is an example of what I want. I'd welcome
your comments.

--
Jonathan Fine
The Open University, Milton Keynes, England
Mar 7 '07 #1
0 941

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2268
by: PenguinOfDoom | last post by:
For whatever reason, distutils does not change file permissions of stuff in data_files in core.setup and neither does it allow specifying these permissions. The CVS repository I am using assigns permissions for files it downloads to 640. When distutils installs that, and I try to use the application, things obviously go boom. Right now, I'll probably have to resort to an os.chmod call in the setup script. Shouldn't data_files be more...
3
1991
by: Isaac Jones | last post by:
Hello Python Community. I bring greetings from the Haskell community (http://www.haskell.org) ;) There has been a lot of discussion of late about creating a grand-unified build & distribution system for "3rd party" Haskell libraries (those not distributed with the compilers). Python's Distutils has come up a few times. The Haskell Library Infrastructure Project's web page is just a wiki page which can be found here:...
15
4136
by: Colin J. Williams | last post by:
The distutils download page has: -------------------------------------------------------- Current stable release The current stable release is Distutils 1.0.2; you can download it as: * Distutils-1.0.2.tar.gz (source distribution) (233k) * Distutils-1.0.2.zip (source distribution) (274k) * Distutils-1.0.2.win32.exe (Windows installer) (187k)
1
1728
by: Terry Hancock | last post by:
Some time ago, I got the idea that I wanted to build image resources from vector graphic originals, instead of marshalling hundreds of tiny little icon images by hand. I wrote "BuildImage" to do this for me, and so far, it works very well, so I'm trying to make it easier to use and available to more developers. There is a brief (and somewhat dated) tutorial explaining what BuildImage itself does at:
1
2167
by: George van den Driessche | last post by:
Hi folks, I'm looking at packaging a project I'm working on using distutils. The project is for Windows and contains a COM server which needs registration, so the installer needs to be a little more complicated than usual. Looking at the options for the bdist_wininst command to distutils, I see it's possible to specify --install-script=<myinstallscript> which ought to do the trick. But to use this, myinstallscript itself must first be...
3
1498
by: mg | last post by:
Hello I work on an finite element framework and Python bindings have been developped. Actually, we use Boost.Build as build system but we would like to change it. We have two kinds of problems. First, the framework is used for generate pure C++ applications with static libraries ; second, the framework have some dependencies to fortran projects.
2
2676
by: RickMuller | last post by:
I really appreciate the ease that the distutils make distributing Python modules. However, I have a question about using them to distribute non-Python (i.e. text) data files that support Python modules. Currently when I have data of this type, I parse it into python objects and make a python module from it. In other words, given a data file like % cat grocery_list.txt eggs spam
7
4312
by: vedrandekovic | last post by:
Hello again, Is there any patch for python "distutils", for this ImportError: cannot import name log Regards, Vedran
1
4096
by: David Cournapeau | last post by:
Hi, I am trying to make numpy build with python 2.6 on windows, and it has been a bumpy road. Building with MS tools works OK, but building with mingw is still problematic. The problems are linked to manifest, and msvcr versions issues. Here is my understanding and how far I got: - python 2.6 is built with VS 2008, and msvcr 9: numpy has to be built against the exact same runtime to work. - msvcr 9 is not publicly available on most...
0
10179
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11836
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11433
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11596
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6426
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.