This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.moore
Recipients alexis, eric.araujo, paul.moore, tarek
Date 2011-10-12.22:35:19
SpamBayes Score 7.2908346e-13
Marked as misclassified No
Message-id <1318458920.54.0.0914338083355.issue13162@psf.upfronthosting.co.za>
In-reply-to
Content
I am trying to create a pysetup package that contains a precompiled binary extension, which can be installed without compiling, by using the resource file feature of setup.cfg. This may be incorrect usage of pysetup, but at a minimum, a proper error message should be given rather than a traceback.

With a directory containing an extension hello.pyd plus the following setup.cfg file:

[metadata]
name = hello
version = 0.1
author = Paul Moore
author-email = p.f.moore@gmail.com
summary = Test C extension

[files]
resources =
    hello.pyd = {platlib}

I get a traceback when I do pysetup install:

PS D:\Data\python-sample\bin> pysetup install
Installing from source directory: 'D:\\Data\\python-sample\\bin'
running install_dist
running build
running install_data
running install_distinfo
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\METADATA
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\INSTALLER
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\REQUESTED
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\RESOURCES
Traceback (most recent call last):
  File "D:\Data\cpython\lib\runpy.py", line 160, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "D:\Data\cpython\lib\runpy.py", line 73, in _run_code
    exec(code, run_globals)
  File "D:\Data\cpython\lib\packaging\run.py", line 666, in <module>
    sys.exit(main())
  File "D:\Data\cpython\lib\packaging\run.py", line 653, in main
    return dispatcher()
  File "D:\Data\cpython\lib\packaging\run.py", line 642, in __call__
    return func(self, self.args)
  File "D:\Data\cpython\lib\packaging\run.py", line 91, in wrapper
    return f(*args, **kwargs)
  File "D:\Data\cpython\lib\packaging\run.py", line 164, in _install
    return not install_local_project(target)
  File "D:\Data\cpython\lib\packaging\install.py", line 122, in install_local_project
    return _run_install_from_dir(path)
  File "D:\Data\cpython\lib\packaging\install.py", line 160, in _run_install_from_dir
    func(source_dir)
  File "D:\Data\cpython\lib\packaging\install.py", line 87, in _run_packaging_install
    dist.run_command('install_dist')
  File "D:\Data\cpython\lib\packaging\dist.py", line 709, in run_command
    cmd_obj.run()
  File "D:\Data\cpython\lib\packaging\command\install_dist.py", line 506, in run
    self.run_command(cmd_name)
  File "D:\Data\cpython\lib\packaging\command\cmd.py", line 330, in run_command
    self.distribution.run_command(command)
  File "D:\Data\cpython\lib\packaging\dist.py", line 709, in run_command
    cmd_obj.run()
  File "D:\Data\cpython\lib\packaging\command\install_distinfo.py", line 112, in run
    writer.writerow(row)
TypeError: 'str' does not support the buffer interface

If this configuration is invalid a better error message should be given. However, I would also like to know what (if any) would be the correct way of writing a setup.cfg file to install a compiled extension like this.

For background on why I am trying to do things in this (odd) way, see the python-dev thread starting at http://mail.python.org/pipermail/python-dev/2011-October/113956.html
History
Date User Action Args
2011-10-12 22:35:20paul.mooresetrecipients: + paul.moore, tarek, eric.araujo, alexis
2011-10-12 22:35:20paul.mooresetmessageid: <1318458920.54.0.0914338083355.issue13162@psf.upfronthosting.co.za>
2011-10-12 22:35:19paul.moorelinkissue13162 messages
2011-10-12 22:35:19paul.moorecreate