Skip to content

Commit 94ddf20

Browse files
committed
build: fix stabdalone entry of pyinstaller
1 parent 5072e20 commit 94ddf20

4 files changed

Lines changed: 47 additions & 47 deletions

File tree

asgi-webdav.spec

Lines changed: 0 additions & 46 deletions
This file was deleted.

docs/howto/howto-pyinstaller.en.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# How to use PyInstaller to package the project
2+
3+
## Installation Dependencies
4+
5+
```bash
6+
pip install -r requirements.d/full.txt
7+
pip install pyinstaller
8+
```
9+
10+
## Build Executable File
11+
12+
```shell
13+
pyinstaller --onefile --console \
14+
--name asgi-webdav \
15+
standalone.py
16+
```
17+
18+
## Run It
19+
20+
```shell
21+
./dist/asgi-webdav -r .
22+
```

requirements.d/dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
-r mkdocs.txt
55
-r pypi.txt
66
-r docker.txt
7-
pyinstaller
87

98
# dev
109
-r test.txt

standalone.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python
2+
3+
4+
"""
5+
The standalone entry point.
6+
7+
please visit docs/howto/howto-pyinstaller.en.md for more information.
8+
"""
9+
10+
11+
from asgi_webdav.cli import main as cli_main
12+
13+
14+
def main() -> None:
15+
import sys
16+
17+
try:
18+
sys.exit(cli_main())
19+
20+
except KeyboardInterrupt:
21+
sys.exit(1)
22+
23+
24+
if __name__ == "__main__":
25+
main()

0 commit comments

Comments
 (0)