-
Notifications
You must be signed in to change notification settings - Fork 54
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 "wheel.packages" to take a dictionary instead of an array? #669
Comments
I don't quite follow how this doesn't work with having |
What I want is for my repo to have files like |
Ohh, now I understand. Quite unintuitive to navigate, and I am not sure if tools like |
This is supported by setuptools (https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#package-discovery-and-namespace-packages) and coverage.py already supports rewriting paths to map between repo copies of files and installed copies (for example for tox/nox environments). It is not how I would advocate doing things for a traditional Python package, but as I say, in this case where I have what is mainly a C++ repo with some Python bits hanging off the side, I really want the |
I would not use the inline form, as TOML 1.0 doesn't allow multiline inline tables. I think it's doable, though there are several things that probably need care, like making sure editable installs map correctly. Before jumping in, though, I'd like to know what hatchling supports here - if you could do it via force-include, for example, maybe supporting that would make sense. |
Hatchling supports this via force-include, so I think we should add that before considering this. |
I'll reconsider this, since force-include will actually be tricker than expected to implement, and won't be able to match hatchling's syntax anyway. This might be simpler for many use cases. I'll look into it soon to see if it might be a good idea. |
For editable installs, the outer-most package name needs to match the new name, so this is what it would look like, sound reasonable? This can also be a table, allowing full customization of where a source package [tool.scikit-build.wheel.packages]
mypackage = "python/src/mypackage" But you can also do more complex moves: [tool.scikit-build.wheel.packages]
"mypackage/subpackage" = "python/src/subpackage" |
This is an implementation of #669. --------- Signed-off-by: Henry Schreiner <[email protected]>
My company has a collection of Python packages that are distributed as namespace packages under a single master package name (for reasons, don't ask). Some of those packages are mainly C++ with some Python bindings and I would like to use a source layout that looks something like:
I can use the current
wheel.packages
option but then I have to add in folders for the master package and the package name inside the python folder (src/python/$COMPANY_NAME/$PACKAGE_NAME/
) which feels like a lot of folders for no very good reason. If we allowedwheel.packages
to be a dictionary, then presumably I could specify something like:or inline as
I haven't really looked at how this part of the code is implemented, so I don't know how hard it would be to make this change. It falls under a "nice to have" rather than "really important" label for me, so I would have a go if it is mainly a matter of adapting the input from the toml file into the internal representation, but if it requires a wholesale rewriting of the internal path machinery then probably not worth it. @henryiii, perhaps you could comment on that?
The text was updated successfully, but these errors were encountered: