package py code and dependency to pyz
See original GitHub issueI noticed there say “ we can publish a single file .pyz so that people can download and run without installing any dependencies”。How do you do that?for example:
pyproject.toml
[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["qbit"]
[tool.poetry.dependencies]
python = "^3.8"
requests = "~2.25.1"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
test.py
import requests
def test():
r = requests.get(r'https://www.httpbin.org/get')
print(r)
if __name__ == '__main__':
test()
It is best to compile to pyc before packaging :)
Issue Analytics
- State:
- Created 2 years ago
- Comments:18
Top Results From Across the Web
How can you bundle all your python code into a single zip file?
It is available from Python 3.5 onwards. One way to create a bundle is to add a top-level file named __main__.py , which...
Read more >BTOdell/pyz: Packages all source code and ... - GitHub
This library allows you to bundle all of your Python code AND your dependencies into a single Python zip application file.
Read more >pyz · PyPI
Packages all source code and dependencies into a single Python zip application.
Read more >pyz - Python Package Health Analysis - Snyk
Packages all source code and dependencies into a single Python zip application. For more information about how to use this package see README....
Read more >Python Zip Imports: Distribute Modules and Packages Quickly
Python allows you to import code from ZIP files directly through Zip imports. This interesting built-in feature enables you to zip Python ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fine, I didn’t check those carefully. So I am going to close the issue since it is resolved.
@frostming OK. Thanks for your time.