[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: private modules and dh_python2



On Jun 10, 2011, at 09:48 PM, Eike Nicklas wrote:

>Then 'import foo' fails if '/usr/share/foo/foo' is not explicitly added
>to pythonpath (that was the idea of having the module private
>in the first place ;-) )

Ah, yeah.  Y'know, I am personally not a fan of private modules anyway :).
Note too in a setuptools(?)/distribute/packaging world, you might not actually
have a `foo` script in the source at all.  For example, Mailman 3 has this in
its setup.py:

template = Template('$script = mailman.bin.$script:main')
scripts = set(
    template.substitute(script=script)
    for script in ('mailman', 'runner', 'master', 'onebounce')
    )
setup(
    ...
    entry_points    = {
        'console_scripts' : list(scripts),
        },
    ...)

so in fact /usr/bin/mailman doesn't exist until the system is built out.
/usr/bin/mailman gets generated and essentially imports the
`mailman.bin.mailman` module, then runs the main() function.

-Barry

Attachment: signature.asc
Description: PGP signature


Reply to: