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

zapp doesn't copy entrypoint file #1

Open
Dobatymo opened this issue Sep 28, 2023 · 3 comments
Open

zapp doesn't copy entrypoint file #1

Dobatymo opened this issue Sep 28, 2023 · 3 comments

Comments

@Dobatymo
Copy link

Using Windows 10, python 3.8, zapp==0.0.7

Running py -m zapp myapp.pyz main:main --requirements requirements.txt in a folder with only a main.py and a requirements.txt file doesn't copy the main.py file into the resulting myapp.pyz.

@sinoroc
Copy link
Owner

sinoroc commented Sep 28, 2023

@Dobatymo I see what you mean. I am afraid this use case is not supported. I admit it seems like a legitimate use case but not one I intend to implement in the near future, especially since I do not have the resources to work on this project currently.

If I can offer an alternative to make it work...

I recommend you turn this main.py into an installable project. A simple pyproject.toml file should be enough.

For example:

[project]
name = "MyApp"
version = "0.0.0"

[tool.setuptools]
py-modules = ["main"]

And then add the path to the directory containing pyproject.toml as requirement to zapp. For example the current directory with a single dot .:

py -m zapp myapp.pyz main:main . --requirements requirements.txt

@Dobatymo
Copy link
Author

@sinoroc Thanks for the workaround. It's an acceptable solution. In the meantime I was looking at https://github.com/ClericPy/zipapps which seems to be similar but with a few more features.

@sinoroc
Copy link
Owner

sinoroc commented Sep 29, 2023

@Dobatymo I recommend you also have a look at pex and shiv. There is also pyempaq, which takes a quite different approach to zipapps.

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

2 participants