473,473 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Q: distutils - name clash protection?

Q: How do I make my setup procedure safe?
Q: How can I let users specify a different destination dir?

By now I think I have some useful modules I'd like to share. In "my
world" everything is centered around my name, therefor my stuff
typically lives in or beneath a package "mb". To use a module - for
example - I do:
from mb import mbsql
Following this approach a minimalistic setup.py looks like this:

#
# minimal setup.py
#
from distutils.core import setup
setup(name = "mbsql",
version="0.1.0",
packages = ["mb","mb.mbsql"],)

While this is fine in my little world I hate the idea that somebody
else gets unexpectedly and with no warning overwritten what maybe was
in his own "mb" package.

(1) There should be a check built into the sdist that issues as
warning ('mb' already exists - continue?).

(2) Or even better: If the user already has an existing "mb" package:
let him specify a name he likes, maybe "mbmbmb". For example some
tools I found on the web live in a package "SamRushing" on my
installation. And I like the according import statement for its
clarity:
from SamRushing import calldll


"distutils" is wonderful but a beast of its own if it comes to
customizing. I'd like to know:

Q: What's the best way to accomplish (1) and/or (2)?

Thank you very much,

mb - Martin Bless





Jul 18 '05 #1
3 1216

Martin> Q: How do I make my setup procedure safe?

Try picking something a bit more unique for a package name than "mb". How
about "mbless"?

Martin> Q: How can I let users specify a different destination dir?

Try:

python setup.py install --help

Skip
Jul 18 '05 #2
Repost, as only sent to op...

Am Montag, 26. Juli 2004 22:53 schrieb Martin Bless:
Q: How do I make my setup procedure safe?
Q: How can I let users specify a different destination dir?


Simple answer to both of the questions: there's no way to do this at the
moment. If you're interested in implementing something like this, read on PEP
262[1], and help me implement the necessary architecture...

I'm currently working on writing up a proposal myself (as PEP 262 doesn't go
quite as far as I would like it to go), and I've already written some code
which does what PEP 262 proposes (to have a database of installed modules)
and more (letting users specify a destination directory for the module,
having automatic support for user directories if you can't install the module
as root, etc.), but I'm not finished with yet...

Anyway, feel free to contact me if you're willing to help. Once the draft of
the "new" PEP is finished, I'll send it to python-dev, as I said last week;
it'll only be a matter of days now, as I'm currently in preparation for my
medicine exams this week and this weekend...

Heiko.

[1] http://www.python.org/peps/pep-0262.html
Jul 18 '05 #3
I went ahead and looked at 262 as this thread caught my eye and just wanted
to give my two cents: Might be a good idea to not define the format but
only the API? Or, at least to specify that while you may count on the API
you can not count on exactly how it is implemented? Why duplicate the work
done by a system's native package management system(s) if they store the
information you need? Though it would definitely be a powerful tool to
access this information through a standardized Python API, even for only
Python Packages.

Jul 18 '05 #4

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

Similar topics

0
by: Jorge Godoy | last post by:
Hi! For the following setup.py, I get this error: byte-compiling /var/tmp/bhsys-buildroot/usr/lib/python2.3/site-packages/bhsys/Impressao.py to Impressao.pyc byte-compiling...
1
by: Mathieu Malaterre | last post by:
Hello, I thought this would be easy but I guess I didn't get the distutil feeling. I am trying to write a setup for install my package but I don't understand how to do that. organisation: ...
1
by: Bengt Richter | last post by:
I'd like to override the default d:\Python23\Lib\site-packages\ destination, at least as an option. I have used installshield in the past, which gives extensive control over just about...
1
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...
0
by: Maarten Sneep | last post by:
I'm trying to build PyBison on Mac OS X, and I'm running into some problems with the distutils. Just for starters: PyBison requires Pyrex. This is not a problem, and Pyrex seems to work without...
2
by: Jerry He | last post by:
Hi, I was trying to build a C++ extension on Win32 with distutils. The extension worked on Cygwin but when I tried it with the Win32-build python, it complained that I don't have .NET Framework...
6
by: ajikoe | last post by:
Hello I tried to combine c++ and python together. So I follow from this website: http://kortis.to/radix/python_ext/ I have this code: # prmodule.c static PyObject *pr_isprime(PyObject *self,...
7
by: vedrandekovic | last post by:
Hello again, Is there any patch for python "distutils", for this ImportError: cannot import name log Regards, Vedran
12
by: Abhishek Mishra | last post by:
Hello Everyone, I have the habit of using domain names (of either the application or company) in reverse in package names. for e.g. com.spam.app1 I've recently started a project for an...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.