Skip to content

Developer guide

Set up a checkout

From the repository root, use a virtual environment and install the project and test dependencies:

python -m venv .venv
source .venv/bin/activate
python -m pip install -e . -r requirements-test.txt
pre-commit install

Format and test

The pre-commit configuration is the source of truth for formatting and linting (including Black, flake8, and pylint). Run the current suite, legacy suite, or both:

pre-commit run --all-files
python -m pytest tests --ignore=tests/legacy_1x -q
python -m pytest tests/legacy_1x -q
python -m pytest tests -q

The full SDK suite includes Qwen tokenizer tests. To run them offline, provision the vocabulary before running pytest and point DASHSCOPE_QWEN_VOCAB at it. See the tokenization guide.

For quick, repeatable SDK exercises, see the examples hub, starting with an offline mock.

Preview the docs

python -m pip install -r requirements-doc.txt
python tools/gen_reference.py --check
python -m mkdocs build --strict
python -m mkdocs serve

Update both locales. If public symbols changed, regenerate reference lists with python tools/gen_reference.py and review the diff. See the maintenance guide and shared site template.