Skip to content

Ignore attribute value #222

@ozobotnovako

Description

@ozobotnovako

For module-level attributes with constant values such as

 m.attr("changeset") = py::str(VC_CHANGESET);
 m.attr("built") = py::str(BUILD_DATE);

the corresponding generated lines in the stubfile look like the following

changeset: str = '1234567890123'
built: str = '2024-01-01 00:00'

I'd like to see a way to disable writing the values and using just the typing labels, similar to this

changeset: str
built: str

The problem I'm having is relevant for CI checks. I wanted to run the stub generation and check diff on the CI to verify the interface did not change. However, if one of these variables change with each build (e.g., the build time), the stub also changes on every build.

Is there any way how to implement this now? If there isn't, I suggest adding an option passed to the script, that would only generate the labels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions