@@ -81,6 +81,7 @@ class HatchlingPackageFinder(PackageFinder):
8181 Uses hatchling's BuilderConfig abstraction to enumerate packages.
8282
8383 TODO: include/exclude configuration of packages in hatch needs more thorough testing with different scenarios.
84+ TODO: hatchling supports path rewrites with the sources config, which is currently not supported
8485 """
8586
8687 builder_config : BuilderConfig
@@ -116,9 +117,9 @@ def find_packages(self) -> t.Iterable[str]:
116117
117118 # Package paths in hatchling are always relative to the project root, so we join
118119 # with the project root (not self.path, which is the sources root).
119- package_path = os .path .join (
120+ package_path = str ( os .path .join (
120121 self .builder_config .root , relative_package_path
121- )
122+ ))
122123 if not os .path .isdir (package_path ):
123124 continue
124125
@@ -150,8 +151,6 @@ def path(self) -> str:
150151 *contains* the top-level packages (not the project root in general).
151152
152153 Hatchling's ``sources`` dict maps ``{source_dir: dest_dir_in_wheel}``:
153-
154- - ``{"": "src"}`` — explicit src-layout: source root is ``src/``
155154 - ``{"localstack-core/": ""}`` — packages in a subdirectory: source root is
156155 ``localstack-core/`` (the key, not the value)
157156 - ``{"": ""}`` — packages directly in the project root
@@ -161,16 +160,11 @@ def path(self) -> str:
161160 if not self .builder_config .sources :
162161 return root
163162
164- source_root = self .builder_config .sources .get ("" )
165- if source_root :
166- # Explicit mapping: "" -> "src" (or similar). The value is the source dir.
167- return os .path .join (root , source_root )
168-
169163 # No "" key. The keys themselves are source directories (e.g. "localstack-core/").
170164 # Filter out any empty-string key that slipped through, strip trailing separators.
171165 source_dirs = [k .rstrip ("/" ) for k in self .builder_config .sources .keys () if k ]
172166 if len (source_dirs ) == 1 :
173- return os .path .join (root , source_dirs [0 ])
167+ return os .path .join (root , str ( source_dirs [0 ]) )
174168
175169 if source_dirs :
176170 LOG .warning ("plux doesn't know how to resolve multiple sources directories" )
0 commit comments