Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #12369 (reopened defect)

Opened 14 months ago

Last modified 8 weeks ago

Split python25 into python25-core and modules

Reported by: nirs@… Owned by: mww@…
Priority: Normal Milestone: Port Enhancements
Component: ports Version:
Keywords: Cc: raimue@…, nirs@…, mww@…, nox@…
Port:

Description

$ python2.5
Python 2.5.1 (r251:54863, Jul 29 2007, 14:28:00) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sha
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/lib/python2.5/sha.py", line 6, in <module>
    from hashlib import sha1 as sha
  File "/opt/local/lib/python2.5/hashlib.py", line 133, in <module>
    md5 = __get_builtin_constructor('md5')
  File "/opt/local/lib/python2.5/hashlib.py", line 60, in __get_builtin_constructor
    import _md5
ImportError: No module named _md5
>>> 

sha is important core module, many apps will break without it.

There was no problem with Python 2.5.0.

Environment: Mac OS X 10.4.8

Change History

Changed 14 months ago by nirs@…

Seems that it is caused by setup.py patch

 # This global variable is used to hold the list of modules to be disabled.
7	-disabled_module_list = []
8	+disabled_module_list = ["zlib","_hashlib","_ssl","_bsddb","_sqlite3","_tkinter","bz2","gdbm","readline","_curses","_curses_panel"]

The comment is quite useless - the variable name is self explaining. The comment should describe WHY these modules are disabled.

Why these modules are disabled?

Changed 13 months ago by nox@…

  • priority changed from Blocker to High
  • summary changed from ImportError when importing sha on Python 2.5.1 to BUG: ImportError when importing sha on Python 2.5.1
  • version 1.5.0 deleted
  • milestone set to Port Bugs

Changed 13 months ago by nox@…

  • cc nox@… added

Python _hashlib core module has been disabled in python itself because they are available through specific ports. As they should be core modules, I think their ports should be removed of the tree and reenabled in python25 portfiles.

The module ports are:

  • py25-zlib
  • py25-hashlib
  • py25-bsddb
  • py25-sqlite3
  • py25-tkinter
  • py25-bz2
  • py25-gdbm
  • py25-readline
  • py25-curses

Changed 13 months ago by nox@…

  • cc nirs@… added

I've added the reporter in the Cc list, at least, he will now he have to install py25-hashlib

Changed 12 months ago by raimue@…

  • cc raimue@… added

Tickets #11931, #12586, #12369 are duplicates describing the same issue. The resolution is to install py25-hashlib at the moment. As nox suggested we could also move this back into the main python25 port. How should we handle it?

Changed 12 months ago by nirs@…

Why these modules were made available as separate modules?

Changed 12 months ago by mww@…

  • status changed from new to closed
  • resolution set to wontfix

If all modules of python were to be activated, python would have dependencies on:

tcl, tk, openssl, db44, bzip2, ncursesw, zlib, gdbm, readline & sqlite3

Which is quite heavy if you just want a python interpreter (perhaps even unknowingly as a dependency). If someone is keen on having all these in a bundle, please create a 'python25-full' meta port which drags in all the py25-modules you think are important - including perhaps even more modules than come with the standard installation.

Changed 12 months ago by nirs@…

  • status changed from closed to reopened
  • resolution wontfix deleted

Python 2.5 port should be exactly the same as Python distributed from http://python.org. If you want to create a lightweight version, create a python-lite port that does not include these dependencies, and add proper docs how to get the missing components.

Changed 12 months ago by nox@…

...or just add proper docs on how to get the missing component in this port.

Changed 12 months ago by mww@…

  • status changed from reopened to closed
  • resolution set to wontfix

So what are the dependencies of the "same as the Python distribution"? Depends a lot on what exactly the configure-script finds, so the only deterministic solution is to provide everything.

People coming from e.g. FreeBSD would expect the python port to be exactly like it is - the FreeBSD ports also have a 'Python-lite standard' installation.

Also you totally ingored the fact that a "python-full" + python (like it is currently) would be compatible while your "python-lite" and "python-full" is NOT. You can only install one at a time, while you can "upgrade" from the current port to a "full" port.

If you're missing the docs: This is an open project, so feel free to join and provide them. It was not clear to me that people w/o a FreeBSD background would not find out themselves whats the current state.

Changed 12 months ago by nirs@…

Well this is the problem, not many users have FreeBSD background and do not expect to get python25-lite and additional ports. Any user that use previous MacPorts versions expect a full Python port.

What the problem in having the same port as python24? Did anyone complained about 2.4 being too big?

I already submitted a patch to add docs to the port 2 month ago.

If you think that the docs are missing, why did you close this bug?

Changed 12 months ago by mww@…

  • priority changed from High to Normal
  • milestone changed from Port Bugs to Port Enhancements

I think this is a misunderstanding: "docs" is the abbreviation for "documentation" and I assumed you wanted the behavior of python25 documented, which is btw. the same as python 2.4 (see py-bsddb, py-tkinter, etc.). I assumed you wanted to add some lines to the wiki or have a post-install message about modules that are a good idea to install, too.

Anyway, to come to a solution: You want a "full" size port while I think a slim port with extras is more reasonable. We can get both what we want if you just create a "python25-with-extras" port (I dont care about the name). If I just bloat the main port, it is not possible anymore to have a slim installation (because an additional python25-lite port would conflict with the python25 port).

So why dont you just create a "python25-full" port so everybody can get what they want?

Changed 12 months ago by nirs@…

Python 2.5 is documented now, but was not documented when this bug was reported. However, the docs are not accessible enough. You need online docs, accessible from the ports tool.

I'm not sure why python2.5 can not work like python24, which does not require separate ports to get basic functionality like md5 to work. I'm also not convinced that there is a need for slim python25 port. but I don't have time to research this myself now.

About practical solution in your direction, how about this:

1. Rename python25 to python25-core 2. Add python25 port that depends on python25-core and all those py25-xxx dependencies

I should have time to work on this in 2-3 of weeks.

Changed 6 months ago by matt macports@…

  • status changed from closed to reopened
  • resolution wontfix deleted

+1 for nirs's python25 / python25-core split

This makes it much easier for end-users to "port install python25" and be able to follow standard instructions for installing software not packaged in MacPorts. Packagers on the other hand have a deeper understanding of the dependencies of their app and can choose python25-core + the few extra packages they need instead of pulling in all of the Python libs.

Changed 5 months ago by justin1@…

This is going get a lot more attention soon because of Google's App Engine. The GAE development server forbids importing C extensions, so _hashlib is blocked with MacPorts, causing lots of problems with the server.

Changed 8 weeks ago by raimue@…

  • summary changed from BUG: ImportError when importing sha on Python 2.5.1 to Split python25 into python25-core and modules
Note: See TracTickets for help on using tickets.