安装#
系统要求#
Python >= 3.11
仅依赖标准库(无需外部依赖)
fractions
logging
math
functools
re
从 PyPI 安装#
安装 dftt_timecode 最简单的方法是使用 pip 或 uv:
# Using pip
pip install dftt_timecode
# Using uv (recommended)
uv pip install dftt_timecode
从源码安装#
对于开发,我们建议使用 uv 以获得更快速和可靠的依赖管理:
# Clone the repository
git clone https://github.com/OwenYou/dftt_timecode.git
cd dftt_timecode
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Sync dependencies and install in development mode
uv sync
这将:
在
.venv中创建虚拟环境安装所有开发依赖(pytest、sphinx 等)
以可编辑模式安装包
或者,使用 pip:
git clone https://github.com/OwenYou/dftt_timecode.git
cd dftt_timecode
pip install -e .
验证安装#
您可以通过导入包来验证安装:
import dftt_timecode
print(dftt_timecode.__version__)
开发依赖#
项目使用 uv 进行依赖管理。所有依赖都定义在 pyproject.toml 中:
pytest - 测试框架
sphinx - 文档生成器
pydata-sphinx-theme - 文档主题
使用 uv 安装开发依赖:
# Install all development dependencies
uv sync
# Activate the virtual environment
source .venv/bin/activate # On Windows: .venv\Scripts\activate
运行测试:
pytest
构建文档:
cd docs
make html