Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build environment with skip-install=false and dev-mode=true #1927

Open
yonting opened this issue Mar 7, 2025 · 0 comments
Open

Build environment with skip-install=false and dev-mode=true #1927

yonting opened this issue Mar 7, 2025 · 0 comments

Comments

@yonting
Copy link

yonting commented Mar 7, 2025

I got a problem with making a custom build that needs the project to be installed for the build. Is this possible?

If the project makes library my_project then I need my_project library in my hatch_build.py.

I thought I would be able to configure hatch-build environment

# file: pyproject.toml
...
[tool.hatch.envs.hatch-build]
skip-install = false
dev-mode = true

[tool.hatch.build.targets.custom]
path = "hatch_build.py"

and then have hatch_build.py like

# file: hatch_build.py
from my_project import *

...

But running hatch build -t custom gives ModuleNotFoundError: No module named 'my_project' so it doesn't look like the library got installed. I made an example repo (attached). It look like also that the build environment is named my-project-build?

https://github.com/yonting/hatch-example

hatch-example-main.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant