Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cce5062

Browse files
StefanieSengerjeremiedbb
authored andcommitted
DOC Add section on resolving conflicts in lock files to developer guide (#29882)
1 parent 9649199 commit cce5062

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

doc/developers/contributing.rst

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,15 @@ Commit Message Marker Action Taken by CI
562562
Note that, by default, the documentation is built but only the examples
563563
that are directly modified by the pull request are executed.
564564

565-
Lock files
566-
^^^^^^^^^^
565+
.. _build_lock_files:
566+
567+
Build lock files
568+
^^^^^^^^^^^^^^^^
567569

568570
CIs use lock files to build environments with specific versions of dependencies. When a
569571
PR needs to modify the dependencies or their versions, the lock files should be updated
570-
accordingly. This can be done by commenting in the PR:
572+
accordingly. This can be done by adding the following comment directly in the GitHub
573+
Pull Request (PR) discussion:
571574

572575
.. code-block:: text
573576
@@ -592,6 +595,36 @@ update documentation-related lock files and add the `[doc build]` marker to the
592595
593596
@scikit-learn-bot update lock-files --select-build doc --commit-marker "[doc build]"
594597
598+
Resolve conflicts in lock files
599+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
600+
601+
Here is a bash snippet that helps resolving conflicts in environment and lock files:
602+
603+
.. prompt:: bash
604+
605+
# pull latest upstream/main
606+
git pull upstream main --no-rebase
607+
# resolve conflicts - keeping the upstream/main version for specific files
608+
git checkout --theirs build_tools/*/*.lock build_tools/*/*environment.yml \
609+
build_tools/*/*lock.txt build_tools/*/*requirements.txt
610+
git add build_tools/*/*.lock build_tools/*/*environment.yml \
611+
build_tools/*/*lock.txt build_tools/*/*requirements.txt
612+
git merge --continue
613+
614+
This will merge `upstream/main` into our branch, automatically prioritising the
615+
`upstream/main` for conflicting environment and lock files (this is good enough, because
616+
we will re-generate the lock files afterwards).
617+
618+
Note that this only fixes conflicts in environment and lock files and you might have
619+
other conflicts to resolve.
620+
621+
Finally, we have to re-generate the environment and lock files for the CIs, as described
622+
in :ref:`Build lock files <build_lock_files>`, or by running:
623+
624+
.. prompt:: bash
625+
626+
python build_tools/update_environments_and_lock_files.py
627+
595628
.. _stalled_pull_request:
596629

597630
Stalled pull requests

doc/developers/tips.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,6 @@ PR-WIP: Regression test needed
218218

219219
Please add a [non-regression test](https://en.wikipedia.org/wiki/Non-regression_testing) that would fail at main but pass in this PR.
220220

221-
PR-WIP: PEP8
222-
223-
::
224-
225-
You have some [PEP8](https://www.python.org/dev/peps/pep-0008/) violations, whose details you can see in the Circle CI `lint` job. It might be worth configuring your code editor to check for such errors on the fly, so you can catch them before committing.
226-
227221
PR-MRG: Patience
228222

229223
::

0 commit comments

Comments
 (0)