-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
no hpy/__init__.py? #63
Comments
The original PR/discussion is this: #16 TL;DR: we need it to be a namespace if we want to distribute What is the problem you are experiencing? |
I didn't check but jtiai on irc said "looks like there is some kind of a bug in setup.py install". |
I'm not opposed to refactor/change things, but I'd like something more than that as a reason 😅 |
According to https://setuptools.readthedocs.io/en/latest/setuptools.html#namespace-packages, we're not doing the right thing. This docs says we must put an |
I think that that link refers to " So, I think we have two choices:
That said, I am fine with either solution, but I suggest we should ask to someone who knows more about this to get all the implications. |
@ncoghlan was one of the authors, maybe we could get a response or a referral to someone else who could help out. |
Since This also bring out a related issue; HPy currently relies quite heavily on setuptools and distutils, which is an approach the packaging community is actively moving away from. This is not an issue for proof-of-concept works (where I’m currently pretty occupied myself, but intend to try some modern packaging strategies on HPy itself, and the extensions it builds. HPy is an awesome project, and this is the best I can do to help. |
That would be awesome. Are there models of modern packaging strategies for building c-extensions you would recommend looking at for inspiration? |
Setuptools is actually a pretty good (the best?) choice for building the extension modules, since it contains a good amount of practically-working compiler and dependency introspection logic. Alternative build systems are unforauntately not very actively pursued afaik since The approach that may be beneficial is to create an interface to stand into |
Maybe we should take this offline, but just summarizing the rabbit hole your links sent me down:
There are probably more It is not clear to me how HPy would create an interface that would allow it to be used easily with all these tools. Here are a few examples of ways other projects interfacing compiled code have dealt with this:
|
@uranusjr thank you for your feedback, your help will surely be welcome. However, I am not sure to understand what is the exact problem you are trying to solve (which doesn't mean that the problem does not exist of course). In
If I understand it correctly (and I'm not sure), (1) is all we need for "modern" installation tools. The fact that we also support (2) and (3) is a convenience but should not harm anyone. Another thing to keep in mind is that we want to make the transition from |
I should have provided more context from the beginning 🙂 I wrote the initial comment mainly to answer the namespace module question (no, don’t bother with A common subtext around most recent development in Python packaging is to avoid the coupling (both build-time and run-time) to the distutils/setuptools stack. This is actually kind of analogous to what HPy aims to improve—there are certain things the default stack (CPython for HPy, distutils/setuptools for packaging) does not do well, and we want to provide alternatives to solve those issues. But the interface the default stack provides is not adequate for alternatives to implement, so we want to introduce better abstractions for people to more easily interface with multiple solutions. HPy’s current build system has a hard dependency on distutils and setuptools, and interfaces with them in a way alternative packaging tools cannot reuse. This means those solutions cannot support building HPy extensions without rewriting most of the tool stack. So what I’m trying to solve is to look into possible improvements in this area early on, to avoid HPy becoming another thing that prevents people from using alternative packaging solutions. |
sounds good to me. Note that it's already partly like that, because most of the logic is inside Feel free to come to the IRC channel and/or write to the mailing list and/or open an issue to discuss more concrete details. |
It seems to break the GitHub Actions (see #467) and harms users on macOS v12, v13, v14. |
Is there a reason for why there is no
hpy/__init__.py
file, turning hpy into a "namespace"? Apparently that triggers a bug in "setup.py install" that seems not to handle this properly. I'd vote for avoiding namespaces if setuptools doesn't reliably support them.The text was updated successfully, but these errors were encountered: