pybind / pybind/pybind11-stubgen

Feature Request: Improve error message for "can't find enum" warning

Open
#247 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The def finalize(self): method in RewritePybind11EnumValueRepr is a bit confusing.

I wish it explained why it couldn't automatically locate the "enum class location". I'd prefer not to have to hardcode the --enum-class-locations argument in the build yml.

Update: It seems that my issue is related to an enum containing a "None_" value. It works when that value is commented out in the bindings, but fails when the value is included in the Enum.

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 def finalize(self) method in RewritePybind11EnumValueRepr and reproduce the warning using bindings with an enum value named None_. Compare the behavior with that value commented out. Done means the warning explains why the enum class location cannot be found without requiring a hardcoded --enum-class-locations argument.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.