swap-cli 0.1.1__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.
- swap_cli-0.1.1/.github/workflows/ci.yml +45 -0
- swap_cli-0.1.1/.github/workflows/release.yml +54 -0
- swap_cli-0.1.1/.gitignore +59 -0
- swap_cli-0.1.1/CHANGELOG.md +60 -0
- swap_cli-0.1.1/LICENSE.md +75 -0
- swap_cli-0.1.1/PKG-INFO +504 -0
- swap_cli-0.1.1/README.md +374 -0
- swap_cli-0.1.1/docs/RELEASING.md +75 -0
- swap_cli-0.1.1/pyproject.toml +119 -0
- swap_cli-0.1.1/scripts/mirror_voices.py +150 -0
- swap_cli-0.1.1/src/swap_cli/__init__.py +5 -0
- swap_cli-0.1.1/src/swap_cli/__main__.py +6 -0
- swap_cli-0.1.1/src/swap_cli/camera.py +83 -0
- swap_cli-0.1.1/src/swap_cli/cli.py +1183 -0
- swap_cli-0.1.1/src/swap_cli/config.py +152 -0
- swap_cli-0.1.1/src/swap_cli/devices.py +216 -0
- swap_cli-0.1.1/src/swap_cli/display.py +177 -0
- swap_cli-0.1.1/src/swap_cli/gui.py +1695 -0
- swap_cli-0.1.1/src/swap_cli/license.py +93 -0
- swap_cli-0.1.1/src/swap_cli/runtime.py +273 -0
- swap_cli-0.1.1/src/swap_cli/rvc_catalog.py +105 -0
- swap_cli-0.1.1/src/swap_cli/version.py +1 -0
- swap_cli-0.1.1/src/swap_cli/voice_engines/__init__.py +148 -0
- swap_cli-0.1.1/src/swap_cli/voice_engines/rvc_converter.py +220 -0
- swap_cli-0.1.1/src/swap_cli/voice_engines/rvc_engine.py +108 -0
- swap_cli-0.1.1/src/swap_cli/voice_library.py +141 -0
- swap_cli-0.1.1/src/swap_cli/voice_ops.py +594 -0
- swap_cli-0.1.1/src/swap_cli/voice_prereq.py +360 -0
- swap_cli-0.1.1/src/swap_cli/voice_router.py +153 -0
- swap_cli-0.1.1/src/swap_cli/voice_track.py +545 -0
- swap_cli-0.1.1/src/swap_cli/voices/__init__.py +1 -0
- swap_cli-0.1.1/tests/test_config.py +72 -0
- swap_cli-0.1.1/tests/test_cuda_torch.py +88 -0
- swap_cli-0.1.1/tests/test_devices.py +130 -0
- swap_cli-0.1.1/tests/test_engine_wiring.py +150 -0
- swap_cli-0.1.1/tests/test_engines.py +94 -0
- swap_cli-0.1.1/tests/test_fairseq_patch.py +119 -0
- swap_cli-0.1.1/tests/test_runtime_timeout.py +49 -0
- swap_cli-0.1.1/tests/test_rvc.py +212 -0
- swap_cli-0.1.1/tests/test_rvc_catalog.py +100 -0
- swap_cli-0.1.1/tests/test_settings_modal.py +120 -0
- swap_cli-0.1.1/tests/test_silent_threshold.py +46 -0
- swap_cli-0.1.1/tests/test_sola.py +231 -0
- swap_cli-0.1.1/tests/test_virtual_camera.py +222 -0
- swap_cli-0.1.1/tests/test_voice_prereq.py +164 -0
- swap_cli-0.1.1/tests/test_voice_router.py +88 -0
- swap_cli-0.1.1/tools/build_library.py +214 -0
- swap_cli-0.1.1/tools/personas.yaml +107 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: ${{ matrix.os }} · Python ${{ matrix.python }}
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
17
|
+
python: ["3.11", "3.12"]
|
|
18
|
+
steps:
|
|
19
|
+
- name: Check out source
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Set up Python ${{ matrix.python }}
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python }}
|
|
26
|
+
|
|
27
|
+
- name: Install swap-cli (base + dev extras)
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
python -m pip install -e ".[dev]"
|
|
31
|
+
|
|
32
|
+
- name: Smoke import + version
|
|
33
|
+
run: |
|
|
34
|
+
python -c "import swap_cli; from swap_cli.version import __version__; print('swap-cli', __version__)"
|
|
35
|
+
|
|
36
|
+
- name: Run test suite
|
|
37
|
+
# test_config.py needs file-system setup we don't seed here;
|
|
38
|
+
# the other 84 tests cover all the public-facing logic.
|
|
39
|
+
run: pytest tests/ --ignore=tests/test_config.py -q
|
|
40
|
+
|
|
41
|
+
- name: Build wheel
|
|
42
|
+
if: matrix.python == '3.11'
|
|
43
|
+
run: |
|
|
44
|
+
python -m pip install build
|
|
45
|
+
python -m build --wheel
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
# Trigger on any tag matching v*. Tag the commit, push the tag, and
|
|
4
|
+
# this workflow builds + publishes the package automatically.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags:
|
|
8
|
+
- "v*"
|
|
9
|
+
|
|
10
|
+
# Trusted Publishing (OIDC) — no API token sitting in repo secrets.
|
|
11
|
+
# Maintainer registers swap-cli as a Trusted Publisher on PyPI once:
|
|
12
|
+
# PyPI → Account → Publishing → Add a new pending publisher
|
|
13
|
+
# Owner: BlAcQW Repo: swap-cli
|
|
14
|
+
# Workflow: release.yml Environment: pypi
|
|
15
|
+
# After the first successful publish, the pending publisher converts
|
|
16
|
+
# to active. No further setup for subsequent releases.
|
|
17
|
+
permissions:
|
|
18
|
+
id-token: write # required for OIDC
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
build-and-publish:
|
|
23
|
+
name: Build wheel + sdist, publish to PyPI
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
environment:
|
|
26
|
+
name: pypi
|
|
27
|
+
url: https://pypi.org/project/swap-cli/
|
|
28
|
+
steps:
|
|
29
|
+
- name: Check out source
|
|
30
|
+
uses: actions/checkout@v4
|
|
31
|
+
with:
|
|
32
|
+
fetch-depth: 0
|
|
33
|
+
|
|
34
|
+
- name: Set up Python 3.11
|
|
35
|
+
uses: actions/setup-python@v5
|
|
36
|
+
with:
|
|
37
|
+
python-version: "3.11"
|
|
38
|
+
|
|
39
|
+
- name: Install build tooling
|
|
40
|
+
run: |
|
|
41
|
+
python -m pip install --upgrade pip
|
|
42
|
+
python -m pip install build
|
|
43
|
+
|
|
44
|
+
- name: Run test suite as a pre-publish gate
|
|
45
|
+
run: |
|
|
46
|
+
python -m pip install -e ".[dev]"
|
|
47
|
+
pytest tests/ --ignore=tests/test_config.py -q
|
|
48
|
+
|
|
49
|
+
- name: Build wheel + sdist
|
|
50
|
+
run: python -m build
|
|
51
|
+
|
|
52
|
+
- name: Publish to PyPI
|
|
53
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
54
|
+
# No `with: password:` line — OIDC handles auth via id-token.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
|
|
24
|
+
# Virtual envs
|
|
25
|
+
.venv/
|
|
26
|
+
venv/
|
|
27
|
+
env/
|
|
28
|
+
.python-version
|
|
29
|
+
|
|
30
|
+
# IDE
|
|
31
|
+
.vscode/
|
|
32
|
+
.idea/
|
|
33
|
+
*.swp
|
|
34
|
+
.DS_Store
|
|
35
|
+
|
|
36
|
+
# Test/coverage
|
|
37
|
+
.pytest_cache/
|
|
38
|
+
.mypy_cache/
|
|
39
|
+
.ruff_cache/
|
|
40
|
+
htmlcov/
|
|
41
|
+
.coverage
|
|
42
|
+
.tox/
|
|
43
|
+
|
|
44
|
+
# Build outputs
|
|
45
|
+
*.spec
|
|
46
|
+
*.exe
|
|
47
|
+
*.app
|
|
48
|
+
PyInstaller/
|
|
49
|
+
release/
|
|
50
|
+
|
|
51
|
+
# Local config / secrets
|
|
52
|
+
.env
|
|
53
|
+
.env.local
|
|
54
|
+
config.toml
|
|
55
|
+
swap-config.toml
|
|
56
|
+
|
|
57
|
+
# Recordings
|
|
58
|
+
recordings/
|
|
59
|
+
*.mp4
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to swap-cli.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [0.1.1] — 2026-06-XX — first PyPI release
|
|
9
|
+
|
|
10
|
+
First public release on PyPI. `pip install swap-cli` now works.
|
|
11
|
+
|
|
12
|
+
### Packaging
|
|
13
|
+
|
|
14
|
+
- Added PyPI classifiers, project URLs, keywords, author email.
|
|
15
|
+
- Bumped version 0.1.0 → 0.1.1.
|
|
16
|
+
- Added GitHub Actions workflows:
|
|
17
|
+
- `release.yml` — tag-triggered publish to PyPI via Trusted Publishing (OIDC).
|
|
18
|
+
- `ci.yml` — push/PR matrix tests across Ubuntu/macOS/Windows × Python 3.11/3.12.
|
|
19
|
+
- Verified base install is clean on Apple Silicon Mac (all deps have arm64 wheels).
|
|
20
|
+
|
|
21
|
+
### Documentation
|
|
22
|
+
|
|
23
|
+
- README: added "macOS users — read this first" callout at the top of the
|
|
24
|
+
Install section pointing at python.org / `brew install python-tk@3.11`.
|
|
25
|
+
- README: new "macOS compatibility" section detailing per-feature support,
|
|
26
|
+
install prereqs, and known limitations (Apple Silicon CPU is too slow
|
|
27
|
+
for live RVC voice; Intel Mac is unsupported for voice).
|
|
28
|
+
- New `CHANGELOG.md` (this file).
|
|
29
|
+
- New `docs/RELEASING.md` documenting the tag → publish workflow.
|
|
30
|
+
|
|
31
|
+
### Notes
|
|
32
|
+
|
|
33
|
+
This release reflects the cumulative work through Sprint 14o. See the
|
|
34
|
+
Sprint Appendix below for the feature provenance and the commit log for
|
|
35
|
+
fine-grained changes.
|
|
36
|
+
|
|
37
|
+
### Sprint appendix (feature provenance)
|
|
38
|
+
|
|
39
|
+
| Sprint | What landed |
|
|
40
|
+
|---|---|
|
|
41
|
+
| 14a | SOLA crossfade for voice streaming (w-okada-inspired) |
|
|
42
|
+
| 14b.1–b.3 | Voice engine registry abstraction; RVC engine |
|
|
43
|
+
| 14c | Mac install hardening (rvc-python out of extras, Tcl/Tk check) |
|
|
44
|
+
| 14d | Install/engine UX hardening |
|
|
45
|
+
| 14e | Dropped OpenVoice; voice = RVC only |
|
|
46
|
+
| 14f | Curated voice catalog + auto-starter |
|
|
47
|
+
| 14g.0–g.5 | RVC cascade fixes (dataclass patch, deps, fork swap, CUDA torch) |
|
|
48
|
+
| 14h | Audio plumbing diagnostics |
|
|
49
|
+
| 14i | w-okada-inspired voice perf pass |
|
|
50
|
+
| 14j | Halved speak-to-hear latency |
|
|
51
|
+
| 14k | Virtual camera output (OBS Virtual Camera, no OBS app needed) |
|
|
52
|
+
| 14l | In-GUI Settings panel (rotate Decart key without CLI) |
|
|
53
|
+
| 14m | Decart reconnect timeout 20→45s + pyvirtualcam doctor visibility |
|
|
54
|
+
| 14n | OBS Virtual Camera detection via rglob (modern OBS layouts) |
|
|
55
|
+
| 14o | Refuse OBS Virtual Camera as input (feedback-loop prevention) |
|
|
56
|
+
| 14p | First PyPI release + Mac compat docs (this release) |
|
|
57
|
+
|
|
58
|
+
## [0.1.0] — internal
|
|
59
|
+
|
|
60
|
+
Pre-PyPI development versions. Not published.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# swap-cli — Commercial License
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 swap. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software is licensed, not sold. By installing or using `swap-cli` you
|
|
6
|
+
agree to the terms below.
|
|
7
|
+
|
|
8
|
+
## 1. Grant
|
|
9
|
+
|
|
10
|
+
Subject to a valid license key purchased through an authorized distribution
|
|
11
|
+
channel (e.g. swap.ikieguy.online), the licensee is granted a non-exclusive,
|
|
12
|
+
non-transferable right to install and use this software on their personal
|
|
13
|
+
machines for the duration of the license term.
|
|
14
|
+
|
|
15
|
+
## 2. Restrictions
|
|
16
|
+
|
|
17
|
+
The licensee MAY NOT:
|
|
18
|
+
- Redistribute, sublicense, sell, lease, rent, or share the software or any
|
|
19
|
+
derivative work to third parties without prior written permission.
|
|
20
|
+
- Reverse-engineer, decompile, or disassemble the software except to the
|
|
21
|
+
extent permitted by applicable law.
|
|
22
|
+
- Remove or alter any proprietary notices, watermarks, or license validation
|
|
23
|
+
mechanisms.
|
|
24
|
+
- Use the software to generate content that violates Decart's acceptable use
|
|
25
|
+
policy, applicable laws, or the rights of any third party (including
|
|
26
|
+
non-consensual deepfakes of real people).
|
|
27
|
+
|
|
28
|
+
## 3. Third-Party APIs
|
|
29
|
+
|
|
30
|
+
The software is a wrapper around third-party services (notably the Decart
|
|
31
|
+
Lucy API). The licensee is responsible for:
|
|
32
|
+
- Obtaining and maintaining their own valid Decart API key.
|
|
33
|
+
- Compliance with Decart's terms of service and content policies.
|
|
34
|
+
- All compute/usage charges billed by Decart directly.
|
|
35
|
+
|
|
36
|
+
`swap-cli` does not resell, intermediate, or bill for Decart compute. The
|
|
37
|
+
license fee paid to swap covers only the software and any included identity
|
|
38
|
+
preset library.
|
|
39
|
+
|
|
40
|
+
## 4. License Verification
|
|
41
|
+
|
|
42
|
+
The software contacts `https://swap.ikieguy.online/api/cli/license/validate`
|
|
43
|
+
on launch to verify the license key. A valid 24-hour offline grace period is
|
|
44
|
+
cached locally. License keys may be revoked by the licensor in cases of
|
|
45
|
+
abuse, chargeback, or violation of these terms.
|
|
46
|
+
|
|
47
|
+
## 5. Updates
|
|
48
|
+
|
|
49
|
+
License grants access to all minor and patch updates within the same major
|
|
50
|
+
version. Major-version upgrades may require a new license.
|
|
51
|
+
|
|
52
|
+
## 6. Warranty Disclaimer
|
|
53
|
+
|
|
54
|
+
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
55
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
56
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
57
|
+
|
|
58
|
+
## 7. Liability Cap
|
|
59
|
+
|
|
60
|
+
In no event shall the total liability of the licensor exceed the amount paid
|
|
61
|
+
by the licensee for the license in the twelve (12) months preceding the
|
|
62
|
+
event giving rise to the claim.
|
|
63
|
+
|
|
64
|
+
## 8. Termination
|
|
65
|
+
|
|
66
|
+
The license terminates automatically upon material breach of these terms.
|
|
67
|
+
The licensee must uninstall the software and destroy all copies within
|
|
68
|
+
seven (7) days of termination.
|
|
69
|
+
|
|
70
|
+
## 9. Governing Law
|
|
71
|
+
|
|
72
|
+
This agreement is governed by the laws of Ghana. Any disputes shall be
|
|
73
|
+
resolved in the courts of Accra, Ghana.
|
|
74
|
+
|
|
75
|
+
— end —
|