Accept src/<NAMESPACE>/<NAME> layouts in wheel builder by default
Currently hatch wheel builder autodetects packages in directory layouts shown on https://hatch.pypa.io/1.11/plugins/builder/wheel/#default-file-selection
For my package with src/NAMESPACE/NAME layout I had to manually configure hatch. If it is possible, could hatch also detect those layouts as part of the heuristic?
I'm still looking through the code to find the location this might be handled at, so I could prepare a PR.
Is this a possible solution?:
https://github.com/kohlrabi/hatch/commit/597d5feefa2647c8f8f7e6f27c0d28a3cf0d054f
How did you make it work by configuring hatch? For me, it only works if I organize my files as <NAMESPACE>/<NAME>/__init__.py and configure hatch by setting wheel.packages. It never works if I put the package files under src. (I'm using hatch through uv)
How did you make it work by configuring hatch? For me, it only works if I organize my files as
<NAMESPACE>/<NAME>/__init__.pyand configure hatch by setting wheel.packages. It never works if I put the package files undersrc. (I'm using hatch throughuv)
I also have this problem - I'm also using hatch through uv, via pixi build.
The OP in https://github.com/pypa/hatch/issues/1894 says it should be sufficient to set packages = ["src/<NAMESPACE>"] in the [tool.hatch.build.targets.wheel] table, but I cannot make it work. Could this be an uv issue then?
@RBerga06 I'm also using uv + hatch, and the [tool.hatch.build.targets.wheel] works for me
https://github.com/karlicoss/pymplate/blob/6db0f7c2cc402d844d038554d30246f418772493/pyproject.toml#L40-L53
Ok, I just tried again from scratch and now it works; I probably had something misconfigured or a typo somewhere. Thanks for the help and sorry for the confusion!