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

Porting example for the documentation #246

Merged
merged 46 commits into from
Oct 19, 2022
Merged

Conversation

hodgestar
Copy link
Contributor

@hodgestar hodgestar commented Oct 9, 2021

The aim is to document the following porting steps:

  • Start with a module that uses the old C API
  • Switch to an HPy legacy module
  • Slowly port methods to HPy one by one
  • Switch to a pure HPy module once the port is complete

Todo:

  • unit tests of each step (so that the example doesn't silently stop being up to date)
  • write documentation of what happens in each step
  • some lightweight tooling for keeping the steps up to date (it turns out showing the diffs is not that useful)

The built documentation for this PR can be viewed here: https://docs.hpyproject.org/en/feature-porting-example/porting-example/

hodgestar and others added 30 commits February 10, 2021 17:26
This avoids package autodetection from the wrong directory.
- remove HEAD_INIT
- remove "m_" name prefixes
@hodgestar hodgestar changed the title WIP: A porting example for the documentation Porting example for the documentation Sep 23, 2022
@hodgestar
Copy link
Contributor Author

Ready for review!

@mattip
Copy link
Contributor

mattip commented Oct 18, 2022

I will be hosting a short session next week for an internal company (Quansight) meetup. Is there a chance to get this reviewed so I can use it?

@mattip
Copy link
Contributor

mattip commented Oct 18, 2022

Since it passes tests, maybe we can merge after a cursory review and then fix-up any inaccuracies later

@fangerer
Copy link
Contributor

Is there a chance to get this reviewed so I can use it?

Sure, sorry, I just missed that it is ready for review. Will do the review tomorrow.

@fangerer fangerer self-requested a review October 18, 2022 14:59
Copy link
Contributor

@fangerer fangerer left a comment

Choose a reason for hiding this comment

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

Very nice example, thank you @hodgestar .
As announced, I'll rebase your branch on master and resolve the conflicts (if you don't mind) since it is mostly due to my changes.

docs/porting-example/index.rst Outdated Show resolved Hide resolved
docs/porting-example/index.rst Outdated Show resolved Hide resolved
docs/porting-example/steps/step_02_hpy_legacy.c Outdated Show resolved Hide resolved
docs/porting-example/index.rst Outdated Show resolved Hide resolved
docs/porting-example/index.rst Outdated Show resolved Hide resolved
docs/porting-example/steps/step_02_hpy_legacy.c Outdated Show resolved Hide resolved
@mattip mattip merged commit cd8ee7a into master Oct 19, 2022
@mattip
Copy link
Contributor

mattip commented Oct 19, 2022

Thanks @hodgestar and @fangerer. If there are problems I missed, they can be touched up in subsequent PRs. I think this will really help new users understand more about HPy.

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.

6 participants