Author patrick.andrew
Recipients eric.araujo, patrick.andrew, tarek
Date 2012-02-06.00:56:06
SpamBayes Score 3.657e-07
Marked as misclassified No
Message-id <1328489767.17.0.54463855625.issue13943@psf.upfronthosting.co.za>
In-reply-to
Content
From py-logilab-common 0.57.1 port for FreeBSD. No patches applied:


package init file './test/__init__.py' not found (or not a regular file)
Traceback (most recent call last):
  File "setup.py", line 170, in <module>
    install()
  File "setup.py", line 166, in install
    **kwargs
  File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/distutils/command/build_py.py", line 93, in run
    self.build_packages()
  File "/usr/local/lib/python2.7/distutils/command/build_py.py", line 372, in build_packages
    self.build_module(module, module_file, package)
  File "/usr/local/lib/python2.7/distutils/command/build_py.py", line 333, in build_module
    "'package' must be a string (dot-separated), list, or tuple")
TypeError: 'package' must be a string (dot-separated), list, or tuple
*** Error code 1

Stop in /usr/src/ports/devel/py-logilab-common.


This package's setup.py is auto-generating the packages list with the current working directory.


def get_packages(directory, prefix):
    """return a list of subpackages for the given directory"""
    result = []
    for package in os.listdir(directory):
        absfile = join(directory, package)
        if isdir(absfile):
            if exists(join(absfile, '__init__.py')) or \
                   package in ('test', 'tests'):
                if prefix:
                    result.append('%s.%s' % (prefix, package))
                else:
                    result.append(package)
                result += get_packages(absfile, result[-1])
    return result

...

packages = [modname] + get_packages(os.getcwd(), modname)

kwargs['packages'] = packages

setup(...
    **kwargs)

where modname is imported from __pkginfo__.py:
distname = 'logilab-common'
modname = 'common'


What's interesting is there is no explicit unicode string definition within this package list gerneration, yet the final packages list looks like:

['logilab.common', u'logilab.common.test', u'logilab.common.test.data', u'logilab.common.test.data.find_test', u'logilab.common.ureports']
History
Date User Action Args
2012-02-06 00:56:07patrick.andrewsetrecipients: + patrick.andrew, tarek, eric.araujo
2012-02-06 00:56:07patrick.andrewsetmessageid: <1328489767.17.0.54463855625.issue13943@psf.upfronthosting.co.za>
2012-02-06 00:56:06patrick.andrewlinkissue13943 messages
2012-02-06 00:56:06patrick.andrewcreate