贡献者指南#
开发工作流程#
# 1. 创建一个分支和本地副本:
前往 python-graphblas/python-graphblas 并点击“fork”按钮以创建您自己的项目副本。
将项目克隆到您的本地计算机:
git clone git@github.com:your-username/python-graphblas.git
导航到包含 python-graphblas 的文件夹并添加上游仓库:
git remote add upstream git@github.com:python-graphblas/python-graphblas.git
现在,你有远程仓库名为:
upstream
,指的是python-graphblas
仓库origin
,指的是你个人的分支
# 2. 设置本地开发环境:
接下来,你需要设置你的构建环境。
以下是两种流行的环境管理器的说明:
venv
(基于pip,目前仅支持Linux)
# Create a virtualenv named ``graphblas-dev`` that lives in the directory of
# the same name
python -m venv graphblas-dev
# Activate it
source graphblas-dev/bin/activate
# Install main development and runtime dependencies of python-graphblas
pip install -r dev-requirements.txt
# Build and install python-graphblas from source
pip install -e . --no-deps
# Test your installation
pytest graphblas
conda
(Anaconda 或 Miniconda)
# Create a conda environment named ``graphblas-dev`` using environment.yml in the repository root
conda env create -f environment.yml
# Activate it
conda activate graphblas-dev
# Install python-graphblas from source
pip install -e . --no-deps
# Test your installation
pytest graphblas
最后,我们建议您使用一个预提交钩子,当您输入
git commit
时,它会运行一系列测试:
pre-commit install
# to trigger manual check use:
# pre-commit run --all-files