wan-cli 2026.4.5.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.
@@ -0,0 +1,5 @@
1
+ # Wan CLI Environment
2
+ ACEDATACLOUD_API_TOKEN=your_api_token_here
3
+ # ACEDATACLOUD_API_BASE_URL=https://api.acedata.cloud
4
+ # WAN_DEFAULT_MODEL=wan2.6-t2v
5
+ # WAN_REQUEST_TIMEOUT=1800
@@ -0,0 +1,18 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ *.egg
9
+ .env
10
+ .venv/
11
+ venv/
12
+ .pytest_cache/
13
+ .mypy_cache/
14
+ .ruff_cache/
15
+ .coverage
16
+ htmlcov/
17
+ coverage.xml
18
+ *.so
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Calendar Versioning](https://calver.org/) (YYYY.MM.DD.BUILD).
7
+
8
+ ## [0.1.0] - 2026-04-05
9
+
10
+ ### Added
11
+ - Initial release
12
+ - Wan video generation from text prompts (text2video)
13
+ - Image-to-video generation (image2video)
14
+ - Task management with polling
15
+ - Rich terminal output with tables and panels
16
+ - JSON output mode (`--json` flag)
17
+ - Multiple model support (wan2.6-t2v, wan2.6-i2v, wan2.6-i2v-flash, wan2.6-r2v)
18
+ - Resolution control (480P, 720P, 1080P)
19
+ - Shot type selection (single, multi)
20
+ - Duration control (5, 10, 15 seconds)
21
+ - Audio generation support
22
+ - Prompt intelligent rewriting support
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AceDataCloud
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.
@@ -0,0 +1,240 @@
1
+ Metadata-Version: 2.1
2
+ Name: wan-cli
3
+ Version: 2026.4.5.0
4
+ Summary: CLI tool for Tongyi Wansiang AI Video Generation via AceDataCloud API
5
+ Project-URL: Homepage, https://github.com/AceDataCloud/WanCli
6
+ Project-URL: Repository, https://github.com/AceDataCloud/WanCli
7
+ Project-URL: Issues, https://github.com/AceDataCloud/WanCli/issues
8
+ Project-URL: Changelog, https://github.com/AceDataCloud/WanCli/blob/main/CHANGELOG.md
9
+ Author-email: AceDataCloud <support@acedata.cloud>
10
+ Maintainer-email: AceDataCloud <support@acedata.cloud>
11
+ License: MIT
12
+ License-File: LICENSE
13
+ Keywords: acedata,ai,cli,command-line,generation,video,wan,wansiang
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Multimedia :: Video
24
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
+ Requires-Python: >=3.10
26
+ Requires-Dist: click>=8.1.0
27
+ Requires-Dist: httpx>=0.27.0
28
+ Requires-Dist: pydantic>=2.0.0
29
+ Requires-Dist: python-dotenv>=1.0.0
30
+ Requires-Dist: rich>=13.0.0
31
+ Provides-Extra: all
32
+ Requires-Dist: wan-cli[dev,release,test]; extra == 'all'
33
+ Provides-Extra: dev
34
+ Requires-Dist: mypy>=1.10.0; extra == 'dev'
35
+ Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
36
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
37
+ Provides-Extra: release
38
+ Requires-Dist: build>=1.2.0; extra == 'release'
39
+ Requires-Dist: twine>=6.1.0; extra == 'release'
40
+ Provides-Extra: test
41
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'test'
42
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'test'
43
+ Requires-Dist: pytest>=8.0.0; extra == 'test'
44
+ Requires-Dist: respx>=0.21.0; extra == 'test'
45
+ Description-Content-Type: text/markdown
46
+
47
+ # Wan CLI
48
+
49
+ [![PyPI version](https://img.shields.io/pypi/v/wan-cli.svg)](https://pypi.org/project/wan-cli/)
50
+ [![PyPI downloads](https://img.shields.io/pypi/dm/wan-cli.svg)](https://pypi.org/project/wan-cli/)
51
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
52
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
53
+
54
+ A command-line tool for AI video generation using [Tongyi Wansiang](https://platform.acedata.cloud/) through the [AceDataCloud API](https://platform.acedata.cloud/).
55
+
56
+ Generate AI videos directly from your terminal — no MCP client required.
57
+
58
+ ## Features
59
+
60
+ - **Video Generation** — Generate videos from text prompts with multiple models
61
+ - **Image-to-Video** — Create videos from reference images
62
+ - **Multiple Models** — wan2.6-t2v, wan2.6-i2v, wan2.6-i2v-flash, wan2.6-r2v
63
+ - **Task Management** — Query tasks, batch query, wait with polling
64
+ - **Rich Output** — Beautiful terminal tables and panels via Rich
65
+ - **JSON Mode** — Machine-readable output with `--json` for piping
66
+
67
+ ## Quick Start
68
+
69
+ ### 1. Get API Token
70
+
71
+ Get your API token from [AceDataCloud Platform](https://platform.acedata.cloud/):
72
+
73
+ 1. Sign up or log in
74
+ 2. Navigate to the Wan API page
75
+ 3. Click "Acquire" to get your token
76
+
77
+ ### 2. Install
78
+
79
+ ```bash
80
+ # Install with pip
81
+ pip install wan-cli
82
+
83
+ # Or with uv (recommended)
84
+ uv pip install wan-cli
85
+
86
+ # Or from source
87
+ git clone https://github.com/AceDataCloud/WanCli.git
88
+ cd WanCli
89
+ pip install -e .
90
+ ```
91
+
92
+ ### 3. Configure
93
+
94
+ ```bash
95
+ # Set your API token
96
+ export ACEDATACLOUD_API_TOKEN=your_token_here
97
+
98
+ # Or use .env file
99
+ cp .env.example .env
100
+ # Edit .env with your token
101
+ ```
102
+
103
+ ### 4. Use
104
+
105
+ ```bash
106
+ # Generate a video from text
107
+ wan generate "Astronauts shuttle from space to volcano"
108
+
109
+ # Generate from reference image
110
+ wan image-to-video "Animate this scene" -i https://example.com/photo.jpg
111
+
112
+ # Check task status
113
+ wan task <task-id>
114
+
115
+ # Wait for completion
116
+ wan wait <task-id> --interval 5
117
+
118
+ # List available models
119
+ wan models
120
+ ```
121
+
122
+ ## Commands
123
+
124
+ | Command | Description |
125
+ |---------|-------------|
126
+ | `wan generate <prompt>` | Generate a video from a text prompt |
127
+ | `wan image-to-video <prompt> -i <url>` | Generate a video from a reference image |
128
+ | `wan task <task_id>` | Query a single task status |
129
+ | `wan tasks <id1> <id2>...` | Query multiple tasks at once |
130
+ | `wan wait <task_id>` | Wait for task completion with polling |
131
+ | `wan models` | List available Wan models |
132
+ | `wan resolutions` | List available resolutions |
133
+ | `wan config` | Show current configuration |
134
+
135
+
136
+ ## Global Options
137
+
138
+ ```
139
+ --token TEXT API token (or set ACEDATACLOUD_API_TOKEN env var)
140
+ --version Show version
141
+ --help Show help message
142
+ ```
143
+
144
+ Most commands support:
145
+
146
+ ```
147
+ --json Output raw JSON (for piping/scripting)
148
+ --model TEXT Wan model version (default: wan2.6-t2v)
149
+ --resolution TEXT Output resolution: 480P, 720P, 1080P
150
+ --duration TEXT Duration in seconds: 5, 10, 15
151
+ --shot-type TEXT Shot type: single, multi
152
+ --audio/--no-audio Whether the video has sound
153
+ --prompt-extend/--no-prompt-extend Enable prompt intelligent rewriting
154
+ ```
155
+
156
+ ## Available Models
157
+
158
+ | Model | Type | Notes |
159
+ |-------|------|-------|
160
+ | `wan2.6-t2v` | Text-to-Video | Text-to-video generation (default) |
161
+ | `wan2.6-i2v` | Image-to-Video | Image-to-video generation |
162
+ | `wan2.6-i2v-flash` | Image-to-Video Flash | Fast image-to-video generation |
163
+ | `wan2.6-r2v` | Reference-to-Video | Reference video-to-video generation |
164
+
165
+
166
+ ## Configuration
167
+
168
+ ### Environment Variables
169
+
170
+ | Variable | Description | Default |
171
+ |----------|-------------|---------|
172
+ | `ACEDATACLOUD_API_TOKEN` | API token from AceDataCloud | *Required* |
173
+ | `ACEDATACLOUD_API_BASE_URL` | API base URL | `https://api.acedata.cloud` |
174
+ | `WAN_DEFAULT_MODEL` | Default model | `wan2.6-t2v` |
175
+ | `WAN_REQUEST_TIMEOUT` | Timeout in seconds | `1800` |
176
+
177
+ ## Development
178
+
179
+ ### Setup Development Environment
180
+
181
+ ```bash
182
+ git clone https://github.com/AceDataCloud/WanCli.git
183
+ cd WanCli
184
+ python -m venv .venv
185
+ source .venv/bin/activate
186
+ pip install -e ".[dev,test]"
187
+ ```
188
+
189
+ ### Run Tests
190
+
191
+ ```bash
192
+ pytest
193
+ pytest --cov=wan_cli
194
+ pytest tests/test_integration.py -m integration
195
+ ```
196
+
197
+ ### Code Quality
198
+
199
+ ```bash
200
+ ruff format .
201
+ ruff check .
202
+ mypy wan_cli
203
+ ```
204
+
205
+ ## Docker
206
+
207
+ ```bash
208
+ docker pull ghcr.io/acedatacloud/wan-cli:latest
209
+ docker run --rm -e ACEDATACLOUD_API_TOKEN=your_token \
210
+ ghcr.io/acedatacloud/wan-cli generate "Astronauts shuttle from space to volcano"
211
+ ```
212
+
213
+ ## Project Structure
214
+
215
+ ```
216
+ WanCli/
217
+ ├── wan_cli/ # Main package
218
+ │ ├── __init__.py
219
+ │ ├── __main__.py # python -m wan_cli entry point
220
+ │ ├── main.py # CLI entry point
221
+ │ ├── core/ # Core modules
222
+ │ │ ├── client.py # HTTP client for Wan API
223
+ │ │ ├── config.py # Configuration management
224
+ │ │ ├── exceptions.py # Custom exceptions
225
+ │ │ └── output.py # Rich terminal formatting
226
+ │ └── commands/ # CLI command groups
227
+ │ ├── video.py # Video generation commands
228
+ │ ├── task.py # Task management commands
229
+ │ └── info.py # Info & utility commands
230
+ ├── tests/ # Test suite
231
+ ├── Dockerfile # Container image
232
+ ├── deploy/ # Kubernetes deployment configs
233
+ ├── .env.example # Environment template
234
+ ├── pyproject.toml # Project configuration
235
+ └── README.md
236
+ ```
237
+
238
+ ## License
239
+
240
+ This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,194 @@
1
+ # Wan CLI
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/wan-cli.svg)](https://pypi.org/project/wan-cli/)
4
+ [![PyPI downloads](https://img.shields.io/pypi/dm/wan-cli.svg)](https://pypi.org/project/wan-cli/)
5
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ A command-line tool for AI video generation using [Tongyi Wansiang](https://platform.acedata.cloud/) through the [AceDataCloud API](https://platform.acedata.cloud/).
9
+
10
+ Generate AI videos directly from your terminal — no MCP client required.
11
+
12
+ ## Features
13
+
14
+ - **Video Generation** — Generate videos from text prompts with multiple models
15
+ - **Image-to-Video** — Create videos from reference images
16
+ - **Multiple Models** — wan2.6-t2v, wan2.6-i2v, wan2.6-i2v-flash, wan2.6-r2v
17
+ - **Task Management** — Query tasks, batch query, wait with polling
18
+ - **Rich Output** — Beautiful terminal tables and panels via Rich
19
+ - **JSON Mode** — Machine-readable output with `--json` for piping
20
+
21
+ ## Quick Start
22
+
23
+ ### 1. Get API Token
24
+
25
+ Get your API token from [AceDataCloud Platform](https://platform.acedata.cloud/):
26
+
27
+ 1. Sign up or log in
28
+ 2. Navigate to the Wan API page
29
+ 3. Click "Acquire" to get your token
30
+
31
+ ### 2. Install
32
+
33
+ ```bash
34
+ # Install with pip
35
+ pip install wan-cli
36
+
37
+ # Or with uv (recommended)
38
+ uv pip install wan-cli
39
+
40
+ # Or from source
41
+ git clone https://github.com/AceDataCloud/WanCli.git
42
+ cd WanCli
43
+ pip install -e .
44
+ ```
45
+
46
+ ### 3. Configure
47
+
48
+ ```bash
49
+ # Set your API token
50
+ export ACEDATACLOUD_API_TOKEN=your_token_here
51
+
52
+ # Or use .env file
53
+ cp .env.example .env
54
+ # Edit .env with your token
55
+ ```
56
+
57
+ ### 4. Use
58
+
59
+ ```bash
60
+ # Generate a video from text
61
+ wan generate "Astronauts shuttle from space to volcano"
62
+
63
+ # Generate from reference image
64
+ wan image-to-video "Animate this scene" -i https://example.com/photo.jpg
65
+
66
+ # Check task status
67
+ wan task <task-id>
68
+
69
+ # Wait for completion
70
+ wan wait <task-id> --interval 5
71
+
72
+ # List available models
73
+ wan models
74
+ ```
75
+
76
+ ## Commands
77
+
78
+ | Command | Description |
79
+ |---------|-------------|
80
+ | `wan generate <prompt>` | Generate a video from a text prompt |
81
+ | `wan image-to-video <prompt> -i <url>` | Generate a video from a reference image |
82
+ | `wan task <task_id>` | Query a single task status |
83
+ | `wan tasks <id1> <id2>...` | Query multiple tasks at once |
84
+ | `wan wait <task_id>` | Wait for task completion with polling |
85
+ | `wan models` | List available Wan models |
86
+ | `wan resolutions` | List available resolutions |
87
+ | `wan config` | Show current configuration |
88
+
89
+
90
+ ## Global Options
91
+
92
+ ```
93
+ --token TEXT API token (or set ACEDATACLOUD_API_TOKEN env var)
94
+ --version Show version
95
+ --help Show help message
96
+ ```
97
+
98
+ Most commands support:
99
+
100
+ ```
101
+ --json Output raw JSON (for piping/scripting)
102
+ --model TEXT Wan model version (default: wan2.6-t2v)
103
+ --resolution TEXT Output resolution: 480P, 720P, 1080P
104
+ --duration TEXT Duration in seconds: 5, 10, 15
105
+ --shot-type TEXT Shot type: single, multi
106
+ --audio/--no-audio Whether the video has sound
107
+ --prompt-extend/--no-prompt-extend Enable prompt intelligent rewriting
108
+ ```
109
+
110
+ ## Available Models
111
+
112
+ | Model | Type | Notes |
113
+ |-------|------|-------|
114
+ | `wan2.6-t2v` | Text-to-Video | Text-to-video generation (default) |
115
+ | `wan2.6-i2v` | Image-to-Video | Image-to-video generation |
116
+ | `wan2.6-i2v-flash` | Image-to-Video Flash | Fast image-to-video generation |
117
+ | `wan2.6-r2v` | Reference-to-Video | Reference video-to-video generation |
118
+
119
+
120
+ ## Configuration
121
+
122
+ ### Environment Variables
123
+
124
+ | Variable | Description | Default |
125
+ |----------|-------------|---------|
126
+ | `ACEDATACLOUD_API_TOKEN` | API token from AceDataCloud | *Required* |
127
+ | `ACEDATACLOUD_API_BASE_URL` | API base URL | `https://api.acedata.cloud` |
128
+ | `WAN_DEFAULT_MODEL` | Default model | `wan2.6-t2v` |
129
+ | `WAN_REQUEST_TIMEOUT` | Timeout in seconds | `1800` |
130
+
131
+ ## Development
132
+
133
+ ### Setup Development Environment
134
+
135
+ ```bash
136
+ git clone https://github.com/AceDataCloud/WanCli.git
137
+ cd WanCli
138
+ python -m venv .venv
139
+ source .venv/bin/activate
140
+ pip install -e ".[dev,test]"
141
+ ```
142
+
143
+ ### Run Tests
144
+
145
+ ```bash
146
+ pytest
147
+ pytest --cov=wan_cli
148
+ pytest tests/test_integration.py -m integration
149
+ ```
150
+
151
+ ### Code Quality
152
+
153
+ ```bash
154
+ ruff format .
155
+ ruff check .
156
+ mypy wan_cli
157
+ ```
158
+
159
+ ## Docker
160
+
161
+ ```bash
162
+ docker pull ghcr.io/acedatacloud/wan-cli:latest
163
+ docker run --rm -e ACEDATACLOUD_API_TOKEN=your_token \
164
+ ghcr.io/acedatacloud/wan-cli generate "Astronauts shuttle from space to volcano"
165
+ ```
166
+
167
+ ## Project Structure
168
+
169
+ ```
170
+ WanCli/
171
+ ├── wan_cli/ # Main package
172
+ │ ├── __init__.py
173
+ │ ├── __main__.py # python -m wan_cli entry point
174
+ │ ├── main.py # CLI entry point
175
+ │ ├── core/ # Core modules
176
+ │ │ ├── client.py # HTTP client for Wan API
177
+ │ │ ├── config.py # Configuration management
178
+ │ │ ├── exceptions.py # Custom exceptions
179
+ │ │ └── output.py # Rich terminal formatting
180
+ │ └── commands/ # CLI command groups
181
+ │ ├── video.py # Video generation commands
182
+ │ ├── task.py # Task management commands
183
+ │ └── info.py # Info & utility commands
184
+ ├── tests/ # Test suite
185
+ ├── Dockerfile # Container image
186
+ ├── deploy/ # Kubernetes deployment configs
187
+ ├── .env.example # Environment template
188
+ ├── pyproject.toml # Project configuration
189
+ └── README.md
190
+ ```
191
+
192
+ ## License
193
+
194
+ This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,119 @@
1
+ [project]
2
+ name = "wan-cli"
3
+ version = "2026.4.5.0"
4
+ description = "CLI tool for Tongyi Wansiang AI Video Generation via AceDataCloud API"
5
+ readme = "README.md"
6
+ license = { text = "MIT" }
7
+ requires-python = ">=3.10"
8
+ authors = [
9
+ { name = "AceDataCloud", email = "support@acedata.cloud" }
10
+ ]
11
+ maintainers = [
12
+ { name = "AceDataCloud", email = "support@acedata.cloud" }
13
+ ]
14
+ keywords = [
15
+ "cli",
16
+ "wan",
17
+ "wansiang",
18
+ "ai",
19
+ "video",
20
+ "generation",
21
+ "acedata",
22
+ "command-line"
23
+ ]
24
+ classifiers = [
25
+ "Development Status :: 4 - Beta",
26
+ "Intended Audience :: Developers",
27
+ "License :: OSI Approved :: MIT License",
28
+ "Operating System :: OS Independent",
29
+ "Programming Language :: Python :: 3",
30
+ "Programming Language :: Python :: 3.10",
31
+ "Programming Language :: Python :: 3.11",
32
+ "Programming Language :: Python :: 3.12",
33
+ "Topic :: Multimedia :: Video",
34
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
35
+ "Environment :: Console",
36
+ ]
37
+ dependencies = [
38
+ "click>=8.1.0",
39
+ "httpx>=0.27.0",
40
+ "python-dotenv>=1.0.0",
41
+ "rich>=13.0.0",
42
+ "pydantic>=2.0.0",
43
+ ]
44
+
45
+ [project.optional-dependencies]
46
+ dev = [
47
+ "ruff>=0.4.0",
48
+ "mypy>=1.10.0",
49
+ "pre-commit>=3.7.0",
50
+ ]
51
+ test = [
52
+ "pytest>=8.0.0",
53
+ "pytest-asyncio>=0.23.0",
54
+ "pytest-cov>=5.0.0",
55
+ "respx>=0.21.0",
56
+ ]
57
+ release = [
58
+ "build>=1.2.0",
59
+ "twine>=6.1.0",
60
+ ]
61
+ all = [
62
+ "wan-cli[dev,test,release]",
63
+ ]
64
+
65
+ [project.scripts]
66
+ wan-cli = "wan_cli.main:cli"
67
+ wan = "wan_cli.main:cli"
68
+
69
+ [project.urls]
70
+ Homepage = "https://github.com/AceDataCloud/WanCli"
71
+ Repository = "https://github.com/AceDataCloud/WanCli"
72
+ Issues = "https://github.com/AceDataCloud/WanCli/issues"
73
+ Changelog = "https://github.com/AceDataCloud/WanCli/blob/main/CHANGELOG.md"
74
+
75
+ [build-system]
76
+ requires = ["hatchling>=1.21.0,<1.22.0"]
77
+ build-backend = "hatchling.build"
78
+
79
+ [tool.hatch.build.targets.wheel]
80
+ packages = ["wan_cli"]
81
+
82
+ [tool.hatch.build.targets.sdist]
83
+ include = [
84
+ "wan_cli/",
85
+ "tests/",
86
+ "README.md",
87
+ "LICENSE",
88
+ "CHANGELOG.md",
89
+ ".env.example",
90
+ ]
91
+
92
+ # Mypy Configuration
93
+ [tool.mypy]
94
+ python_version = "3.10"
95
+ warn_return_any = true
96
+ warn_unused_configs = true
97
+ disallow_untyped_defs = true
98
+ check_untyped_defs = true
99
+
100
+ # Pytest Configuration
101
+ [tool.pytest.ini_options]
102
+ testpaths = ["tests"]
103
+ asyncio_mode = "auto"
104
+ markers = [
105
+ "integration: marks tests that require real API access",
106
+ "slow: marks slow tests",
107
+ ]
108
+
109
+ # Ruff Configuration
110
+ [tool.ruff]
111
+ line-length = 100
112
+ target-version = "py310"
113
+
114
+ [tool.ruff.lint]
115
+ select = ["E", "W", "F", "I", "B", "C4", "UP", "ARG", "SIM"]
116
+ ignore = ["E501"]
117
+
118
+ [tool.ruff.format]
119
+ quote-style = "double"
File without changes
@@ -0,0 +1,76 @@
1
+ """Pytest configuration and fixtures."""
2
+
3
+ import os
4
+ import sys
5
+ from pathlib import Path
6
+
7
+ import pytest
8
+ from dotenv import load_dotenv
9
+
10
+ # Add project root to path
11
+ project_root = Path(__file__).parent.parent
12
+ sys.path.insert(0, str(project_root))
13
+
14
+ # Load .env file for tests
15
+ load_dotenv(dotenv_path=project_root / ".env")
16
+
17
+ # Set default log level for tests
18
+ os.environ.setdefault("LOG_LEVEL", "DEBUG")
19
+
20
+
21
+ @pytest.fixture
22
+ def api_token():
23
+ """Get API token from environment for integration tests."""
24
+ token = os.environ.get("ACEDATACLOUD_API_TOKEN", "")
25
+ if not token:
26
+ pytest.skip("ACEDATACLOUD_API_TOKEN not configured for integration tests")
27
+ return token
28
+
29
+
30
+ @pytest.fixture
31
+ def mock_video_response():
32
+ """Mock successful video generation response."""
33
+ return {
34
+ "success": True,
35
+ "task_id": "test-task-123",
36
+ "trace_id": "test-trace-456",
37
+ "data": [
38
+ {
39
+ "id": "video-id-1",
40
+ "state": "succeeded",
41
+ "model_name": "wan2.6-t2v",
42
+ "video_url": "https://cdn.example.com/test-video.mp4",
43
+ "created_at": "2025-01-21T00:00:00.000Z",
44
+ }
45
+ ],
46
+ }
47
+
48
+
49
+ @pytest.fixture
50
+ def mock_task_response():
51
+ """Mock task query response."""
52
+ return {
53
+ "success": True,
54
+ "data": [
55
+ {
56
+ "id": "task-123",
57
+ "status": "completed",
58
+ "state": "succeeded",
59
+ "video_url": "https://cdn.example.com/test-video.mp4",
60
+ "model_name": "wan2.6-t2v",
61
+ "created_at": "2025-01-21T00:00:00.000Z",
62
+ }
63
+ ],
64
+ }
65
+
66
+
67
+ @pytest.fixture
68
+ def mock_error_response():
69
+ """Mock error response."""
70
+ return {
71
+ "success": False,
72
+ "error": {
73
+ "code": "invalid_request",
74
+ "message": "Invalid parameters provided",
75
+ },
76
+ }