-
Notifications
You must be signed in to change notification settings - Fork 62
DevWorkflow
The LensKit development workflow is based on branches and pull requests. With few exceptions, the main repository (this one) only contains released branches; all in-progress work is in branches in developer forks.
We strongly recommend that you not develop on main
, even in your own fork. Develop on a branch, push the branch to your fork, and submit a PR from there. Keep your main
tracking upstream main
.
Upstream: the main LensKit repository (this one)
main
: the main development branch
fork
: your own fork of the repository (e.g. https://github.com/mdekstrand/lkpy).
Here is what you need to do to be ready to develop on LensKit:
-
Fork LensKit to your GitHub account (click the 'Fork' button)
-
Clone your repository:
git clone https://github.com/MyUser/lkpy.git cd lkpy
-
Add the LensKit upstream as a second origin:
git remote add upstream https://github.com/lenskit/lkpy.git git fetch upstream
-
Set up your Conda environment:
pip install flit_core packaging python build-tools/flit-conda.py --create-env --python-version 3.8
Step 1 is a one-time operation. Repeat steps 2 and 3 on each additional computer where you want to do LensKit development. Step 4 should be repeated whenever the dev environment updates (the pyproject.toml
file changes).
Here are the steps to start a new set of changes:
-
Update your
main
branch:git checkout main git pull git pull upstream main git push
-
Create your new branch:
git checkout -b feature/my-new-thing
-
Do your work, commit changes, etc.
-
Push:
git push -u origin feature/my-new-thing
-
Create a pull request by visiting https://github.com/lenskit/lkpy and creating a PR from your new branch.
-
Repeat 3 and 4 as needed to fix issues, address review comments, etc.
-
We merge the PR!
It's useful to run the tests locally, to make sure that the code works at least on your machine before submitting the PR.
python -m pytest tests