Skip to content

Include Python development headers #530

@Jackenmen

Description

@Jackenmen

Describe the Enhancement

Currently, the buildpack does not contain Python development headers which makes it hard to install any Python packages implemented in C that don't provide wheels for the platform. One such package is psycopg2 which purposefully doesn't provide source distribution to allow usage of system's own libraries on production systems.

In order to see the problem, you can run these commands:

git clone https://github.com/paketo-buildpacks/samples
cd samples/python/pip
echo "psycopg2==2.9.5" >> requirements.txt
pack build pip-sample --buildpack paketo-buildpacks/python --builder paketobuildpacks/builder:full

which results in an error about missing Python headers:

      ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
       #include <Python.h>
                ^~~~~~~~~~
      compilation terminated.

Possible Solution

Include development headers in appropriate environments (potential candidates: CPATH, CPPPATH, PKG_CONFIG_PATH, INCLUDE_PATH) or symlink them into one of the default include directories (not sure that will work properly).

Motivation

The lack of development headers makes it hard to install any Python packages implemented in C (C extensions) that don't provide wheels for the platform. One such package is psycopg2 which purposefully doesn't provide source distribution to allow usage of system's own libraries on production systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    📝 Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions