@@ -117,9 +117,7 @@ def find_packages(self) -> t.Iterable[str]:
117117
118118 # Package paths in hatchling are always relative to the project root, so we join
119119 # with the project root (not self.path, which is the sources root).
120- package_path = str (os .path .join (
121- self .builder_config .root , relative_package_path
122- ))
120+ package_path = str (os .path .join (self .builder_config .root , relative_package_path ))
123121 if not os .path .isdir (package_path ):
124122 continue
125123
@@ -157,17 +155,24 @@ def path(self) -> str:
157155 """
158156 root = self .builder_config .root
159157
158+ # If no sources are configured, we assume the sources root is the project root
160159 if not self .builder_config .sources :
161160 return root
162161
163- # No "" key. The keys themselves are source directories (e.g. "localstack-core/").
164- # Filter out any empty-string key that slipped through , strip trailing separators.
165- source_dirs = [ k .rstrip ("/" ) for k in self .builder_config .sources .keys () if k ]
162+ # The keys themselves are source directories (e.g. "localstack-core/").
163+ # Filter out any empty-string keys , strip trailing separators.
164+ source_dirs = { k .rstrip ("/" ): v for k , v in self .builder_config .sources .items () if k }
166165 if len (source_dirs ) == 1 :
167- return os .path .join (root , str (source_dirs [0 ]))
166+ source_dir , dest_dir = next (iter (source_dirs .items ()))
167+ if dest_dir :
168+ LOG .warning (
169+ "plux doesn't know how to resolve sources with non-empty destination directories, using root dir."
170+ )
171+ else :
172+ return os .path .join (root , str (source_dir ))
168173
169174 if source_dirs :
170- LOG .warning ("plux doesn't know how to resolve multiple sources directories" )
175+ LOG .warning ("plux doesn't know how to resolve multiple sources directories, using root dir. " )
171176 return root
172177
173178 def filter_packages (self , packages : t .Iterable [str ]) -> t .Iterable [str ]:
0 commit comments