Skip to content

Hatch installed project without error but dependencies can't be imported #1288

Answered by manuel-koch
manuel-koch asked this question in Q&A
Discussion options

You must be logged in to vote

Looks like the following does the trick, editing the project.toml of a lib

from

[tool.hatch.build.targets.sdist.force-include]
"../src/my_sandbox_lib" = "src/my_sandbox_lib"

[tool.hatch.build.targets.wheel]
packages = ["src/my_sandbox_lib"]

to

[tool.hatch.build.targets.sdist.force-include]
"../src/my_sandbox_lib" = "my_sandbox_lib"

[tool.hatch.build.targets.wheel.force-include]
"../src/my_sandbox_lib" = "my_sandbox_lib"

Afterwards the import error from above is gone and the cli tool can happily import my_sandbox_lib and my_sandbox_lib_addon.
I've updated my example repo to reflect the patch.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@manuel-koch
Comment options

Answer selected by manuel-koch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant