Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore attribute value #222

Open
ozobotnovako opened this issue Apr 17, 2024 · 0 comments
Open

Ignore attribute value #222

ozobotnovako opened this issue Apr 17, 2024 · 0 comments

Comments

@ozobotnovako
Copy link

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.

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

No branches or pull requests

1 participant