-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
Multiple Build Targets #1876
Comments
Are there any documented examples of what this looks like in the wild? |
Oh I see, you mean multiple custom targets. In that case you would create only the |
Ah, thank you. Seems like I have opened a duplicate for #1669. Do I still need the |
You could define that yes but the main reason it exists is because sometimes you want to extend an existing builder which requires an import and then automatic detection does not work. I would recommend the version approach and only have a dedicated builder class. Currently there is no environment variable populated that indicates the current target & version so I don't think you would have a way to determine. That exists in a branch somewhere that I working on actually but I've been very busy. |
Ok, thank you so much, this was incredibly helpful! I will look into pushing some docs on this in the future if that is something you would find valuable. One last question, how would I just inject custom build config into that callable that the |
For static config use TOML e.g. |
Maybe needs a new issue, but it doesnt look like |
Ah after looking at the source code it seems that the Is modifying what happens in a build based on the version something you are interested in supporting? I would be happy to hack on that if possible, I am new to this project but it doesnt seem like a huge lift given the interfaces are so mature |
@ofek here is a working example of what I am attempting to accomplish -- note that versions are not respected with |
Is it possible to specify multiple build targets, or is it better practice to have multiple pyproject.toml files? I basically have a use case where I want
[tool.hatch.buiild.targets.foo]
with a custom configuration and similarly for a[tool.hatch.buiild.targets.bar]
, I want to have a different custom configuration.The text was updated successfully, but these errors were encountered: