-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
Binary app error: Could not find a version that satisfies the requirement #1436
Comments
After considerate effort googling in GitHub, I found out that with the following script I am able to generate some build-in images that work... #!/usr/bin/env bash
current_version=$(hatch version)
hatch build
PYAPP_UV_ENABLED="1" PYAPP_PROJECT_PATH="$(ls ${PWD}/dist/test_app-${current_version}-py3-none-any.whl)" PYAPP_DISTRIBUTION_EMBED="1" hatch build -t binary Nevertheless, I'm unsure of how this happens to work while the other does not. |
I can confirm I have same issue, this doesn't work right out of the box and I wasn't able to find many resources. It would be nice if these settings could be configured directly in |
Having the same issue here
good idea imo, @ofek |
I've been struggling with the same issue, thinking it was something wrong with my configuration. Indeed it seems to be a bug with the Here is a workaround I came up with for the time being for a one-liner binary build in a separate environment: # pyproject.toml snippet
[project.scripts]
run-test-app = "test_app:main"
[tool.hatch.build.targets.binary]
scripts = ["run-test-app"]
[tool.hatch.envs.build]
detached = true
[tool.hatch.envs.build.env-vars]
PYAPP_DISTRIBUTION_EMBED = "true"
PYAPP_PROJECT_PATH = "{root}/dist/test_app.tar.gz"
PYAPP_UV_ENABLED = "true"
PYAPP_PYTHON_VERSION = "3.11"
[tool.hatch.envs.build.scripts]
binary = [
"hatch build -c -t sdist",
"mv {root}/dist/test_app-*.tar.gz {root}/dist/test_app.tar.gz",
"hatch build -t binary"
] # Shell command to compile binary
$ hatch run build:binary This requires a separate environment to set up for the build environment to do it's thing, which is redundant, but works for now. Here is what I think it should look like once it's fixed, with all the PyApp options exposed as binary build plugin options, and the project being built and installed in the compiled binary: [tool.hatch.build.targets.binary]
scripts = ["run-test-app"]
distribution-embed = "true"
uv-enabled = "true"
python-version = "true" |
Hello,
I tried to setup a project using hatch/pyapp, but after building the project with pyapp (which completes successfully) I keep getting the following error.
The steps I followed where to create a project with
hatch init test_app
then edit the pyproject.toml by adding those two linesand then build the app with
hatch build --target binary
.I am on macOS.
Is this somehow known? Do you have some ideas on what I could try to do to fix it?
The text was updated successfully, but these errors were encountered: