- Pick an issue to work on: https://github.com/scikit-learn/scikit-learn/issues
- Comment on issue with: I'm working on this
git fetch https://github.com/theirusername/reponame.git theirbranch:ourbranch
- Explore and fix issue. This will take the majority of time (!)
- Make updates to file
<file_name>
git checkout -b <feature_branch>
Please include (#DataUmbrella) in your PR so we can track them.
git add <file_name>
git commit -m 'description for fix'
flake8
tests for formatting errors
flake8 <file_name>
- The full test suite takes fairly long to run
- Run tests
pytest sklearn
This is an example of the output of a successful pytest sklearn
: pytest_sklearn_output
- Create test file under
tests
directory - Run test file
pytest <test_file>
example
pytest /Users/reshamashaikh/scikit-learn/sklearn/metrics/tests/test_classifier.py
pytest /Users/reshamashaikh/scikit-learn/sklearn/metrics/tests/test_mixture.py
This is an example of the output of a successful pytest test_classification.py
:
(sklearndev) % pytest sklearn/metrics/tests/test_classification.py
============================================================ test session starts ============================================================
platform darwin -- Python 3.7.1, pytest-4.0.0, py-1.7.0, pluggy-0.8.0
rootdir: /Users/reshamashaikh/scikit-learn, inifile: setup.cfg
collected 75 items
sklearn/metrics/tests/test_classification.py ........................................................................... [100%]
=================================================== 75 passed, 3 warnings in 9.49 seconds ===================================================
(sklearndev) %
test_file
should be committed to feature branch as well
git add <test_file>
git commit -m 'description for test file'
git push origin <feature_branch>
Do this on GitHub.
REMINDER: Under Conversation [description]
include references to which Issues and other PRs that your PR is related to.
These tests happen automatically after a PR has been submitted:
This is what it looks like when all the checks have passed!
- Wait for reviews (be patient)
- Address review comments in the same branch
- Pushing to your fork will update the PR
- Reviewers will "approve" the PR or change title to [MRG + 1]
- You need 2 approvals for a merge
This is what a merged icon looks like:
git branch -D feature_branch
cd scikit-learn
my example:
cd /Users/reshamashaikh/software-build/scikit-learn
conda activate sklearndev
git pull upstream main
git push origin main
git checkout feature_branch
git pull upstream main
git push origin feature_branch