Skip to content

Develop

Yichen Yan edited this page Apr 18, 2022 · 1 revision

We use nox to build and test package, it's the only dependency and will manage essential requirements (which can be found in pyproject.toml). For local installs, nox is not necessary and pip will handle those dependencies.

Build

Build from source

For local test and development, pip install <local_package_dir> will just work, e.g.:

git clone https://github.com/alibaba/code-data-share-for-python.git
pip install code-data-share-for-python

Build wheels

Build wheels of different python requires conda to install support pythons.

# require conda
nox -s build_wheel

If conda is not available, wheel can also be generated with the build package:

pip install build
python -m build --wheel

Run tests

Tests can be run against the current python with venv, or all support python versions with conda.

Functional tests

Functional tests are under tests/ and can be run via:

nox -s tests_venv_current
nox -s tests_multiple_conda

with venv and conda as backend, respectively.

Performance tests

Since pyperformance relies on venv and seems to have issue with nested venv, performance tests only use conda backend.

Currently, we measure two kinds of scenario:

  1. startup time with specific packages imported, which are subjectively selected from PyPI: nox -s test_import_third_party;

  2. pyperformance test w./w.o. cds: nox -s pyperformance

    • We use a fork of pyperformance (https://github.com/oraluben/pyperformance/tree/cds) to run test with cds, a long term plan is to support original pyperformance to reuse their test cases.

    • pyperformance does not support custom setup required by cds, it might be feasible to specify a custom fork pyperf and do not change test cases themselves.

Clone this wiki locally