You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to request (and maybe even contribute) more integration options for PyApp.
Hatch right now only offers the scripts option, which is transforming your project scripts into a bunch of executables. While this may work for some easy use cases, it has following disadvantages:
Only [project.scripts] is taken into account and [project.gui-scripts] is ignored.
So if your project needs to build both, it is hard to configure different PyApp environment variables for both.
No control over the naming of built executables. Right now the version number is appended and the script name is prepended. I'd like to make it template-able, something like mycustomname, mycustomname-{version} or {dist_name}-{version}.
__main__.py cannot be built if script is left empty. Also other options PyApp provides (PYAPP_EXEC_*) are not supported.
Here an example TOML i could imagine:
[tool.hatch.build.targets.binary]
[tool.hatch.build.targets.binary.variables]
CARGO_TARGET_DIR = ".tmp/pyapp_cargo"PYAPP_DISTRIBUTION_EMBED = "false"PYAPP_FULL_ISOLATION = "true"PYAPP_PIP_EXTRA_ARGS = "--index-url ..."PYAPP_UV_ENABLED = "true"
[tool.hatch.build.targets.binary.build-targets]
# Build the CLI from myapp.cli:climyapp-cli = { name = "{dist_name}-cli.exe", variables = {PYAPP_IS_GUI = "false", PYAPP_EXEC_SPEC = "myapp.cli:cli"}}
# Build the GUI from myapp.__main__myapp-gui = { name = "{dist_name}.exe", variables = {PYAPP_IS_GUI = "true", PYAPP_EXEC_MODULE = "myapp"}}
This would enable all possible options of PyApp within Hatch and integrate it better.
What do you think? If you like it i could contribute this feature.
The text was updated successfully, but these errors were encountered:
Hey, me again ;)
I'd like to request (and maybe even contribute) more integration options for PyApp.
Hatch right now only offers the
scripts
option, which is transforming your project scripts into a bunch of executables. While this may work for some easy use cases, it has following disadvantages:[project.scripts]
is taken into account and[project.gui-scripts]
is ignored.So if your project needs to build both, it is hard to configure different PyApp environment variables for both.
mycustomname
,mycustomname-{version}
or{dist_name}-{version}
.__main__.py
cannot be built ifscript
is left empty. Also other options PyApp provides (PYAPP_EXEC_*
) are not supported.Here an example TOML i could imagine:
This would enable all possible options of PyApp within Hatch and integrate it better.
What do you think? If you like it i could contribute this feature.
The text was updated successfully, but these errors were encountered: