Instructions to use giancap61/AXEL-AI_Virtual_Race_Engineer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use giancap61/AXEL-AI_Virtual_Race_Engineer with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M # Run inference directly in the terminal: llama cli -hf giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M # Run inference directly in the terminal: llama cli -hf giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
Use Docker
docker model run hf.co/giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use giancap61/AXEL-AI_Virtual_Race_Engineer with Ollama:
ollama run hf.co/giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
- Unsloth Desktop
- Pi
How to use giancap61/AXEL-AI_Virtual_Race_Engineer with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use giancap61/AXEL-AI_Virtual_Race_Engineer with Docker Model Runner:
docker model run hf.co/giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
- Lemonade
How to use giancap61/AXEL-AI_Virtual_Race_Engineer with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
Run and chat with the model
lemonade run user.AXEL-AI_Virtual_Race_Engineer-Q5_K_M
List all available models
lemonade list
- Hermes Agent
How to use giancap61/AXEL-AI_Virtual_Race_Engineer with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use giancap61/AXEL-AI_Virtual_Race_Engineer with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "giancap61/AXEL-AI_Virtual_Race_Engineer:Q5_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- TTS/Kokoro/.venv/Lib/site-packages/setuptools-82.0.0.dist-info/licenses/LICENSE +17 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/__pycache__/test_cygwin.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/__pycache__/test_mingw.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/__pycache__/test_msvc.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/__pycache__/test_unix.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/__init__.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/support.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_archive_util.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_bdist.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_bdist_dumb.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_bdist_rpm.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build_clib.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build_ext.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build_py.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build_scripts.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_check.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_clean.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_cmd.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_config_cmd.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_core.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_dir_util.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_dist.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_extension.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_file_util.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_filelist.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install_data.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install_headers.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install_lib.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install_scripts.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_log.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_modified.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_sdist.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_spawn.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_sysconfig.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_text_file.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_util.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_version.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_versionpredicate.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/unix_compat.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/compat/__init__.py +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/compat/__pycache__/__init__.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/compat/__pycache__/py39.cpython-312.pyc +0 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/compat/py39.py +40 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/INSTALLER +1 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/LICENSE +166 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA +420 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/RECORD +13 -0
- TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/REQUESTED +0 -0
TTS/Kokoro/.venv/Lib/site-packages/setuptools-82.0.0.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 2 |
+
of this software and associated documentation files (the "Software"), to
|
| 3 |
+
deal in the Software without restriction, including without limitation the
|
| 4 |
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
| 5 |
+
sell copies of the Software, and to permit persons to whom the Software is
|
| 6 |
+
furnished to do so, subject to the following conditions:
|
| 7 |
+
|
| 8 |
+
The above copyright notice and this permission notice shall be included in
|
| 9 |
+
all copies or substantial portions of the Software.
|
| 10 |
+
|
| 11 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 12 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 13 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 14 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 15 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
| 16 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
| 17 |
+
IN THE SOFTWARE.
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/__pycache__/test_cygwin.cpython-312.pyc
ADDED
|
Binary file (4.58 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/__pycache__/test_mingw.cpython-312.pyc
ADDED
|
Binary file (3.89 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/__pycache__/test_msvc.cpython-312.pyc
ADDED
|
Binary file (7.47 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/__pycache__/test_unix.cpython-312.pyc
ADDED
|
Binary file (19.5 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (1.93 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/support.cpython-312.pyc
ADDED
|
Binary file (6.42 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_archive_util.cpython-312.pyc
ADDED
|
Binary file (20.2 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_bdist.cpython-312.pyc
ADDED
|
Binary file (1.91 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_bdist_dumb.cpython-312.pyc
ADDED
|
Binary file (3.86 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_bdist_rpm.cpython-312.pyc
ADDED
|
Binary file (5.64 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build.cpython-312.pyc
ADDED
|
Binary file (2.8 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build_clib.cpython-312.pyc
ADDED
|
Binary file (6.58 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build_ext.cpython-312.pyc
ADDED
|
Binary file (29.2 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build_py.cpython-312.pyc
ADDED
|
Binary file (9.87 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_build_scripts.cpython-312.pyc
ADDED
|
Binary file (4.71 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_check.cpython-312.pyc
ADDED
|
Binary file (7.12 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_clean.cpython-312.pyc
ADDED
|
Binary file (1.93 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_cmd.cpython-312.pyc
ADDED
|
Binary file (6.3 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_config_cmd.cpython-312.pyc
ADDED
|
Binary file (5.13 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_core.cpython-312.pyc
ADDED
|
Binary file (6.2 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_dir_util.cpython-312.pyc
ADDED
|
Binary file (8.57 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_dist.cpython-312.pyc
ADDED
|
Binary file (26.8 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_extension.cpython-312.pyc
ADDED
|
Binary file (4.17 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_file_util.cpython-312.pyc
ADDED
|
Binary file (6.9 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_filelist.cpython-312.pyc
ADDED
|
Binary file (14.3 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install.cpython-312.pyc
ADDED
|
Binary file (14.1 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install_data.cpython-312.pyc
ADDED
|
Binary file (4.81 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install_headers.cpython-312.pyc
ADDED
|
Binary file (1.9 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install_lib.cpython-312.pyc
ADDED
|
Binary file (6.12 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_install_scripts.cpython-312.pyc
ADDED
|
Binary file (2.72 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_log.cpython-312.pyc
ADDED
|
Binary file (974 Bytes). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_modified.cpython-312.pyc
ADDED
|
Binary file (7.19 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_sdist.cpython-312.pyc
ADDED
|
Binary file (20.6 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_spawn.cpython-312.pyc
ADDED
|
Binary file (6.69 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_sysconfig.cpython-312.pyc
ADDED
|
Binary file (18.1 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_text_file.cpython-312.pyc
ADDED
|
Binary file (3.35 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_util.cpython-312.pyc
ADDED
|
Binary file (13.4 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_version.cpython-312.pyc
ADDED
|
Binary file (3.85 kB). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/test_versionpredicate.cpython-312.pyc
ADDED
|
Binary file (229 Bytes). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/__pycache__/unix_compat.cpython-312.pyc
ADDED
|
Binary file (807 Bytes). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/compat/__init__.py
ADDED
|
File without changes
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/compat/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (223 Bytes). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/compat/__pycache__/py39.cpython-312.pyc
ADDED
|
Binary file (707 Bytes). View file
|
|
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_distutils/tests/compat/py39.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
|
| 3 |
+
if sys.version_info >= (3, 10):
|
| 4 |
+
from test.support.import_helper import (
|
| 5 |
+
CleanImport as CleanImport,
|
| 6 |
+
)
|
| 7 |
+
from test.support.import_helper import (
|
| 8 |
+
DirsOnSysPath as DirsOnSysPath,
|
| 9 |
+
)
|
| 10 |
+
from test.support.os_helper import (
|
| 11 |
+
EnvironmentVarGuard as EnvironmentVarGuard,
|
| 12 |
+
)
|
| 13 |
+
from test.support.os_helper import (
|
| 14 |
+
rmtree as rmtree,
|
| 15 |
+
)
|
| 16 |
+
from test.support.os_helper import (
|
| 17 |
+
skip_unless_symlink as skip_unless_symlink,
|
| 18 |
+
)
|
| 19 |
+
from test.support.os_helper import (
|
| 20 |
+
unlink as unlink,
|
| 21 |
+
)
|
| 22 |
+
else:
|
| 23 |
+
from test.support import (
|
| 24 |
+
CleanImport as CleanImport,
|
| 25 |
+
)
|
| 26 |
+
from test.support import (
|
| 27 |
+
DirsOnSysPath as DirsOnSysPath,
|
| 28 |
+
)
|
| 29 |
+
from test.support import (
|
| 30 |
+
EnvironmentVarGuard as EnvironmentVarGuard,
|
| 31 |
+
)
|
| 32 |
+
from test.support import (
|
| 33 |
+
rmtree as rmtree,
|
| 34 |
+
)
|
| 35 |
+
from test.support import (
|
| 36 |
+
skip_unless_symlink as skip_unless_symlink,
|
| 37 |
+
)
|
| 38 |
+
from test.support import (
|
| 39 |
+
unlink as unlink,
|
| 40 |
+
)
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
uv
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GNU LESSER GENERAL PUBLIC LICENSE
|
| 2 |
+
Version 3, 29 June 2007
|
| 3 |
+
|
| 4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
| 5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 6 |
+
of this license document, but changing it is not allowed.
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
This version of the GNU Lesser General Public License incorporates
|
| 10 |
+
the terms and conditions of version 3 of the GNU General Public
|
| 11 |
+
License, supplemented by the additional permissions listed below.
|
| 12 |
+
|
| 13 |
+
0. Additional Definitions.
|
| 14 |
+
|
| 15 |
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
| 16 |
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
| 17 |
+
General Public License.
|
| 18 |
+
|
| 19 |
+
"The Library" refers to a covered work governed by this License,
|
| 20 |
+
other than an Application or a Combined Work as defined below.
|
| 21 |
+
|
| 22 |
+
An "Application" is any work that makes use of an interface provided
|
| 23 |
+
by the Library, but which is not otherwise based on the Library.
|
| 24 |
+
Defining a subclass of a class defined by the Library is deemed a mode
|
| 25 |
+
of using an interface provided by the Library.
|
| 26 |
+
|
| 27 |
+
A "Combined Work" is a work produced by combining or linking an
|
| 28 |
+
Application with the Library. The particular version of the Library
|
| 29 |
+
with which the Combined Work was made is also called the "Linked
|
| 30 |
+
Version".
|
| 31 |
+
|
| 32 |
+
The "Minimal Corresponding Source" for a Combined Work means the
|
| 33 |
+
Corresponding Source for the Combined Work, excluding any source code
|
| 34 |
+
for portions of the Combined Work that, considered in isolation, are
|
| 35 |
+
based on the Application, and not on the Linked Version.
|
| 36 |
+
|
| 37 |
+
The "Corresponding Application Code" for a Combined Work means the
|
| 38 |
+
object code and/or source code for the Application, including any data
|
| 39 |
+
and utility programs needed for reproducing the Combined Work from the
|
| 40 |
+
Application, but excluding the System Libraries of the Combined Work.
|
| 41 |
+
|
| 42 |
+
1. Exception to Section 3 of the GNU GPL.
|
| 43 |
+
|
| 44 |
+
You may convey a covered work under sections 3 and 4 of this License
|
| 45 |
+
without being bound by section 3 of the GNU GPL.
|
| 46 |
+
|
| 47 |
+
2. Conveying Modified Versions.
|
| 48 |
+
|
| 49 |
+
If you modify a copy of the Library, and, in your modifications, a
|
| 50 |
+
facility refers to a function or data to be supplied by an Application
|
| 51 |
+
that uses the facility (other than as an argument passed when the
|
| 52 |
+
facility is invoked), then you may convey a copy of the modified
|
| 53 |
+
version:
|
| 54 |
+
|
| 55 |
+
a) under this License, provided that you make a good faith effort to
|
| 56 |
+
ensure that, in the event an Application does not supply the
|
| 57 |
+
function or data, the facility still operates, and performs
|
| 58 |
+
whatever part of its purpose remains meaningful, or
|
| 59 |
+
|
| 60 |
+
b) under the GNU GPL, with none of the additional permissions of
|
| 61 |
+
this License applicable to that copy.
|
| 62 |
+
|
| 63 |
+
3. Object Code Incorporating Material from Library Header Files.
|
| 64 |
+
|
| 65 |
+
The object code form of an Application may incorporate material from
|
| 66 |
+
a header file that is part of the Library. You may convey such object
|
| 67 |
+
code under terms of your choice, provided that, if the incorporated
|
| 68 |
+
material is not limited to numerical parameters, data structure
|
| 69 |
+
layouts and accessors, or small macros, inline functions and templates
|
| 70 |
+
(ten or fewer lines in length), you do both of the following:
|
| 71 |
+
|
| 72 |
+
a) Give prominent notice with each copy of the object code that the
|
| 73 |
+
Library is used in it and that the Library and its use are
|
| 74 |
+
covered by this License.
|
| 75 |
+
|
| 76 |
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
| 77 |
+
document.
|
| 78 |
+
|
| 79 |
+
4. Combined Works.
|
| 80 |
+
|
| 81 |
+
You may convey a Combined Work under terms of your choice that,
|
| 82 |
+
taken together, effectively do not restrict modification of the
|
| 83 |
+
portions of the Library contained in the Combined Work and reverse
|
| 84 |
+
engineering for debugging such modifications, if you also do each of
|
| 85 |
+
the following:
|
| 86 |
+
|
| 87 |
+
a) Give prominent notice with each copy of the Combined Work that
|
| 88 |
+
the Library is used in it and that the Library and its use are
|
| 89 |
+
covered by this License.
|
| 90 |
+
|
| 91 |
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
| 92 |
+
document.
|
| 93 |
+
|
| 94 |
+
c) For a Combined Work that displays copyright notices during
|
| 95 |
+
execution, include the copyright notice for the Library among
|
| 96 |
+
these notices, as well as a reference directing the user to the
|
| 97 |
+
copies of the GNU GPL and this license document.
|
| 98 |
+
|
| 99 |
+
d) Do one of the following:
|
| 100 |
+
|
| 101 |
+
0) Convey the Minimal Corresponding Source under the terms of this
|
| 102 |
+
License, and the Corresponding Application Code in a form
|
| 103 |
+
suitable for, and under terms that permit, the user to
|
| 104 |
+
recombine or relink the Application with a modified version of
|
| 105 |
+
the Linked Version to produce a modified Combined Work, in the
|
| 106 |
+
manner specified by section 6 of the GNU GPL for conveying
|
| 107 |
+
Corresponding Source.
|
| 108 |
+
|
| 109 |
+
1) Use a suitable shared library mechanism for linking with the
|
| 110 |
+
Library. A suitable mechanism is one that (a) uses at run time
|
| 111 |
+
a copy of the Library already present on the user's computer
|
| 112 |
+
system, and (b) will operate properly with a modified version
|
| 113 |
+
of the Library that is interface-compatible with the Linked
|
| 114 |
+
Version.
|
| 115 |
+
|
| 116 |
+
e) Provide Installation Information, but only if you would otherwise
|
| 117 |
+
be required to provide such information under section 6 of the
|
| 118 |
+
GNU GPL, and only to the extent that such information is
|
| 119 |
+
necessary to install and execute a modified version of the
|
| 120 |
+
Combined Work produced by recombining or relinking the
|
| 121 |
+
Application with a modified version of the Linked Version. (If
|
| 122 |
+
you use option 4d0, the Installation Information must accompany
|
| 123 |
+
the Minimal Corresponding Source and Corresponding Application
|
| 124 |
+
Code. If you use option 4d1, you must provide the Installation
|
| 125 |
+
Information in the manner specified by section 6 of the GNU GPL
|
| 126 |
+
for conveying Corresponding Source.)
|
| 127 |
+
|
| 128 |
+
5. Combined Libraries.
|
| 129 |
+
|
| 130 |
+
You may place library facilities that are a work based on the
|
| 131 |
+
Library side by side in a single library together with other library
|
| 132 |
+
facilities that are not Applications and are not covered by this
|
| 133 |
+
License, and convey such a combined library under terms of your
|
| 134 |
+
choice, if you do both of the following:
|
| 135 |
+
|
| 136 |
+
a) Accompany the combined library with a copy of the same work based
|
| 137 |
+
on the Library, uncombined with any other library facilities,
|
| 138 |
+
conveyed under the terms of this License.
|
| 139 |
+
|
| 140 |
+
b) Give prominent notice with the combined library that part of it
|
| 141 |
+
is a work based on the Library, and explaining where to find the
|
| 142 |
+
accompanying uncombined form of the same work.
|
| 143 |
+
|
| 144 |
+
6. Revised Versions of the GNU Lesser General Public License.
|
| 145 |
+
|
| 146 |
+
The Free Software Foundation may publish revised and/or new versions
|
| 147 |
+
of the GNU Lesser General Public License from time to time. Such new
|
| 148 |
+
versions will be similar in spirit to the present version, but may
|
| 149 |
+
differ in detail to address new problems or concerns.
|
| 150 |
+
|
| 151 |
+
Each version is given a distinguishing version number. If the
|
| 152 |
+
Library as you received it specifies that a certain numbered version
|
| 153 |
+
of the GNU Lesser General Public License "or any later version"
|
| 154 |
+
applies to it, you have the option of following the terms and
|
| 155 |
+
conditions either of that published version or of any later version
|
| 156 |
+
published by the Free Software Foundation. If the Library as you
|
| 157 |
+
received it does not specify a version number of the GNU Lesser
|
| 158 |
+
General Public License, you may choose any version of the GNU Lesser
|
| 159 |
+
General Public License ever published by the Free Software Foundation.
|
| 160 |
+
|
| 161 |
+
If the Library as you received it specifies that a proxy can decide
|
| 162 |
+
whether future versions of the GNU Lesser General Public License shall
|
| 163 |
+
apply, that proxy's public statement of acceptance of any version is
|
| 164 |
+
permanent authorization for you to choose that version for the
|
| 165 |
+
Library.
|
| 166 |
+
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: autocommand
|
| 3 |
+
Version: 2.2.2
|
| 4 |
+
Summary: A library to create a command-line program from a function
|
| 5 |
+
Home-page: https://github.com/Lucretiel/autocommand
|
| 6 |
+
Author: Nathan West
|
| 7 |
+
License: LGPLv3
|
| 8 |
+
Project-URL: Homepage, https://github.com/Lucretiel/autocommand
|
| 9 |
+
Project-URL: Bug Tracker, https://github.com/Lucretiel/autocommand/issues
|
| 10 |
+
Platform: any
|
| 11 |
+
Classifier: Development Status :: 6 - Mature
|
| 12 |
+
Classifier: Intended Audience :: Developers
|
| 13 |
+
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
|
| 14 |
+
Classifier: Programming Language :: Python
|
| 15 |
+
Classifier: Programming Language :: Python :: 3
|
| 16 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 17 |
+
Classifier: Topic :: Software Development
|
| 18 |
+
Classifier: Topic :: Software Development :: Libraries
|
| 19 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 20 |
+
Requires-Python: >=3.7
|
| 21 |
+
Description-Content-Type: text/markdown
|
| 22 |
+
License-File: LICENSE
|
| 23 |
+
|
| 24 |
+
[](https://badge.fury.io/py/autocommand)
|
| 25 |
+
|
| 26 |
+
# autocommand
|
| 27 |
+
|
| 28 |
+
A library to automatically generate and run simple argparse parsers from function signatures.
|
| 29 |
+
|
| 30 |
+
## Installation
|
| 31 |
+
|
| 32 |
+
Autocommand is installed via pip:
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
$ pip install autocommand
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
## Usage
|
| 39 |
+
|
| 40 |
+
Autocommand turns a function into a command-line program. It converts the function's parameter signature into command-line arguments, and automatically runs the function if the module was called as `__main__`. In effect, it lets your create a smart main function.
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from autocommand import autocommand
|
| 44 |
+
|
| 45 |
+
# This program takes exactly one argument and echos it.
|
| 46 |
+
@autocommand(__name__)
|
| 47 |
+
def echo(thing):
|
| 48 |
+
print(thing)
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
```
|
| 52 |
+
$ python echo.py hello
|
| 53 |
+
hello
|
| 54 |
+
$ python echo.py -h
|
| 55 |
+
usage: echo [-h] thing
|
| 56 |
+
|
| 57 |
+
positional arguments:
|
| 58 |
+
thing
|
| 59 |
+
|
| 60 |
+
optional arguments:
|
| 61 |
+
-h, --help show this help message and exit
|
| 62 |
+
$ python echo.py hello world # too many arguments
|
| 63 |
+
usage: echo.py [-h] thing
|
| 64 |
+
echo.py: error: unrecognized arguments: world
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
As you can see, autocommand converts the signature of the function into an argument spec. When you run the file as a program, autocommand collects the command-line arguments and turns them into function arguments. The function is executed with these arguments, and then the program exits with the return value of the function, via `sys.exit`. Autocommand also automatically creates a usage message, which can be invoked with `-h` or `--help`, and automatically prints an error message when provided with invalid arguments.
|
| 68 |
+
|
| 69 |
+
### Types
|
| 70 |
+
|
| 71 |
+
You can use a type annotation to give an argument a type. Any type (or in fact any callable) that returns an object when given a string argument can be used, though there are a few special cases that are described later.
|
| 72 |
+
|
| 73 |
+
```python
|
| 74 |
+
@autocommand(__name__)
|
| 75 |
+
def net_client(host, port: int):
|
| 76 |
+
...
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
Autocommand will catch `TypeErrors` raised by the type during argument parsing, so you can supply a callable and do some basic argument validation as well.
|
| 80 |
+
|
| 81 |
+
### Trailing Arguments
|
| 82 |
+
|
| 83 |
+
You can add a `*args` parameter to your function to give it trailing arguments. The command will collect 0 or more trailing arguments and supply them to `args` as a tuple. If a type annotation is supplied, the type is applied to each argument.
|
| 84 |
+
|
| 85 |
+
```python
|
| 86 |
+
# Write the contents of each file, one by one
|
| 87 |
+
@autocommand(__name__)
|
| 88 |
+
def cat(*files):
|
| 89 |
+
for filename in files:
|
| 90 |
+
with open(filename) as file:
|
| 91 |
+
for line in file:
|
| 92 |
+
print(line.rstrip())
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
```
|
| 96 |
+
$ python cat.py -h
|
| 97 |
+
usage: ipython [-h] [file [file ...]]
|
| 98 |
+
|
| 99 |
+
positional arguments:
|
| 100 |
+
file
|
| 101 |
+
|
| 102 |
+
optional arguments:
|
| 103 |
+
-h, --help show this help message and exit
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
### Options
|
| 107 |
+
|
| 108 |
+
To create `--option` switches, just assign a default. Autocommand will automatically create `--long` and `-s`hort switches.
|
| 109 |
+
|
| 110 |
+
```python
|
| 111 |
+
@autocommand(__name__)
|
| 112 |
+
def do_with_config(argument, config='~/foo.conf'):
|
| 113 |
+
pass
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
```
|
| 117 |
+
$ python example.py -h
|
| 118 |
+
usage: example.py [-h] [-c CONFIG] argument
|
| 119 |
+
|
| 120 |
+
positional arguments:
|
| 121 |
+
argument
|
| 122 |
+
|
| 123 |
+
optional arguments:
|
| 124 |
+
-h, --help show this help message and exit
|
| 125 |
+
-c CONFIG, --config CONFIG
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
The option's type is automatically deduced from the default, unless one is explicitly given in an annotation:
|
| 129 |
+
|
| 130 |
+
```python
|
| 131 |
+
@autocommand(__name__)
|
| 132 |
+
def http_connect(host, port=80):
|
| 133 |
+
print('{}:{}'.format(host, port))
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
```
|
| 137 |
+
$ python http.py -h
|
| 138 |
+
usage: http.py [-h] [-p PORT] host
|
| 139 |
+
|
| 140 |
+
positional arguments:
|
| 141 |
+
host
|
| 142 |
+
|
| 143 |
+
optional arguments:
|
| 144 |
+
-h, --help show this help message and exit
|
| 145 |
+
-p PORT, --port PORT
|
| 146 |
+
$ python http.py localhost
|
| 147 |
+
localhost:80
|
| 148 |
+
$ python http.py localhost -p 8080
|
| 149 |
+
localhost:8080
|
| 150 |
+
$ python http.py localhost -p blah
|
| 151 |
+
usage: http.py [-h] [-p PORT] host
|
| 152 |
+
http.py: error: argument -p/--port: invalid int value: 'blah'
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
#### None
|
| 156 |
+
|
| 157 |
+
If an option is given a default value of `None`, it reads in a value as normal, but supplies `None` if the option isn't provided.
|
| 158 |
+
|
| 159 |
+
#### Switches
|
| 160 |
+
|
| 161 |
+
If an argument is given a default value of `True` or `False`, or
|
| 162 |
+
given an explicit `bool` type, it becomes an option switch.
|
| 163 |
+
|
| 164 |
+
```python
|
| 165 |
+
@autocommand(__name__)
|
| 166 |
+
def example(verbose=False, quiet=False):
|
| 167 |
+
pass
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
```
|
| 171 |
+
$ python example.py -h
|
| 172 |
+
usage: example.py [-h] [-v] [-q]
|
| 173 |
+
|
| 174 |
+
optional arguments:
|
| 175 |
+
-h, --help show this help message and exit
|
| 176 |
+
-v, --verbose
|
| 177 |
+
-q, --quiet
|
| 178 |
+
```
|
| 179 |
+
|
| 180 |
+
Autocommand attempts to do the "correct thing" in these cases- if the default is `True`, then supplying the switch makes the argument `False`; if the type is `bool` and the default is some other `True` value, then supplying the switch makes the argument `False`, while not supplying the switch makes the argument the default value.
|
| 181 |
+
|
| 182 |
+
Autocommand also supports the creation of switch inverters. Pass `add_nos=True` to `autocommand` to enable this.
|
| 183 |
+
|
| 184 |
+
```
|
| 185 |
+
@autocommand(__name__, add_nos=True)
|
| 186 |
+
def example(verbose=False):
|
| 187 |
+
pass
|
| 188 |
+
```
|
| 189 |
+
|
| 190 |
+
```
|
| 191 |
+
$ python example.py -h
|
| 192 |
+
usage: ipython [-h] [-v] [--no-verbose]
|
| 193 |
+
|
| 194 |
+
optional arguments:
|
| 195 |
+
-h, --help show this help message and exit
|
| 196 |
+
-v, --verbose
|
| 197 |
+
--no-verbose
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
Using the `--no-` version of a switch will pass the opposite value in as a function argument. If multiple switches are present, the last one takes precedence.
|
| 201 |
+
|
| 202 |
+
#### Files
|
| 203 |
+
|
| 204 |
+
If the default value is a file object, such as `sys.stdout`, then autocommand just looks for a string, for a file path. It doesn't do any special checking on the string, though (such as checking if the file exists); it's better to let the client decide how to handle errors in this case. Instead, it provides a special context manager called `smart_open`, which behaves exactly like `open` if a filename or other openable type is provided, but also lets you use already open files:
|
| 205 |
+
|
| 206 |
+
```python
|
| 207 |
+
from autocommand import autocommand, smart_open
|
| 208 |
+
import sys
|
| 209 |
+
|
| 210 |
+
# Write the contents of stdin, or a file, to stdout
|
| 211 |
+
@autocommand(__name__)
|
| 212 |
+
def write_out(infile=sys.stdin):
|
| 213 |
+
with smart_open(infile) as f:
|
| 214 |
+
for line in f:
|
| 215 |
+
print(line.rstrip())
|
| 216 |
+
# If a file was opened, it is closed here. If it was just stdin, it is untouched.
|
| 217 |
+
```
|
| 218 |
+
|
| 219 |
+
```
|
| 220 |
+
$ echo "Hello World!" | python write_out.py | tee hello.txt
|
| 221 |
+
Hello World!
|
| 222 |
+
$ python write_out.py --infile hello.txt
|
| 223 |
+
Hello World!
|
| 224 |
+
```
|
| 225 |
+
|
| 226 |
+
### Descriptions and docstrings
|
| 227 |
+
|
| 228 |
+
The `autocommand` decorator accepts `description` and `epilog` kwargs, corresponding to the `description <https://docs.python.org/3/library/argparse.html#description>`_ and `epilog <https://docs.python.org/3/library/argparse.html#epilog>`_ of the `ArgumentParser`. If no description is given, but the decorated function has a docstring, then it is taken as the `description` for the `ArgumentParser`. You can also provide both the description and epilog in the docstring by splitting it into two sections with 4 or more - characters.
|
| 229 |
+
|
| 230 |
+
```python
|
| 231 |
+
@autocommand(__name__)
|
| 232 |
+
def copy(infile=sys.stdin, outfile=sys.stdout):
|
| 233 |
+
'''
|
| 234 |
+
Copy an the contents of a file (or stdin) to another file (or stdout)
|
| 235 |
+
----------
|
| 236 |
+
Some extra documentation in the epilog
|
| 237 |
+
'''
|
| 238 |
+
with smart_open(infile) as istr:
|
| 239 |
+
with smart_open(outfile, 'w') as ostr:
|
| 240 |
+
for line in istr:
|
| 241 |
+
ostr.write(line)
|
| 242 |
+
```
|
| 243 |
+
|
| 244 |
+
```
|
| 245 |
+
$ python copy.py -h
|
| 246 |
+
usage: copy.py [-h] [-i INFILE] [-o OUTFILE]
|
| 247 |
+
|
| 248 |
+
Copy an the contents of a file (or stdin) to another file (or stdout)
|
| 249 |
+
|
| 250 |
+
optional arguments:
|
| 251 |
+
-h, --help show this help message and exit
|
| 252 |
+
-i INFILE, --infile INFILE
|
| 253 |
+
-o OUTFILE, --outfile OUTFILE
|
| 254 |
+
|
| 255 |
+
Some extra documentation in the epilog
|
| 256 |
+
$ echo "Hello World" | python copy.py --outfile hello.txt
|
| 257 |
+
$ python copy.py --infile hello.txt --outfile hello2.txt
|
| 258 |
+
$ python copy.py --infile hello2.txt
|
| 259 |
+
Hello World
|
| 260 |
+
```
|
| 261 |
+
|
| 262 |
+
### Parameter descriptions
|
| 263 |
+
|
| 264 |
+
You can also attach description text to individual parameters in the annotation. To attach both a type and a description, supply them both in any order in a tuple
|
| 265 |
+
|
| 266 |
+
```python
|
| 267 |
+
@autocommand(__name__)
|
| 268 |
+
def copy_net(
|
| 269 |
+
infile: 'The name of the file to send',
|
| 270 |
+
host: 'The host to send the file to',
|
| 271 |
+
port: (int, 'The port to connect to')):
|
| 272 |
+
|
| 273 |
+
'''
|
| 274 |
+
Copy a file over raw TCP to a remote destination.
|
| 275 |
+
'''
|
| 276 |
+
# Left as an exercise to the reader
|
| 277 |
+
```
|
| 278 |
+
|
| 279 |
+
### Decorators and wrappers
|
| 280 |
+
|
| 281 |
+
Autocommand automatically follows wrapper chains created by `@functools.wraps`. This means that you can apply other wrapping decorators to your main function, and autocommand will still correctly detect the signature.
|
| 282 |
+
|
| 283 |
+
```python
|
| 284 |
+
from functools import wraps
|
| 285 |
+
from autocommand import autocommand
|
| 286 |
+
|
| 287 |
+
def print_yielded(func):
|
| 288 |
+
'''
|
| 289 |
+
Convert a generator into a function that prints all yielded elements
|
| 290 |
+
'''
|
| 291 |
+
@wraps(func)
|
| 292 |
+
def wrapper(*args, **kwargs):
|
| 293 |
+
for thing in func(*args, **kwargs):
|
| 294 |
+
print(thing)
|
| 295 |
+
return wrapper
|
| 296 |
+
|
| 297 |
+
@autocommand(__name__,
|
| 298 |
+
description= 'Print all the values from START to STOP, inclusive, in steps of STEP',
|
| 299 |
+
epilog= 'STOP and STEP default to 1')
|
| 300 |
+
@print_yielded
|
| 301 |
+
def seq(stop, start=1, step=1):
|
| 302 |
+
for i in range(start, stop + 1, step):
|
| 303 |
+
yield i
|
| 304 |
+
```
|
| 305 |
+
|
| 306 |
+
```
|
| 307 |
+
$ seq.py -h
|
| 308 |
+
usage: seq.py [-h] [-s START] [-S STEP] stop
|
| 309 |
+
|
| 310 |
+
Print all the values from START to STOP, inclusive, in steps of STEP
|
| 311 |
+
|
| 312 |
+
positional arguments:
|
| 313 |
+
stop
|
| 314 |
+
|
| 315 |
+
optional arguments:
|
| 316 |
+
-h, --help show this help message and exit
|
| 317 |
+
-s START, --start START
|
| 318 |
+
-S STEP, --step STEP
|
| 319 |
+
|
| 320 |
+
STOP and STEP default to 1
|
| 321 |
+
```
|
| 322 |
+
|
| 323 |
+
Even though autocommand is being applied to the `wrapper` returned by `print_yielded`, it still retreives the signature of the underlying `seq` function to create the argument parsing.
|
| 324 |
+
|
| 325 |
+
### Custom Parser
|
| 326 |
+
|
| 327 |
+
While autocommand's automatic parser generator is a powerful convenience, it doesn't cover all of the different features that argparse provides. If you need these features, you can provide your own parser as a kwarg to `autocommand`:
|
| 328 |
+
|
| 329 |
+
```python
|
| 330 |
+
from argparse import ArgumentParser
|
| 331 |
+
from autocommand import autocommand
|
| 332 |
+
|
| 333 |
+
parser = ArgumentParser()
|
| 334 |
+
# autocommand can't do optional positonal parameters
|
| 335 |
+
parser.add_argument('arg', nargs='?')
|
| 336 |
+
# or mutually exclusive options
|
| 337 |
+
group = parser.add_mutually_exclusive_group()
|
| 338 |
+
group.add_argument('-v', '--verbose', action='store_true')
|
| 339 |
+
group.add_argument('-q', '--quiet', action='store_true')
|
| 340 |
+
|
| 341 |
+
@autocommand(__name__, parser=parser)
|
| 342 |
+
def main(arg, verbose, quiet):
|
| 343 |
+
print(arg, verbose, quiet)
|
| 344 |
+
```
|
| 345 |
+
|
| 346 |
+
```
|
| 347 |
+
$ python parser.py -h
|
| 348 |
+
usage: write_file.py [-h] [-v | -q] [arg]
|
| 349 |
+
|
| 350 |
+
positional arguments:
|
| 351 |
+
arg
|
| 352 |
+
|
| 353 |
+
optional arguments:
|
| 354 |
+
-h, --help show this help message and exit
|
| 355 |
+
-v, --verbose
|
| 356 |
+
-q, --quiet
|
| 357 |
+
$ python parser.py
|
| 358 |
+
None False False
|
| 359 |
+
$ python parser.py hello
|
| 360 |
+
hello False False
|
| 361 |
+
$ python parser.py -v
|
| 362 |
+
None True False
|
| 363 |
+
$ python parser.py -q
|
| 364 |
+
None False True
|
| 365 |
+
$ python parser.py -vq
|
| 366 |
+
usage: parser.py [-h] [-v | -q] [arg]
|
| 367 |
+
parser.py: error: argument -q/--quiet: not allowed with argument -v/--verbose
|
| 368 |
+
```
|
| 369 |
+
|
| 370 |
+
Any parser should work fine, so long as each of the parser's arguments has a corresponding parameter in the decorated main function. The order of parameters doesn't matter, as long as they are all present. Note that when using a custom parser, autocommand doesn't modify the parser or the retrieved arguments. This means that no description/epilog will be added, and the function's type annotations and defaults (if present) will be ignored.
|
| 371 |
+
|
| 372 |
+
## Testing and Library use
|
| 373 |
+
|
| 374 |
+
The decorated function is only called and exited from if the first argument to `autocommand` is `'__main__'` or `True`. If it is neither of these values, or no argument is given, then a new main function is created by the decorator. This function has the signature `main(argv=None)`, and is intended to be called with arguments as if via `main(sys.argv[1:])`. The function has the attributes `parser` and `main`, which are the generated `ArgumentParser` and the original main function that was decorated. This is to facilitate testing and library use of your main. Calling the function triggers a `parse_args()` with the supplied arguments, and returns the result of the main function. Note that, while it returns instead of calling `sys.exit`, the `parse_args()` function will raise a `SystemExit` in the event of a parsing error or `-h/--help` argument.
|
| 375 |
+
|
| 376 |
+
```python
|
| 377 |
+
@autocommand()
|
| 378 |
+
def test_prog(arg1, arg2: int, quiet=False, verbose=False):
|
| 379 |
+
if not quiet:
|
| 380 |
+
print(arg1, arg2)
|
| 381 |
+
if verbose:
|
| 382 |
+
print("LOUD NOISES")
|
| 383 |
+
|
| 384 |
+
return 0
|
| 385 |
+
|
| 386 |
+
print(test_prog(['-v', 'hello', '80']))
|
| 387 |
+
```
|
| 388 |
+
|
| 389 |
+
```
|
| 390 |
+
$ python test_prog.py
|
| 391 |
+
hello 80
|
| 392 |
+
LOUD NOISES
|
| 393 |
+
0
|
| 394 |
+
```
|
| 395 |
+
|
| 396 |
+
If the function is called with no arguments, `sys.argv[1:]` is used. This is to allow the autocommand function to be used as a setuptools entry point.
|
| 397 |
+
|
| 398 |
+
## Exceptions and limitations
|
| 399 |
+
|
| 400 |
+
- There are a few possible exceptions that `autocommand` can raise. All of them derive from `autocommand.AutocommandError`.
|
| 401 |
+
|
| 402 |
+
- If an invalid annotation is given (that is, it isn't a `type`, `str`, `(type, str)`, or `(str, type)`, an `AnnotationError` is raised. The `type` may be any callable, as described in the `Types`_ section.
|
| 403 |
+
- If the function has a `**kwargs` parameter, a `KWargError` is raised.
|
| 404 |
+
- If, somehow, the function has a positional-only parameter, a `PositionalArgError` is raised. This means that the argument doesn't have a name, which is currently not possible with a plain `def` or `lambda`, though many built-in functions have this kind of parameter.
|
| 405 |
+
|
| 406 |
+
- There are a few argparse features that are not supported by autocommand.
|
| 407 |
+
|
| 408 |
+
- It isn't possible to have an optional positional argument (as opposed to a `--option`). POSIX thinks this is bad form anyway.
|
| 409 |
+
- It isn't possible to have mutually exclusive arguments or options
|
| 410 |
+
- It isn't possible to have subcommands or subparsers, though I'm working on a few solutions involving classes or nested function definitions to allow this.
|
| 411 |
+
|
| 412 |
+
## Development
|
| 413 |
+
|
| 414 |
+
Autocommand cannot be important from the project root; this is to enforce separation of concerns and prevent accidental importing of `setup.py` or tests. To develop, install the project in editable mode:
|
| 415 |
+
|
| 416 |
+
```
|
| 417 |
+
$ python setup.py develop
|
| 418 |
+
```
|
| 419 |
+
|
| 420 |
+
This will create a link to the source files in the deployment directory, so that any source changes are reflected when it is imported.
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/RECORD
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
autocommand-2.2.2.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
|
| 2 |
+
autocommand-2.2.2.dist-info/LICENSE,sha256=reeNBJgtaZctREqOFKlPh6IzTdOFXMgDSOqOJAqg3y0,7634
|
| 3 |
+
autocommand-2.2.2.dist-info/METADATA,sha256=OADZuR3O6iBlpu1ieTgzYul6w4uOVrk0P0BO5TGGAJk,15006
|
| 4 |
+
autocommand-2.2.2.dist-info/RECORD,,
|
| 5 |
+
autocommand-2.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
autocommand-2.2.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
| 7 |
+
autocommand-2.2.2.dist-info/top_level.txt,sha256=AzfhgKKS8EdAwWUTSF8mgeVQbXOY9kokHB6kSqwwqu0,12
|
| 8 |
+
autocommand/__init__.py,sha256=zko5Rnvolvb-UXjCx_2ArPTGBWwUK5QY4LIQIKYR7As,1037
|
| 9 |
+
autocommand/autoasync.py,sha256=AMdyrxNS4pqWJfP_xuoOcImOHWD-qT7x06wmKN1Vp-U,5680
|
| 10 |
+
autocommand/autocommand.py,sha256=hmkEmQ72HtL55gnURVjDOnsfYlGd5lLXbvT4KG496Qw,2505
|
| 11 |
+
autocommand/automain.py,sha256=A2b8i754Mxc_DjU9WFr6vqYDWlhz0cn8miu8d8EsxV8,2076
|
| 12 |
+
autocommand/autoparse.py,sha256=WVWmZJPcbzUKXP40raQw_0HD8qPJ2V9VG1eFFmmnFxw,11642
|
| 13 |
+
autocommand/errors.py,sha256=7aa3roh9Herd6nIKpQHNWEslWE8oq7GiHYVUuRqORnA,886
|
TTS/Kokoro/.venv/Lib/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/REQUESTED
ADDED
|
File without changes
|