| 1 | [build-system] |
| 2 | requires = ["setuptools>=68.0", "wheel"] |
| 3 | build-backend = "setuptools.build_meta" |
| 4 | |
| 5 | [project] |
| 6 | name = "douyin-downloader" |
| 7 | version = "2.0.0" |
| 8 | description = "Douyin batch downloader with no-watermark support" |
| 9 | readme = "README.md" |
| 10 | license = {text = "MIT"} |
| 11 | requires-python = ">=3.9" |
| 12 | classifiers = [ |
| 13 | "Development Status :: 4 - Beta", |
| 14 | "Intended Audience :: End Users/Desktop", |
| 15 | "License :: OSI Approved :: MIT License", |
| 16 | "Programming Language :: Python :: 3", |
| 17 | "Programming Language :: Python :: 3.9", |
| 18 | "Programming Language :: Python :: 3.10", |
| 19 | "Programming Language :: Python :: 3.11", |
| 20 | "Programming Language :: Python :: 3.12", |
| 21 | "Topic :: Multimedia :: Video", |
| 22 | ] |
| 23 | dependencies = [ |
| 24 | "aiohttp>=3.9.0", |
| 25 | "aiofiles>=23.2.1", |
| 26 | "aiosqlite>=0.19.0", |
| 27 | "rich>=13.7.0", |
| 28 | "pyyaml>=6.0.1", |
| 29 | "python-dateutil>=2.8.2", |
| 30 | "gmssl>=3.2.2", |
| 31 | # Bundled ffmpeg static binary used by core/audio_extraction.py to |
| 32 | # extract audio tracks before uploading to the OpenAI-compatible |
| 33 | # transcription endpoint. Pinned exact so the sidecar builds are |
| 34 | # reproducible across CI machines. 0.6.0 is the first release that |
| 35 | # ships a native macOS arm64 wheel; older versions only shipped |
| 36 | # x86_64 macOS binaries. |
| 37 | "imageio-ffmpeg==0.6.0", |
| 38 | ] |
| 39 | |
| 40 | [project.optional-dependencies] |
| 41 | browser = [ |
| 42 | "playwright>=1.40.0", |
| 43 | ] |
| 44 | transcribe = [ |
| 45 | "openai-whisper>=20231117", |
| 46 | ] |
| 47 | server = [ |
| 48 | "fastapi>=0.100", |
| 49 | "uvicorn>=0.23", |
| 50 | "pydantic>=2.0", |
| 51 | ] |
| 52 | dev = [ |
| 53 | "pytest>=7.0", |
| 54 | "pytest-asyncio>=0.21", |
| 55 | "ruff>=0.4.0", |
| 56 | "httpx>=0.25", |
| 57 | # Property-based tests (tests/test_database_top_authors.py, |
| 58 | # test_notifier_redactor_property.py, test_proxy_validator_parity.py). |
| 59 | # Missing hypothesis caused 3 collection errors pre-fix. |
| 60 | "hypothesis>=6.0", |
| 61 | ] |
| 62 | all = [ |
| 63 | "douyin-downloader[browser,transcribe,server,dev]", |
| 64 | ] |
| 65 | |
| 66 | [project.scripts] |
| 67 | douyin-dl = "cli.main:main" |
| 68 | |
| 69 | [tool.setuptools.packages.find] |
| 70 | include = ["cli*", "core*", "auth*", "config*", "control*", "storage*", "utils*", "tools*", "server*"] |
| 71 | |
| 72 | [tool.pytest.ini_options] |
| 73 | asyncio_mode = "auto" |
| 74 | asyncio_default_fixture_loop_scope = "function" |
| 75 | pythonpath = ["."] |
| 76 | testpaths = ["tests"] |
| 77 | # aiosqlite's background worker thread occasionally outlives the test's |
| 78 | # event loop (TestClient's lifespan tears down the loop immediately after |
| 79 | # shutdown, but the worker may wake one more time to `call_soon_threadsafe` |
| 80 | # and hit `RuntimeError: Event loop is closed`). This is a known upstream |
| 81 | # aiosqlite/pytest-asyncio interaction, not our bug — the connection is |
| 82 | # already closed cleanly at the contract level. Mirrors desktop's config |
| 83 | # so `pytest tests/` output is clean in both projects. |
| 84 | filterwarnings = [ |
| 85 | "ignore:Exception in thread Thread-.*_connection_worker_thread:pytest.PytestUnhandledThreadExceptionWarning", |
| 86 | ] |
| 87 | |
| 88 | [tool.ruff] |
| 89 | target-version = "py38" |
| 90 | line-length = 100 |
| 91 | |
| 92 | [tool.ruff.lint] |
| 93 | select = ["E", "F", "W", "I"] |
| 94 | ignore = ["E501"] |
| 95 |