Skip to content

Commit e57dc10

Browse files
Initial CLI implementaion (#168)
* add * add * add * Create .python-version * add * add * Update .gitignore * add workflows Update build-cli.yml Update build-cli.yml
1 parent 870512d commit e57dc10

7 files changed

Lines changed: 629 additions & 86 deletions

File tree

.github/dependabot.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
version: 2
77
updates:
8+
## Github Actions
9+
- package-ecosystem: 'github-actions' # See documentation for possible values
10+
directory: '/' # Location of package manifests
11+
open-pull-requests-limit: 100
12+
schedule:
13+
interval: 'daily'
14+
815
## Frontend
916

1017
- package-ecosystem: 'npm' # See documentation for possible values
@@ -40,12 +47,11 @@ updates:
4047
open-pull-requests-limit: 100
4148
schedule:
4249
interval: 'daily'
43-
50+
4451
## CLI
4552

4653
- package-ecosystem: 'uv' # See documentation for possible values
4754
directory: './src/cli' # Location of package manifests
4855
open-pull-requests-limit: 100
4956
schedule:
5057
interval: 'daily'
51-

.github/workflows/build-cli.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test CLI Build
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
paths:
7+
- 'src/cli/**'
8+
- '.github/workflows/**'
9+
pull_request:
10+
branches: ['main']
11+
paths:
12+
- 'src/cli/**'
13+
- '.github/workflows/**'
14+
workflow_dispatch:
15+
16+
jobs:
17+
build-docker:
18+
runs-on: ubuntu-latest
19+
defaults:
20+
run:
21+
working-directory: ./src/cli
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v7
29+
30+
- name: Install deps with uv
31+
run: uv sync --frozen
32+
33+
- name: Build
34+
run: uv run poe nuitka

src/cli/.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,8 @@ __marimo__/
220220
*.pyd
221221

222222
# Ignore the final exe
223-
*.exe
223+
*.exe
224+
225+
app.build
226+
app.dist
227+
app.onefile-build

src/cli/.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.13
1+
cpython@3.13

src/cli/app/main.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
from async_typer import AsyncTyper
2-
import os
3-
from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
2+
import py7zr
43

54
app = AsyncTyper()
65

76

8-
key = ChaCha20Poly1305.generate_key()
9-
chacha = ChaCha20Poly1305(key)
10-
11-
12-
nonce = os.urandom(12)
13-
14-
157
@app.async_command()
168
async def hello(name: str):
17-
ciphertext = chacha.encrypt(nonce, f"hello {name}".encode(), None)
18-
19-
print(ciphertext)
9+
filters = [
10+
{
11+
"id": py7zr.FILTER_LZMA2,
12+
"preset": 9,
13+
"dict_size": 1024 * 1024 * 512,
14+
}
15+
]
16+
with py7zr.SevenZipFile(
17+
"Archive.7z",
18+
"w",
19+
filters=filters,
20+
) as archive:
21+
archive.writeall("test/")

src/cli/pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ name = "cli"
33
version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
6-
requires-python = ">=3.13"
6+
requires-python = ">=3.11"
77
dependencies = [
88
# CLI
99
"typer>=0.21.0",
1010
"async-typer>=0.1.10",
1111
# Asnyc loop implementation
1212
"uvloop>=0.22.1;sys_platform=='linux'",
13-
# Cryptography helper
14-
"cryptography>=46.0.3",
1513
# Http Client
1614
"httpx[http2]>=0.28.1",
15+
"py7zr>=1.1.0",
1716
]
1817

1918

2019
[dependency-groups]
21-
build = ["nuitka>=2.8.9"]
20+
build = ["nuitka>=2.8.9", "zstandard>=0.25.0"]
2221
dev = ["poethepoet>=0.39.0"]
2322

2423
[tool.poe.tasks]

src/cli/uv.lock

Lines changed: 564 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)