Skip to content

Custom .pth in dev mode with relative paths #1755

Answered by schussda
schussda asked this question in Q&A
Discussion options

You must be logged in to vote

I implemented the build hook for initialize so that a foo_dev.pth file with absolute paths is created dynamically. This works.
Then i added force_include_editable to pyproject.toml:

[tool.hatch.build.targets.wheel.force-include]
"foo.pth" = "foo.pth"

[tool.hatch.build.targets.wheel.force_include_editable]
"foo_dev.pth" = "foo.pth"

=> I install the project via uv pip install -e PATH inside the shell of another hatch project
=> wheel.force-include is always used, wheel.force_include_editable is ignored, what i am may doing wrong?

edit:
I tried patching the build_data["force_include"] in the initialize method. This works with pip but with uv the .pth file is messed up, looks like uv does thi…

Replies: 1 comment 2 replies

Comment options

ofek
Oct 14, 2024
Maintainer Sponsor

You must be logged in to vote
2 replies
@schussda
Comment options

@schussda
Comment options

Answer selected by schussda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants