pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/42071: lang/python26 should install _elementtree module
>Number: 42071
>Category: pkg
>Synopsis: lang/python26 should install _elementtree module
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Sep 15 22:30:00 +0000 2009
>Originator: Brian de Alwis
>Release: pkgsrc-current, MacOSX 10.5.8
>Organization:
>Environment:
Darwin chiclet.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT
2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
>Description:
As discussed on pkgsrc-users@netbsd, the ElementTree package for Python has
been incorporated into the Python distribution as of 2.5. The patch attached
below corrects the broken xml.etree.cElementTree left by the lang/python2[56]
packages.
Background: our lang/python2[56] packages disable certain modules during the
build and install process. Essentially a full install is performed *except*
for the actual shared libraries corresponding to the disabled modules. That
is, the Python source code for to those modules *is* installed by the
python2[56] packages. The shared libraries are instead built and installed by
accompanying packages. For example, textproc/py-expat installs the special
_expat.so module. This module disabling is presumably to minimize the
dependencies of the python package.
The ElementTree package, and its C-optimized module called cElementTree,
provides enhanced support for processing XML files. Python 2.5 and 2.6 now
ship with ElementTree and cElementTree, though the in-tree variants have been
moved from elementtree.* to xml.etree.*, and the cElementTree module has been
renamed to _elementtree. Currently the _elementtree module is disabled.
Although we have a textproc/py-elementtree package (which curiously doesn't
install the optimized cElementTree module), this package uses the original
packages and hence the original module names.
Unfortunately because of the renaming, simply installing the py-elementtree is
not sufficient to enable the _elementtree functionality.
Since the py-elementtree package must support lang/python2[34], we can't just
change py-elementtree to follow the EXTRACT_ELEMENTS approach used in py-expat.
We could add a py-celementtree with a CONFLICTS on py-elementtree.
But since _elementtree has no special dependencies, I propose we simply change
the lang/python2[56] packages to install the in-tree _elementtree module. The
py-elementtree package can be kept for Python 2.4 and 2.3; although
unnecessary, it does not conflict.
>How-To-Repeat:
$ cd .../pkgsrc/lang/python26
$ make install >/dev/null
$ cd ../../textproc/py-elementtree
$ make install >/dev/null
$ python2.6
Python 2.6.2 (r262:71600, Sep 15 2009, 17:50:32)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.etree.cElementTree
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/pkg/lib/python2.6/xml/etree/cElementTree.py", line 3, in <module>
from _elementtree import *
ImportError: No module named _elementtree
>>>
>Fix:
I propose that we remove the _elementtree module from the disabled module list
and install the full in-tree ElementTree. The py-elementtree can still be
installed if necessary for some other package; it won't conflict due to the
renaming.
(Note: this patch does assume the patch in pkg/42070 has been installed; simply
remove the "_sqlite3" otherwise)
=== modified file 'lang/python25/PLIST.common'
--- lang/python25/PLIST.common 2009-04-22 18:07:24 +0000
+++ lang/python25/PLIST.common 2009-09-15 22:26:07 +0000
@@ -1527,6 +1527,7 @@
lib/python${PY_VER_SUFFIX}/lib-dynload/_csv.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_ctypes.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_ctypes_test.so
+lib/python${PY_VER_SUFFIX}/lib-dynload/_elementtree.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_functools.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_hashlib.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_heapq.so
=== modified file 'lang/python25/distinfo'
--- lang/python25/distinfo 2009-09-09 16:06:22 +0000
+++ lang/python25/distinfo 2009-09-15 22:26:07 +0000
@@ -14,7 +14,7 @@
SHA1 (patch-aj) = a75d680a6b8b1ad3c9222dcb841f4fb10db6d16d
SHA1 (patch-ak) = 948362c15ad59abeef46971f9b870b70655a62c7
SHA1 (patch-al) = 6247e3f85d555bae7850befbd7bfffbb233cecb3
-SHA1 (patch-am) = f444bb78a0ca8ea3fa3435e5946c8d9251cb5102
+SHA1 (patch-am) = 78ac2f1ed9697df0098e748753204f6eeb1cd536
SHA1 (patch-an) = 17b4e17b3b562c29a050e9bb20447084ce82b8ab
SHA1 (patch-ao) = 9bbd5561c010e0a1ab8e0a70d27a5f77fd2089d2
SHA1 (patch-ap) = b864db92761c843a91374663bd2dbcfa57b317cf
=== modified file 'lang/python25/patches/patch-am'
--- lang/python25/patches/patch-am 2009-09-09 16:06:22 +0000
+++ lang/python25/patches/patch-am 2009-09-15 22:26:07 +0000
@@ -7,7 +7,7 @@
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
-+disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree",
"_sqlite", "_tkinter", "bsddb", "cjkcodecs" "gdbm", "mpz", "expat", "readline"]
++disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_sqlite",
"_tkinter", "bsddb", "cjkcodecs" "gdbm", "mpz", "expat", "readline"]
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
=== modified file 'lang/python26/PLIST.common'
--- lang/python26/PLIST.common 2009-08-19 21:09:46 +0000
+++ lang/python26/PLIST.common 2009-09-15 22:26:07 +0000
@@ -1681,6 +1681,7 @@
lib/python${PY_VER_SUFFIX}/lib-dynload/_csv.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_ctypes.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_ctypes_test.so
+lib/python${PY_VER_SUFFIX}/lib-dynload/_elementtree.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_fileio.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_functools.so
lib/python${PY_VER_SUFFIX}/lib-dynload/_hashlib.so
=== modified file 'lang/python26/distinfo'
--- lang/python26/distinfo 2009-09-15 21:33:49 +0000
+++ lang/python26/distinfo 2009-09-15 22:26:07 +0000
@@ -13,7 +13,7 @@
SHA1 (patch-aj) = a75d680a6b8b1ad3c9222dcb841f4fb10db6d16d
SHA1 (patch-ak) = 948362c15ad59abeef46971f9b870b70655a62c7
SHA1 (patch-al) = c39144cfa4a540900fac879b5faa990628fcee3e
-SHA1 (patch-am) = 1a008add276b56ef3c3fc4274466a918b00c465f
+SHA1 (patch-am) = ab0964f37a6c1a23c2cae5ba03fd678b622901bc
SHA1 (patch-an) = 17b4e17b3b562c29a050e9bb20447084ce82b8ab
SHA1 (patch-ao) = 9bbd5561c010e0a1ab8e0a70d27a5f77fd2089d2
SHA1 (patch-ap) = 39d81b01fa9e1b894be9ae0922881337bb4d17da
=== modified file 'lang/python26/patches/patch-am'
--- lang/python26/patches/patch-am 2009-09-15 21:33:49 +0000
+++ lang/python26/patches/patch-am 2009-09-15 22:26:07 +0000
@@ -7,7 +7,7 @@
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
-+disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree",
"_sqlite", "_sqlite3", "_tkinter", "bsddb", "cjkcodecs" "gdbm", "mpz", "expat",
"readline"]
++disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_sqlite",
"_sqlite3", "_tkinter", "bsddb", "cjkcodecs" "gdbm", "mpz", "expat", "readline"]
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
=== modified file 'textproc/py-elementtree/DESCR'
--- textproc/py-elementtree/DESCR 2008-01-09 15:38:08 +0000
+++ textproc/py-elementtree/DESCR 2009-09-15 22:26:07 +0000
@@ -4,4 +4,9 @@
The ElementTree toolkit contains an Element implementation in Python,
and code to read XML and HTML files into trees of Element objects, and
-write them out as XML.
+write them out as XML.
+
+The ElementTree toolkit has been incorporated into Python 2.5 and
+later. Although this package will co-exist with the installed version,
+as the shipped version has been prefixed with xml.etree.*, this
+package may be unnecessary for newer Python programs.
Home |
Main Index |
Thread Index |
Old Index