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

refactor: add extension_kwargs kwargs and nitpicky stuff #3

Merged
merged 4 commits into from
Nov 18, 2024

Conversation

tlambert03
Copy link
Member

While playing with spatial-graph, I found that I wanted the ability to pass define_macros to the Extension object... so this - adds **extension_kwargs: Any to the compile_module signature

while doing that, I, erm... got carried away and did all the nitpicky stuff that I would have eventually wanted to do, including:

  • adding type hints to everything and enable strict mypy
  • use dynamic single-sourced versioning from git tags
  • add a couple rules for ruff, importantly including isort
  • avoid private imports from Cython
  • embellished docstrings and cleaned up formatting (went with numpy out of habit/preference, but if you want to go back to rst format we can do that)
  • minor adjustments to the compile_module function itself for brevity/clarity.

cc @funkey

@tlambert03 tlambert03 changed the title refactor: add kwargs and nitpicky stuff refactor: add extension_kwargs kwargs and nitpicky stuff Nov 7, 2024
pyproject.toml Outdated Show resolved Hide resolved
@funkey
Copy link
Member

funkey commented Nov 18, 2024

Holy cow, witty got totally talleyed!

This is great, thanks for making this a better library ❤️

I have just one request: please add yourself to the list of authors if that's okay with you :)

@funkey
Copy link
Member

funkey commented Nov 18, 2024

And a question: should the module hash now also depend on extension_kwargs? And if so, should we do the same for extra_{compile,link}_args?

I am leaning towards yes, since both can change the resulting binary.

@tlambert03
Copy link
Member Author

And a question: should the module hash now also depend on extension_kwargs? And if so, should we do the same for extra_{compile,link}_args?

yes, I'm afraid it should. Which is a little annoying 😂 ... lemme do that

@tlambert03 tlambert03 merged commit 148c715 into funkelab:main Nov 18, 2024
17 checks passed
@funkey
Copy link
Member

funkey commented Nov 19, 2024

Splendid, thanks a lot!

@tlambert03 tlambert03 deleted the add-kwargs branch November 19, 2024 19:34
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.

2 participants