Skip to content

DOC Add section on resolving conflicts in lock files to developer guide #29882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions doc/developers/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -562,12 +562,15 @@ Commit Message Marker Action Taken by CI
Note that, by default, the documentation is built but only the examples
that are directly modified by the pull request are executed.

Lock files
^^^^^^^^^^
.. _build_lock_files:

Build lock files
^^^^^^^^^^^^^^^^

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

.. code-block:: text

Expand All @@ -592,6 +595,36 @@ update documentation-related lock files and add the `[doc build]` marker to the

@scikit-learn-bot update lock-files --select-build doc --commit-marker "[doc build]"

Resolve conflicts in lock files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Here is a bash snippet that helps resolving conflicts in environment and lock files:

.. prompt:: bash

# pull latest upstream/main
git pull upstream main --no-rebase
# resolve conflicts - keeping the upstream/main version for specific files
git checkout --theirs build_tools/*/*.lock build_tools/*/*environment.yml \
build_tools/*/*lock.txt build_tools/*/*requirements.txt
git add build_tools/*/*.lock build_tools/*/*environment.yml \
build_tools/*/*lock.txt build_tools/*/*requirements.txt
git merge --continue

This will merge `upstream/main` into our branch, automatically prioritising the
`upstream/main` for conflicting environment and lock files (this is good enough, because
we will re-generate the lock files afterwards).

Note that this only fixes conflicts in environment and lock files and you might have
other conflicts to resolve.

Finally, we have to re-generate the environment and lock files for the CIs, as described
in :ref:`Build lock files <build_lock_files>`, or by running:

.. prompt:: bash

python build_tools/update_environments_and_lock_files.py

.. _stalled_pull_request:

Stalled pull requests
Expand Down
6 changes: 0 additions & 6 deletions doc/developers/tips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,6 @@ PR-WIP: Regression test needed

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

PR-WIP: PEP8

::

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.

PR-MRG: Patience

::
Expand Down