Hi all --
at long last, I have fixed two problems that a couple people noticed a
* I folded in Amos Latteier's NT patches almost verbatim -- just
changed an `os.path.sep == "/"' to `os.name == "posix"' and added
some comments bitching about the inadequacy of the current library
installation model (I think this is Python's fault, but for now
Distutils is slavishly aping the situation in Python 1.5.x)
* I fixed the problem whereby running "setup.py install" without
doing anything else caused a crash (because 'build' hadn't yet
been run). Now, the 'install' command automatically runs 'build'
before doing anything; to make this bearable, I added a 'have_run'
dictionary to the Distribution class to keep track of which commands
have been run. So now not only are command classes singletons,
but their 'run' method can only be invoked once -- both restrictions
enforced by Distribution.
The code is checked into CVS, or you can download a snapshot at
Hope someone (Amos?) can try the new version under NT. Any takers for
BTW, all parties involved in the Great "Where Do We Install Stuff?"
Debate should take a good, hard look at the 'set_final_options()' method
of the Install class in distutils/install.py; this is where all the
policy decisions about where to install files are made. Currently it
apes the Python 1.5 situation as closely as I could figure it out.
Obviously, this is subject to change -- I just don't know to *what* it
Greg Ward - software developer gward(a)cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
I've been aware that the distutils sig has been simmerring away, but
until recently it has not been directly relevant to what I do.
I like the look of the proposed api, but have one question. Will this
support an installed system that has multiple versions of the same
package installed simultaneously? If not, then this would seem to be a
significant limitation, especially when dependencies between packages
Assuming it does, then how will this be achieved? I am presently
managing this with a messy arrangement of symlinks. A package is
installed with its version number in it's name, and a separate
directory is created for an application with links from the
unversioned package name to the versioned one. Then I just set the
pythonpath to this directory.
A sample of what the directory looks like is shown below.
I'm sure there is a better solution that this, and I'm not sure that
this would work under windows anyway (does windows have symlinks?).
So, has this SIG considered such versioning issues yet?
Tim Docker timd(a)macquarie.com.au
Quantative Applications Division
qad16:qad $ ls -l lib/python/
drwxr-xr-x 2 mts mts 512 Nov 11 11:23 1.1
-r--r----- 1 root mts 45172 Sep 1 1998 cdrmodule_0_7_1.so
drwxr-xr-x 2 mts mts 512 Sep 1 1998 chart_1_1
drwxr-xr-x 3 mts mts 512 Sep 1 1998 Fnorb_0_7_1
dr-xr-x--- 3 mts mts 512 Nov 11 11:21 Fnorb_0_8
drwxr-xr-x 3 mts mts 1536 Mar 3 12:45 mts_1_1
dr-xr-x--- 7 mts mts 512 Nov 11 11:22 OpenGL_1_5_1
dr-xr-x--- 2 mts mts 1024 Nov 11 11:23 PIL_0_3
drwxr-xr-x 3 mts mts 512 Sep 1 1998 Pmw_0_7
dr-xr-x--- 2 mts mts 512 Nov 11 11:21 v3d_1_1
qad16:qad $ ls -l lib/python/1.1
lrwxrwxrwx 1 root other 29 Apr 10 10:43 _glumodule.so -> ../OpenGL_1_5_1/_glumodule.so
lrwxrwxrwx 1 root other 30 Apr 10 10:43 _glutmodule.so -> ../OpenGL_1_5_1/_glutmodule.so
lrwxrwxrwx 1 root other 22 Apr 10 10:43 _imaging.so -> ../PIL_0_3/_imaging.so
lrwxrwxrwx 1 root other 36 Apr 10 10:43 _opengl_nummodule.so -> ../OpenGL_1_5_1/_opengl_nummodule.so
lrwxrwxrwx 1 root other 27 Apr 10 10:43 _tkinter.so -> ../OpenGL_1_5_1/_tkinter.so
lrwxrwxrwx 1 mts mts 21 Apr 10 10:43 cdrmodule.so -> ../cdrmodule_0_7_1.so
lrwxrwxrwx 1 mts mts 12 Apr 10 10:43 chart -> ../chart_1_1
lrwxrwxrwx 1 root other 12 Apr 10 10:43 Fnorb -> ../Fnorb_0_8
lrwxrwxrwx 1 mts mts 12 Apr 10 10:43 mts -> ../mts_1_1
lrwxrwxrwx 1 root other 15 Apr 10 10:43 OpenGL -> ../OpenGL_1_5_1
lrwxrwxrwx 1 root other 33 Apr 10 10:43 opengltrmodule.so -> ../OpenGL_1_5_1/opengltrmodule.so
lrwxrwxrwx 1 root other 33 Apr 10 10:43 openglutil_num.so -> ../OpenGL_1_5_1/openglutil_num.so
lrwxrwxrwx 1 root other 10 Apr 10 10:43 PIL -> ../PIL_0_3
lrwxrwxrwx 1 mts mts 10 Apr 10 10:43 Pmw -> ../Pmw_0_7
lrwxrwxrwx 1 root other 10 Apr 10 10:43 v3d -> ../v3d_1_1
I'm wondering what the state of play is with the following branches:
What more needs to happen for these to get merged to trunk and a release
-----BEGIN PGP SIGNED MESSAGE-----
I have a Python package called 'munepy' <https://launchpad.net/munepy> which
provides yet another flavor of enums. I'm working on the code for various
reasons and I thought I'd take the opportunity to learn how to support both
Python 2 and 3 from the same code base.
I've updated the code so that it supports Python 2.6 at a minimum, and made it
'python -3' clean. I've switched it from using setuptools to using
distribute. I was looking at this page:
and it seems very cool that distribute can help make my life easier by
allowing me to support both Python 2 and 3 from the same code base. I set
use_2to3=True in my setup.py and indeed
% python3 setup.py test
(On Ubuntu 9.10) runs 2to3 over my .py files. However, my doctests are in
separate .txt files and I cannot seem to get the right incantation for
In the root of my source directory, my doctest lives at
munepy/docs/README.txt, so I put this in my setup.py:
use_2to3 = True,
convert_2to3_doctests = [
but I never see that the README.txt is ever 'fixed'. Indeed, the test fails
because of a syntax error when the doctest tries to print something using
Python 2 syntax. I'm clearly not using this setup argument correctly, but I
can't tell where I'm going wrong.
How do you use convert_2to3_doctests?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
-----END PGP SIGNATURE-----
At 06:29 PM 1/23/2010 +0100, Tarek Ziadé wrote:
>2010/1/23 P.J. Eby <pje(a)telecommunity.com>:
> > At 01:00 PM 1/23/2010 +0100, Tarek Ziadé wrote:
> >> 3 - dir_util, archive_util and file_util are going to be removed in
> >> favor of calls to shutil.
> > By removed, do you simply mean that distutils will stop using them, but the
> > modules will still be there? (i.e., deprecated and phased out, rather than
> > simply dropped from existence altogether.)
>I'll use the same strategy than sysconfig :
>- if the API is just moved to another place and works exactly the same way
> (e.g. like what's planned for make_archive), it will be dropped, and the
> documentation will refer to the new place.
Is this the standard procedure for relocation of stdlib APIs across
I was under the impression that the standard is to do such things
across two release cycles with a deprecation.
please note that i released my first python module in C++, it can be found
It would be great if somebody could take a look at the setup script and give
me some feedback on recommended / necessary changes.
First, allow me to apologize in advance if this isn't the right place
for this question. I found this mailing list from the distribute docs,
but I'm not sure that it's a general support mailing list.
I've read through the distribute docs and either something isn't working
correctly or my understanding is off. I created a virtualenv using the
--distribute flag and annotated my setup.py file with the call to
use_setuptools(). I passed the install_requires argument to setup(),
including the impossible-to-install-via-easy_install package numpy. My
understanding was that distribute uses pip instead of the stock
easy_install, but this does not appear to be the case because "python
setup.py install" still fails to install numpy, dying with the same
exception that easy_install always throws. I tried a simple "pip install
numpy" and it worked, as expected.
Am I missing something? Was distribute never meant to use pip over
easy_install? Is there someway to flag a package as "
--single-version-externally-managed"? Am I pretty much doomed in the
case of wanting to handle the numpy dependency via setup.py?
I originally posted this in Stackoverflow:
Here's my buildout.cfg:
parts = ... pyrtm ...
develop = . parts/pyrtm
eggs = pyrtm
recipe = mercurialrecipe
repository = http://bitbucket.org/srid/pyrtm
Assume that `pyrtm' has a release on PyPI, but I don't wish to use that.
What I want here is to use the pyrtm from hg repository directly in my
current project. This means:
1/ if I do "import pyrtm", it should use the pyrtm in the local checkout
(not from pypi release)
2/ Automatically fetch the dependencies (install_requires) of pyrtm when
I run bin/buildout. (otherwise, pyrtm wouldn't work. doh!)
The above buildout.cfg does none of the above. How do I make it work as
Note that `pyrtm' actually does not have any dependencies and I used it
as an example only (In actuality, I want to rely on an internal package
that has several installation requirements).
Lennart originally suggested the "develop =" syntax which, as shown
above, does not work. Any ideas?
i'm not sure if this is the preferred way to get help. If it is not, can you
then please tell me how?
I write a C++ extension module in which i need to tell if i compile on Linux
or Windows. What is the preferred way to do this?
Also, i use libjpeg, libtiff and libpng. Can i portably test for presence and
version of these libs on Linux, Windows and other OSes?
The documentation on docs.python.org is quite good, but are there some
additional examples available?
Thanks for any hints,