-
Notifications
You must be signed in to change notification settings - Fork 49
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
Colcon fails to build valid PEP 517 projects #208
Comments
I tried implementing this, but realized that PEP-517 doesn't specify and pip doesn't implement installing pyproject.toml projects in editable mode. I'm opting not to move forward until editable mode can be cleanly implemented to support |
I can try to work on this... |
Re: editable mode, there's PEP-660 and |
So... for today, I could only hope to get Meanwhile, I think that non-editable installs can be made generic using the |
New enough pip now supports PEP-517 in editable mode, but that requires the built tool to export |
I was able to craft 2 packages that
I think this is good enough wrt. editable installs via |
@dimaqq How is it going? Can I assist in any way? |
@baszalmstra sorry I don't have time to actively work on this right now. Good news, there's a Someone needs to make a PR against this repo. My plan was to:
|
Kunal says:
|
I'm very interested in this too— I agree that it should in principle be possible to implement this as a separate plugin that detects However, given that those tools can also handle conventional Outside of implementation choices, there's also a deeper question about how much work colcon should be doing around dependency awareness— like, if I have two poetry projects with a dependency between them (A -> B) in the same colcon workspace, is that something we'd expect colcon to actually handle, eg arranging for A at runtime to "see" B? If so, what would be the mechanism for it to work? Certainly thinking about how Poetry manages a centralized pool of venvs in Thinking more about some of the reasons someone might want to use Poetry with ROS in the first place, its philosophy of separate per-project venvs might actually be a feature rather than a bug— imagining instead a workspace containing A -> [email protected] and B -> [email protected], it could be quite desirable that the Poetry-created executables for A and B internally set their |
I've just made my The long term plan is to switch It should be noted that these extensions implement colcon as a "build frontend", so we aren't wrapping pip or any of the other build frontends and aren't coupled to any of their behaviors and limitations. This should allow use of any build backend, though I've only tested poetry, setuptools, and flit. One scenario that isn't 100% supported yet is using a build backend that is built as part of the same colcon workspace itself. I've been toying with introducing a build backend for Ament, and while colcon is able to bootstrap that package itself, we can't flesh out the full dependency graph without first having built the build backend package, so there is a bootstrapping problem. If you build the backend in a separate workspace, the problem goes away. I'm sure there are other limitations to my current approach, but that one is worth calling out. re: dependency awareness - my implementation continues colcon's pattern of being aware of only the dependencies which are part of the colcon workspace. To use the prototype package on a plain python project, it needs only be installed. To use it on ROS packages, you need to modify the Since my internal efforts to get some testing done on these extensions have largely stalled, I'd appreciate any testing that you or anyone else can provide. Once we've settled on the general architecture, we can move the work to a PR against I'm open to a synchronous discussion or demo on this work if it sounds helpful. In general, I'm much more optimistic than I was previously, but there are certainly still sharp edges here that we need to address, possibly as documentation and announcements. |
@cottsay Ahh, awesome, thanks so much for sharing this work! I will definitely dig into it a bit when I have a moment to provide more thoughtful feedback. Looks like your approach builds wheels as an intermediate step, and therefore doesn't have a story for develop/editable mode? I believe Poetry at least does now allow direct editable installs, and I see you've got some seemingly-unused stuff related to editable in the hook_caller file, but I'm not fully following that as I probably don't have a grasp on how you're actually interfacing to the underlying build tool. It does sound like there might still be room here for a Poetry-specific plugin that does let Poetry do some of its dependency- and lockfile-handling magic. My specific interest in Poetry for this (other than it being generally terrific) is because of how it can allow individual repos to spec their Python dependency versions and avoid having to manage that globally at the distribution/package-manager layer. And as a secondary concern, Poetry has a very nice story for integrating with Nix via I think it would likely come down to something like letting colcon handle in-workspace dependencies, and then having Poetry observe those on the colcon-managed Anyway, there are enough questions here that I probably need to crawl into my cave and do a little experimenting before submitting a more concrete proposal. |
Right, this is mentioned in the TODO section of the README.md. I simply haven't implemented the hook yet. Per the PEPs, we should fall back to a non-editable install if the backend doesn't implement the editable hooks. I intend for this scenario to be supported.
I'm all for enabling new scenarios, but if we're going to pay the performance costs associated with adherence to the new APIs, we should reap the benefits and not couple ourselves to a single backend. As great as Poetry may be, I'd like to make sure I'd like to encourage anyone playing in this space to read the PEPs and understand where the responsibilities of the backend and frontend meet. A lot of the features you're discussing here are frontend features and many are even listed as explicitly out-of-scope for colcon's core packages: https://colcon.readthedocs.io/en/released/developer/design.html#explicitly-out-of-scope |
We'll be discussing this topic at the Infrastructure Community Meeting on May 17: https://discourse.ros.org/t/infrastructure-community-meeting-2023-05-17/31268 |
I've issued a Call For Testing on a prototype package based on the PEPs discussed here: https://discourse.ros.org/t/call-for-testing-standards-based-python-packaging-with-colcon/32008 If you're interested in seeing support for modern package layouts, please take a moment to provide feedback. |
As mentioned on colcon/colcon-ros#66 , colcon fails to build valid python packages that use pyproject.toml. This includes packages that want to use a setup.cfg without a corresponding setup.py.
The text was updated successfully, but these errors were encountered: