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

Allow dictionary content control via keyword list #25

Merged
merged 2 commits into from May 2, 2022
Merged

Conversation

redmie
Copy link
Contributor

@redmie redmie commented Mar 10, 2022

This will allow macro users to control the content of the build dict if they want to.
Default macro usage is not affected (backward compatibility).

Changes (from commit):

  • Update README.md on how to customize your dictionary
  • Make macro invoke itself recursively to control what is added to the
    dictionary

- Update README.md on how to customize your dictionary
- Make macro invoke itself recursively to control what is added to the
dictionary
src/lib.rs Outdated Show resolved Hide resolved
pyo3_built!{$py, $info, "build", "time", "deps", "features", "host", "target"}
};
// Custom build
($py: ident, $info: ident, $($i:tt ),+ ) => {{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if making $i a literal instead of a token-tree here would work? This could help debugging.

Remove "intro" and "finish" identifiers and inline their contents
in the custom build pattern
@redmie
Copy link
Contributor Author

redmie commented Apr 7, 2022

Thank you all for the review!

I followed @adamreichold advice and inlined the "into" and "finish" code in the custom build pattern.

@althonos I didn't manage to make things work with the literal rust macro type, do you have advice on how I could proceed?

@althonos
Copy link
Member

althonos commented May 2, 2022

Okay I tried what I had in mind and it didn't work so I'll merge the way it is. Thanks for your contribution!

@althonos althonos merged commit cd43cad into PyO3:main May 2, 2022
@redmie redmie deleted the main branch April 10, 2024 09:17
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.

None yet

3 participants