Skip to content

Document header dependencies for source distributions - #279

Merged
mattip merged 1 commit into
python-cffi:mainfrom
saitakarcesme:codex/document-header-build-dependencies
Sep 22, 2026
Merged

mattip merged 1 commit into
python-cffi:mainfrom
saitakarcesme:codex/document-header-build-dependencies

Conversation

@saitakarcesme

Copy link
Copy Markdown
Contributor

Document set_source(..., depends=[...]) for project-local headers and distinguish it from include_dirs. A header can be found when compiling in the working tree but be absent when a wheel is built from an sdist. The overview example now declares pi.h as a dependency and includes the project directory in the compiler search path.

Fixes #168, following the discussion's preference to document the existing setuptools keyword.

Validation: built a minimal CFFI project through sdist → wheel with the checked-out CFFI. Without depends, pi.h was absent from the tarball and compilation failed; with it, the wheel built successfully, installed, and its C function returned the expected result. Both cases used include_dirs=['.']. sphinx-build -W -b html doc/source doc/build/html and git diff --check pass.

Disclosure: documentation and build verification prepared using OpenAI Codex in an authorized automated contribution session.

@mattip
mattip merged commit 8a97fd4 into python-cffi:main Sep 22, 2026
38 checks passed
@mattip

mattip commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Thanks @saitakarcesme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: document use of 'depends' kwarg to include headers in setuptools call

2 participants