Hi all,
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
are considered.
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?
Cheers,
Tim
--------------------------------------------------------------
Tim Docker timd(a)macquarie.com.au
Quantative Applications Division
Macquarie Bank
--------------------------------------------------------------
qad16:qad $ ls -l lib/python/
total 110
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
total 30
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
Hi there,
In the lxml project (http://codespeak.net/lxml), we've just noticed the
following problem with lxml eggs: you can easy_install an egg that won't
work for your Python.
This is because Python can be compiled with either 2 or 4 bytes unicode
as its internal representation. Any egg that contains compiled C code
that uses unicode such as lxml will run into trouble: if it's compiled
with a 4 bytes unicode Python, it won't work on a 2 bytes unicode
Python, and vice versa.
This problem is fairly common in Linux. Many distributions such as
Ubuntu and Fedora compile their python with 4 bytes unicode internal
representation. If you compile a Python interpreter by hand it defaults
to 2 bytes unicode, however. Hand-building a Python interpreter is done
fairly commonly by Linux sysadmins for various reasons.
It would therefore be very nice if it became possible to make eggs for
the different unicode compilation options of Python. This configuration
dimension is a real world issue for any binary Python module that does
anything with unicode text..
In an earlier mail to this list:
http://mail.python.org/pipermail/distutils-sig/2005-October/005222.html
M.-A. Lemburg and Phillip Eby had the following discussion:
[MAL]
>>Please make sure that your eggs catch all possible
>>Python binary build dimensions:
>>
>>* Python version
>>* Python Unicode variant (UCS2, UCS4)
>>* OS name
>>* OS version
>>* Platform architecture (e.g. 32-bit vs. 64-bit)
[PJE]
>As far as I know, all of this except the Unicode variant is captured in
>distutils' get_platform(). And if it's not, it should be, since it
>affects any other kind of bdist mechanism.
I'm not sure whether this means this needs to be escalated from
setuptools to the Python interpreter level itself. With this mail, I've
done the job escalating this lxml problem to what appears to be the
right place, though. :)
Thanks,
Martijn
Hello,
I have created a setup.py file for distirbution and I bumped into
a small bug when i tried to set my name in the contact field (Tarek Ziadé)
Using string (utf8 file):
setup(
maintainer="Tarek Ziadé"
)
leads to:
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/register.py",
line 162, in send_metadata
auth)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/command/register.py",
line 257, in post_to_server
value = unicode(value).encode("utf-8")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10:
ordinal not in range(128)
Using unicode:
setup(
maintainer=u"Tarek Ziadé"
)
leads to:
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py",
line 1094, in write_pkg_file
file.write('Author: %s\n' % self.get_contact() )
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position
18: ordinal not in range(128)
I would propose a patch for this problem but i don't know what would be the
best input (i guess unicode
for names)
Regards
Tarek
--
Tarek Ziadé | Association AfPy | www.afpy.org
Blog FR | http://programmation-python.org
Blog EN | http://tarekziade.wordpress.com/
I'm using zc,buildout to manage the development of a very simple web
application. I'd like to have a simple test runner that runs my
doctests, but have run into a slight problem. I'm using
wsgi_intercept to aid in testing, but unfortunately wsgi_intercept
isn't a proper Python package ("yet", according to Titus). So I have
a package-i-fied version in my svn repository and in my buildout.cfg I
specify:
develop = . ./wsgi_intercept_
I initially was using the "interpreter" option to get a Python
interpreter with my eggs on the path, and running "./bin/python
setup.py test". That, however, required me to list wsgi_intercept as
a package requirement, when I really want to list it as a testing
requirement. Moving it to a testing requirement caused it's develop
egg not to be on the PYTHONPATH, so setuptools tries to find it.
Which it couldn't.
I tried using zc.recipe.testbrowser, thinking that maybe it'd look at
the tests_require for the target eggs, but no such luck. The
testrunner also seems pretty promiscuous in looking for things to test
(it tries to import my eggs directory and test them which predictably
doesn't work), but that's another story.
So... any suggestions on using zc.buildout along with testing
dependencies (generally or with zc.recipe.testrunner)?
Thanks,
Nathan
Well, easy_install makes it snap to install packages that I may or may
not use. Nothing is easier than to 'easy_install something-recently-announced',
even if I never will use it (after a preliminary look). Often I forget to
uninstall the packages again, or promise to do that later. Disk space is cheap.
However, I found that with the ~20 eggs that I have installed the startup time
of the Python interpreter (Python2.5, WinXP, measured with 'timeit python -c ""')
rises considerably - 2.5 times slower.
This only occurs when the eggs are listed in the easy_install.pth file; if they
are moved into a 'normal' pth file this slowdown does not occur, although I can
still import the eggs fine.
I assume the additional time is spent by setuptools looking up entry points or
whatever? And that this additional processing is not needed for the eggs that
do not provide entry points? Or are not *using* setuptools themselves?
If this is true, wouldn't it be possible to skip the processing for those
eggs?
IMO this is a critical problem of easy_install... (Imaging how the installed and
possibly never used eggs pile up).
Thomas
Hi again. I mentioned this a long time ago, but I'd like to talk about
it again: I'd really like to remove workingenv's monkeypatching of
setuptools. There's still just two things:
* Removing easy_install's check of site.py (easy_install.install_site_py).
* Changing the way scripts are created (using python -S and then
changing the path).
An option I could put in distutils.cfg for changing script creation
would work great (since workingenv installs its own distutils.cfg).
Maybe something that points to a function, and that function is passed
the normal script text and then modifies it. Or just wraps
get_script_header's text (that's what I'm currently doing).
For setuptools' site.py, it would be nice if I could put a bit of text
in there that indicates that it does everything setuptools' site.py does
(at least as much as I choose to do -- no finding the system site.py in
my case). Maybe something like __setuptools_setup_version__ = '0.6c6',
or 'setuptools_site_py_hash = "xxxxx"', where that's an md5 hash of the
setuptools' site.py that it was based on. Or something.
This would substantially reduce the amount of annoying hacks in
workingenv. And the script stuff would be useful in zc.buildout as well.
--
Ian Bicking | ianb(a)colorstudy.com | http://blog.ianbicking.org
Hi guys,
I have a particular problem which I think we'll see a lot more of going
forward. Zope 3 is in the process of being eggified, and we have eggs in
the cheesehop of things like zope.component 3.4.0a1.
I use zc.buildout to configure a Zope instance (a zope 2.10 one, to be
precise) which has the various zope.* packages in non-egg-format in
$INSTANCE_HOME/lib/python/zope/*.
Then I'm depending on a package which does this:
install_requires=['setuptools',
''zope.component',
'zope.interface',
'zope.schema',
],
The problem is that even though I know I have zope.component 3.3 from my
Zope instance, setuptools/buildout doesn't know that and tries to
resolve the dependency. It succeeds with Zope 3.4's zope.component,
which then causes runtime conflicts and subtle problems all over the place.
I think what I need is some way of saying "all of these dependencies are
already resolved, don't try to get them as new eggs". Is that possible?
Is there another way I can manage this?
Martin
At 12:50 PM 4/26/2007 -0500, Kumar McMillan wrote:
>On 2/9/07, Phillip J. Eby <pje(a)telecommunity.com> wrote:
>>At 09:29 AM 2/9/2007 -0500, Tres Seaver wrote:
>> > > Using "|" as a separator for ORing TurboGear's requirements might look
>> > > something like this (ignoring version numbers for simplicity):
>> > >
>> > > install_requires = [
>> > > "SQLObject | SQLAlchemy",
>> > > "Kid | Genshi",
>> > > ],
>> > > extras_require = {
>> > > "fancy_tb": ["Paste"],
>> > > }
>> >
>> >+1 for the pipe symbol: to my eye, it means "pick the first of these",
>> >which is what you want.
>>
>>It's also implementable; the tuple concept isn't. Eggs' requirements get
>>stored in text files, so there has to be a pure-text representation possible.
>
>[blast from the past]
>I'd like to use ORed requirements in a setup file but I don't see what
>version of setuptools this was introduced in. Does anyone know?
No, because it hasn't been done yet. :) I merely said it was
implementable (in principle).
Note that any project using this format won't be compatible with 0.6
versions of setuptools and will cause them to fail installation with
parsing errors, unless there is some way to keep the alternatives hidden
from older parsers.
On Thu, 2006-12-14 at 07:15 +0100, Elvelind Grandin wrote:
> Perhaps I wasn't totally clear. what I meant was something like this.
>
> extras_require = {
> "default" : ["SQLObject==bugfix,>=0.7.1dev-r1860,<=0.7.99"],
> "future" : ["Genshi>=0.3", "SQLAlchemy>=0.3"]
> },
That may be ok for the example, but what happens if you add another
extra "foo" for some optional feature. Installing "TurboGears[foo]"
won't select either the "default" or "future" extras, so you don't
really get all the requirements.
>From a semantic perspective I think listing these as "extras" is odd.
One of either SQLObject or SQLAlchemy is required for installation, so
it's not just an "extra" feature. I think extras have been used for
this as a workaround to setuptools not supporting ORed requirements, but
I'd like to see that fixed. I tend to think in terms of Debian packages
where stuff like SA or SO would be listed as "depends" meaning that
they're strictly required, so in setuptools this would correspond to
"install_requires". On the other hand I believe Paste is still an
optional package used in TurboGears for stuff like the interactive
traceback display, so it'd be a Debian "recommends", or setuptools
"extras".
Using "|" as a separator for ORing TurboGear's requirements might look
something like this (ignoring version numbers for simplicity):
install_requires = [
"SQLObject | SQLAlchemy",
"Kid | Genshi",
],
extras_require = {
"fancy_tb": ["Paste"],
}
Setuptools would check if either SQLObject or SQLAlchemy was already
installed, if not it'd try from left to right until it successfully
installed one of the requirements.
I suppose extras could still be used as aliases for something like the
"future" requirements to make it easier for users to install this set of
packages:
extras_require = {
"standard": ["Kid", "SQLObject"],
"future": ["Genshi", "SQLAlchemy"],
"fancy_tb": ["Paste"],
}
Alternatively tuples could be substituted to define ORed requirements
like:
install_requires = [
("SQLObject", "SQLAlchemy"),
("Kid", "Genshi"),
]
Comments?
-- Matt Good
> On 12/12/06, Matt Good <matt(a)matt-good.net> wrote:
> > On Tue, 2006-12-12 at 16:32 +0100, Elvelind Grandin wrote:
> > > Or use a magic extra name like "default" which is used if no other
> > > extra is selected.
> >
> > This doesn't really address the full issue, since there may be several
> > sets of alternative dependencies for different requirements.
> >
> > Following the TurboGears example it needs an ORM from "SQLObject or
> > SQLAlchemy" and a template engine from "Kid or Genshi". So it'd need
> > defaults for each, not just a single default.
> >
> > > On 12/11/06, Elvelind Grandin <elvelind(a)gmail.com> wrote:
> > > > Not really
> > > >
> > > > extras_require = {
> > > > 'PDF': ["ReportLab>=1.2", "RXP"],
> > > > }
> > > > extras_exclude = {
> > > > 'PDF': ["Foo"],
> > > > }
> > > >
> > > > might work. even if it's not that pretty.
> > > >
> > > > On 12/10/06, Phillip J. Eby <pje(a)telecommunity.com> wrote:
> > > > > At 08:28 PM 12/10/2006 +0100, Elvelind Grandin wrote:
> > > > > >Is there any way to exclude packages in extras_require as opposed to
> > > > > >just include them. In Turbogears we have Sqlobject in by default. but
> > > > > >if the extra "future" is used it should drop SO and install sqlalchemy
> > > > > >instead.
> > > > >
> > > > > Not currently, no. Do you have any suggestions as to how this might be
> > > > > spelled in the requirements API?
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > cheers
> > > > elvelind grandin
> > > >
> > >
> > >
> >
> >
>
>