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
So, there won't be any package management tool shipped with Python 2.7
and users will have to download and install `setuptools` manually as
"search" -> "download" -> "unzip" -> "cmd" -> "cd" -> "python
Therefore I still propose shipping bootstrap package that instruct
user how to download and install an actual package management tool
when users tries to use it. So far I know only one stable tool -
`easy_install` - a part of `setuptools` package.
The required behavior for very basic user friendliness:
1. user installs Python 2.7
2. user issues `python -m easy_install something`
3. user gets message
'easy_install' tool is not installed on this system. To make it
available, download and install `setuptools` package from
4. the screen is paused before exit (for windows systems)
Other design notes:
1. if package tries to import `easy_install` module used for
bootstrap, it gets the same ImportException as if there were no
`easy_install` at all
2. bootstrap module is overwritten by actual package when users installs it
So, do we need a PEP for that? How else can I know if consensus is
reached? Anybody is willing to elaborate on implementation?
P.S. Please be careful to reply to relevant lists
On Mon, Mar 29, 2010 at 9:37 AM, Tarek Ziadé <ziade.tarek(a)gmail.com> wrote:
> 2010/3/29 anatoly techtonik <techtonik(a)gmail.com>:
>> It is really hard to follow. You should at least change subjects when
>> switching topic.
> I was talking about the work going on and the decisions taken lately.
> I never change topics of threads mails when there's less than 100 mails,
> because I find it way more confusing :)
>> So, what is the verdict? Will there be a package management tool or
>> bootstrap package for it shipped with Python 2.7 or not?
> As I said in the mail you've quoted, all improvements are made in
> Distutils2. So the answer is no.
> Python 2.7b1 is due in less than a week anyways, so any new
> development on this topic will happen after.
> Basically Python 2.7 == Python 2.6 in term of packaging.
> Tarek Ziadé | http://ziade.org
On Mon, 22 Mar 2010 at 21:25:55, "Martin v. L?wis" <martin(a)v.loewis.de> wrote:
> As this might be an interesting puzzle to solve, I'd like to pose it to
> the entire distutils-sig readership. So here is the problem again:
> As a batch file, my attempt at having a batch file that is also a
> Python script was to write it as
> %1 %0
> <python code here>
> This should have been run with argv being the path to the Python
> interpreter. As a batch file, the first line is a comment, the second
> line runs Python, anbd the third line terminates the script (so it
> doesn't consider the following lines). As a Python script, the first
> block is a variable assignment, followed by the regular Python script.
> Now (as Installer won't run batch files) we need the same as VBScript
> (or, failing that, as JScript). The script would be computed at the time
> of MSI generation.
I couldn't get this to work as VBScript (that requires too many line
continuation characters), but I think the following JScript should
work. The call to WShell.Run() pops another window, so I included a
time.sleep() call to make that slow enough to notice. Fortunately
JScript and python both will happily ignore integer and string
literals at the beginning of the file, and JScript comments look like
python floor division. I ran this at the command line like so:
C:\>cscript bdist.js "Python26\python.exe"
Here's the script:
4 // 3; '''
if (WScript.Arguments.Count() < 1)
WScript.Echo("usage: " + WScript.ScriptName + " <path to python>");
WScript.CreateObject("WScript.Shell").Run(WScript.Arguments.Item(0) + " " +
WScript.ScriptFullName, 1, true); /*
# start of python script
from time import sleep
print("hello from python")
# end of python script */
-----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-----
Having problems here with the above.
The thing is that there should be two projects installed on the same
server, but the one is a zope KGS 3.4 the other is a
The two have different version requirements for setuptools and
The buildout.cfg comes from the web like this:
buildout -t 2 -c http://mypypi.org/++projects++/proj/proj-stage-0.0.4.cfg
(On top of that this is driven by keas.build, but that should not
Buildout (1.4.1) is installed via easy_install and setuptools (0.6c9).
Therefore the message "Not upgrading because not running a local
buildout command". The message is reasonable, but still makes problems
in the way of making the one of the projects non-installable.
Would not it be easy to create a bin/buildout script and restart with
Or is there any other sane solution for this (that I missed)?
Adam GROSZER mailto:email@example.com
Quote of the day:
Before Xerox, five carbons were the maximum extension of anybody's ego.
The code in bootstrap.py doesn't use the if __name__ == "__main__" idiom.
This can lead to funny behaviour if it is imported for some reason (I
stumbled upon this in conjunction with nose).
Is there a reason for not checking for __name__ == "__main__", or should
this be changed?
Am Stadtgarten 28, 45276 Essen, Germany
Phone: +49 1577 170 7363
I've sent a mail after Pycon to request some comments on the work we
have done during Pycon but I had no feedback at all :)
I realize that this piece of work is quite dense, and hard to follow.
(As a reminder the draft is here:
I propose to make it a PEP on its own, and to reduce the scope of PEP
376 to what is contains already. This new PEP will be an extension to
the work done in PEP 376 and will not really interfer : the new piece
of work might add a new file in the egg-info directory, but the rest
of the work is elsewhere. (in sysconfig)
Then I propose to focus on PEP 376, and to go ahead and try to have it
accepted before the first beta of Python 2.7.
So basically, PEP 376 defines a directory containing the metadata of
an installed package, and all information about the files installed.
The goal is to provide some APIs in pkgutil, in order to query what's
installed. In other words, add in Python's stdlib what setuptools
provides with pkg_resources.
So what about starting a new round of comments on this PEP, keeping
in mind that all the unsolved issues about resource files are being
worked out in the other document ?
There's one thing I would like to comment : Someone at Pycon asked me
why the structure was called "PROJECT_NAME.egg-info". After explaining
to him the historical reasons, I realized that there's no benefits at
all to keep this name:
- we've removed the python version from the name of the directory
- we stated that the new APIs will not recognize the old formats
- any existing software that want to use the new format will have to
change its code anyways, and a name change don't really add more work.
So I am proposing to replace "egg" by "pkg". For example:
I am also proposing to change the name of the file "PKG-INFO" into
"METADATA" to stay consistent, because that's what it is.. :
With these definitions:
- pkg-info directory : information about a Python software package
that is installed on the system
- METADATA file: PEP 345 file about a Python software package that
is installed on the system
Any comment on this ? Or on anything else on PEP 376 ?
Tarek Ziadé | http://ziade.org