local-embed 0.2.3__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. local_embed-0.3.0/.gitattributes +9 -0
  2. local_embed-0.3.0/.github/workflows/ci.yml +58 -0
  3. local_embed-0.3.0/.github/workflows/publish.yml +62 -0
  4. local_embed-0.3.0/.gitignore +29 -0
  5. local_embed-0.3.0/LICENSE +21 -0
  6. local_embed-0.3.0/PKG-INFO +724 -0
  7. local_embed-0.3.0/README.md +701 -0
  8. local_embed-0.3.0/README.zh-CN.md +579 -0
  9. local_embed-0.3.0/install.ps1 +90 -0
  10. local_embed-0.3.0/install.sh +78 -0
  11. {local_embed-0.2.3 → local_embed-0.3.0}/local_embed/__init__.py +5 -3
  12. local_embed-0.3.0/local_embed/_yaml_doc.py +116 -0
  13. local_embed-0.3.0/local_embed/adopt.py +233 -0
  14. {local_embed-0.2.3 → local_embed-0.3.0}/local_embed/cli.py +44 -54
  15. {local_embed-0.2.3 → local_embed-0.3.0}/local_embed/cmd_set.py +26 -17
  16. {local_embed-0.2.3 → local_embed-0.3.0}/local_embed/config.py +133 -127
  17. {local_embed-0.2.3 → local_embed-0.3.0}/local_embed/engine.py +231 -148
  18. {local_embed-0.2.3 → local_embed-0.3.0}/local_embed/logging.py +29 -17
  19. local_embed-0.3.0/local_embed/server.py +600 -0
  20. {local_embed-0.2.3 → local_embed-0.3.0}/local_embed/server_utils.py +18 -63
  21. {local_embed-0.2.3 → local_embed-0.3.0}/local_embed/threads.py +5 -6
  22. {local_embed-0.2.3 → local_embed-0.3.0}/pyproject.toml +30 -11
  23. local_embed-0.3.0/tests/test_adopt.py +372 -0
  24. {local_embed-0.2.3 → local_embed-0.3.0}/tests/test_client.py +9 -6
  25. {local_embed-0.2.3 → local_embed-0.3.0}/tests/test_config.py +126 -20
  26. local_embed-0.3.0/tests/test_engine.py +441 -0
  27. {local_embed-0.2.3 → local_embed-0.3.0}/tests/test_logging.py +15 -7
  28. {local_embed-0.2.3 → local_embed-0.3.0}/tests/test_server.py +143 -26
  29. {local_embed-0.2.3 → local_embed-0.3.0}/tests/test_set.py +39 -58
  30. local_embed-0.3.0/uninstall.ps1 +69 -0
  31. local_embed-0.3.0/uninstall.sh +55 -0
  32. local_embed-0.3.0/uv.lock +1596 -0
  33. local_embed-0.2.3/.gitignore +0 -246
  34. local_embed-0.2.3/PKG-INFO +0 -457
  35. local_embed-0.2.3/README.md +0 -431
  36. local_embed-0.2.3/local_embed/server.py +0 -416
  37. local_embed-0.2.3/tests/test_engine.py +0 -300
  38. {local_embed-0.2.3 → local_embed-0.3.0}/local_embed/__main__.py +0 -0
@@ -0,0 +1,9 @@
1
+ # Normalize line endings: LF in the repository, native on checkout.
2
+ * text=auto
3
+
4
+ # Shell scripts are run by bash/WSL — a CRLF would break them with
5
+ # "bad interpreter" or stray \r in arguments.
6
+ *.sh text eol=lf
7
+
8
+ # PowerShell scripts are run by Windows tooling that expects CRLF.
9
+ *.ps1 text eol=crlf
@@ -0,0 +1,58 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu-latest, macos-latest, windows-latest]
17
+ python-version: ['3.13']
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Build wheel
28
+ # Packaging check — the sdist and wheel must build on every
29
+ # supported platform. (pytest runs against the source tree, which
30
+ # is what the tests are written for.)
31
+ run: uv build --out-dir dist
32
+
33
+ - name: Run tests
34
+ run: uv run --frozen pytest -v --maxfail=5
35
+
36
+ lint:
37
+ name: Lint and type-check
38
+ runs-on: ubuntu-latest
39
+
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - name: Install uv
44
+ uses: astral-sh/setup-uv@v5
45
+ with:
46
+ python-version: '3.13'
47
+
48
+ - name: Install dependencies
49
+ run: uv sync --locked
50
+
51
+ - name: Ruff lint
52
+ run: uv run --frozen ruff check --output-format github
53
+
54
+ - name: Ruff format
55
+ run: uv run --frozen ruff format --check
56
+
57
+ - name: Pyright
58
+ run: uv run --frozen pyright
@@ -0,0 +1,62 @@
1
+ name: Publish to PyPI
2
+
3
+ # Publishing is driven by a tag whose version matches pyproject.toml:
4
+ #
5
+ # v0.3.0 -> local-embed 0.3.0
6
+ #
7
+ # The version in pyproject.toml must equal the tag version; the workflow
8
+ # fails otherwise.
9
+
10
+ on:
11
+ push:
12
+ tags:
13
+ - 'v*'
14
+
15
+ jobs:
16
+ build-and-publish:
17
+ name: Build and publish to PyPI
18
+ runs-on: ubuntu-latest
19
+ permissions:
20
+ id-token: write # PyPI trusted publishing (OIDC)
21
+ contents: read
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: Set up Python
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: '3.13'
30
+
31
+ - name: Verify tag matches package version
32
+ run: |
33
+ VERSION="${GITHUB_REF_NAME#v}"
34
+ PKG_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
35
+ if [ "$VERSION" != "$PKG_VERSION" ]; then
36
+ echo "ERROR: tag v$VERSION != local-embed version $PKG_VERSION"
37
+ exit 1
38
+ fi
39
+ echo "local-embed $PKG_VERSION — OK"
40
+
41
+ - name: Install build tools
42
+ # twine>=6 is required for trusted publishing (OIDC); <8 keeps the
43
+ # range bounded. The lower bound is what matters for metadata:
44
+ # twine < 7 rejects Metadata-Version 2.5 ("'2.5' is not a valid
45
+ # metadata version", verified 2026-09), so 6.x in this range only
46
+ # works because pyproject.toml pins hatchling below 1.27
47
+ # (-> metadata 2.3). Lifting that pin requires raising this floor
48
+ # to >=7 in the same change. (Not a pkginfo cap — twine >= 6.2 no
49
+ # longer depends on pkginfo.)
50
+ run: pip install 'build' 'twine>=6,<8'
51
+
52
+ - name: Build package
53
+ run: python -m build
54
+
55
+ - name: Publish package to PyPI
56
+ uses: nick-fields/retry@v4
57
+ with:
58
+ timeout_minutes: 5
59
+ max_attempts: 3
60
+ retry_on: error
61
+ retry_wait_seconds: 15
62
+ command: twine upload --verbose dist/*
@@ -0,0 +1,29 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+
8
+ # Virtualenvs
9
+ .venv/
10
+ venv/
11
+
12
+ # User config — the default path is ~/.local-embed/local_embed.yaml, but
13
+ # $LOCAL_EMBED_FILE can point one into the working directory. It holds local
14
+ # machine paths (model weights, cache locations) and does not belong in the
15
+ # repository.
16
+ local_embed.yaml
17
+
18
+ # Test / tool caches
19
+ .pytest_cache/
20
+ .ruff_cache/
21
+ .coverage
22
+ coverage.xml
23
+ htmlcov/
24
+
25
+ # Editors / OS
26
+ .vscode/
27
+ .idea/
28
+ .DS_Store
29
+ Thumbs.db
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 juzcn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.