pybind / pybind/pybind11-stubgen

How to integrate into a setuptools package?

Open
#104 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
361
Forks
75
PR merge metrics
No merged PRs in 30d

Description

I'm using the setuptools method to build/install my pybind11-based module. I'd like to integrate pybind11-stubgen into the setup.py, so it creates and installs the .pyi after the pybind11-based module is built. I tried to set up a post-install function using the setuptools.command.install override (cmdclass={'install': new_install}). But at this point, the wheel is built but the module is not installed yet - so when I run pybind11-stubgen, it will not find the module to annotate.

I don't know the Python packaging internals well enough, but this doesn't look like a very exotic problem to me, so maybe someone has already figured it out?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the setuptools method, the package's setup.py, and the setuptools.command.install override described in the issue. Determine when the built module becomes available to pybind11-stubgen, then verify that installation generates and installs the resulting .pyi file.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.