Skip to content

DOC Clearer linear "get your development environment" setup documentation - #32509

Merged
lesteve merged 56 commits into
scikit-learn:mainfrom
AnneBeyer:doc_setting_up
Oct 28, 2025
Merged

lesteve merged 56 commits into
scikit-learn:mainfrom
AnneBeyer:doc_setting_up

Conversation

@AnneBeyer

@AnneBeyer AnneBeyer commented Oct 15, 2025 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

Fixes #32475 as a first step towards more structured contribution guidelines.

What does this implement/fix? Explain your changes.

  • Inspired by the matplotlib documentation
    it splits the previous How to contribute section in Contributing Code into two parts, namely
    Set up your development environment and Development workflow.

  • In Set up your development environment, the user is now able to chose their OS and conda vs pip and gets a step by step guide for installing the required Python dependencies as well as a compiler with OpenMP support (no more jumping around!).
    In preparation of further restructuring of the contribution page, this part is moved into a separate file, but for now it is simply included in the main contributing.rst.

  • Building the package from source now links to Set up your development environment.

  • I also moved the videos to the end of the section, as I found it a bit confusing to figure out which parts are different/outdated/not relevant when watching them before reading the instructions.

Any other comments?

What is left to be done is

@github-actions

github-actions Bot commented Oct 15, 2025 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 409cbcf. Link to the linter CI: here

@lesteve

lesteve commented Oct 15, 2025 •

Copy link
Copy Markdown
Member

To fix the lint issue below, you'll need to merge main into your branch ...

Fixing the lint CI is useful, because then, as a reviewer, I will be able to see the rendered doc from your PR.

The back-story is that cython-lint 0.18 changed something which broke main and all the PRs but now it has been fixed in #32499.

Here is the cython-lint output for further reference:

### Running cython-lint ###

/home/circleci/project/sklearn/cluster/_hdbscan/_tree.pyx:786:19: unnecessary set + generator (just use a set comprehension)
Problems detected by cython-lint, please fix them

@AnneBeyer

Copy link
Copy Markdown
Member Author

There are still some issues with duplicate labels and targets, I'll look into this tomorrow.

@AnneBeyer

Copy link
Copy Markdown
Member Author

So apparently, this is an issue within sphinx that included files are analyzed once as separate files and once within the file they are included in, which leads to duplicate label issues if the included file contains any labels/targets.

This PR should only focus on the content (i.e., adding the selection part instead of jumping around), so I removed the separate file for now and added the content directly in contributing.rst and leave the linking to it part to a later PR.

Comment thread doc/developers/contributing.rst Resolved
Comment thread doc/developers/contributing.rst Resolved
Comment thread doc/developers/contributing.rst Resolved
Comment thread doc/developers/contributing.rst Resolved
Comment thread doc/developers/contributing.rst Resolved
Comment thread doc/developers/contributing.rst Resolved
@AnneBeyer

AnneBeyer commented Oct 23, 2025 •

Copy link
Copy Markdown
Member Author

UPDATE (see links to rendered docs below):

@StefanieSenger StefanieSenger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work, @AnneBeyer. The results in the rendered docs look awesome! 💛

Approving, since I only have a few nit comments.
It was overdue, I hope this gets merged soon enough to get into the next release.

Comment thread doc/developers/contributing.rst Resolved
Comment thread doc/developers/contributing.rst Resolved
Comment thread doc/developers/contributing.rst Resolved
Comment thread doc/developers/contributing.rst Resolved
Comment thread doc/developers/contributing.rst Outdated
Comment on lines 299 to 304

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#. Follow `these <https://help.github.com/articles/creating-a-pull-request-from-a-fork>`_
instructions to create a pull request from your fork.

I have hardly seen this resulting in a maintainer to review a PR faster, because there is no bandwidth to do so. I think in terms of expectation management it might be better to remove this. What do you think about this @AnneBeyer and @lesteve?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. To be kept in mind/discussed for a future revision of that section.

Comment thread doc/developers/development_setup.rst Resolved
@lesteve

lesteve commented Oct 24, 2025

Copy link
Copy Markdown
Member

The setup your dev environment looks very nice, which is already a big improvement!

One thing to double-check is whether the target+links point to the right place. For example .. _advanced-installation: is still in advanced_installation.rst which has little important info right now, most of them should point to setup_developments.rst?

I guess at this point, my thinking is how can we merge a first iteration of this sooner rather than later and work on improving this further on separate PRs.

One thing I am not sure about is the advanced_installation.rst that is a mix of things right now. Maybe name it something like misc_info.rst for now and we can sort out what to do with it later?

@StefanieSenger

Copy link
Copy Markdown
Member

The links are all fine (I checked).

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking the install instructions since I was tagged there.

Comment thread doc/developers/development_setup.rst Resolved
Comment thread doc/developers/development_setup.rst Resolved
@AnneBeyer

Copy link
Copy Markdown
Member Author

One thing to double-check is whether the target+links point to the right place. For example .. _advanced-installation: is still in advanced_installation.rst which has little important info right now, most of them should point to setup_developments.rst?

The tag for the installation process was .. _install_bleeding_edge:, which I kept (an moved to develpoment_setup.rst) for now and adapted the link locations (for example in install.rst) accordingly. Currently, nothing points to .. _advanced-installation:. The file is only referenced in the toctree in developers/index.rst.

@adrinjalali

Copy link
Copy Markdown
Member

As for using conda for the default selected one, we had these discussions, this PR could maybe close them as well?

(@lucyleeow would know better the state of those)

@AnneBeyer

Copy link
Copy Markdown
Member Author

I guess at this point, my thinking is how can we merge a first iteration of this sooner rather than later and work on improving this further on separate PRs.

@lesteve I tried to make it as self contained as possible now, without leaving confusing bits "flying around", namely

  • I renamed the advanced_installation to misc_info as you suggested (because this summarizes best what this is at the moment, and what we will do with it can be decided later),
  • and I did move the nightly builds to the install page, because leaving them there just didn't make sense;
  • I also fixed the formatting issues @StefanieSenger mentioned, which stemmed from adapting the numbering in the Development Workflow, because other than the content, the format should be concise even if the content needs to be revised in a later PR.
  • I also updated the Linux pip instructions together with @adrinjalali and made conda the pre-selected default for all OS.

Let me know what you think!

@lucyleeow

Copy link
Copy Markdown
Member

(@lucyleeow would know better the state of those)

I think this can probably close those PRs, but I don't recall those PRs sorry!

@lesteve

lesteve commented Oct 28, 2025 •

Copy link
Copy Markdown
Member

OK let's merge this one, thanks a lot for your work on this @AnneBeyer this is super useful for new contributors and sprint partipants!

Ideas for follow-up PRs (in no particular order):

  • install_bleeding_edge is not a great name for the reference (it's more of a historical thing where you had both the install nightly and setup your dev environment in the same page). I would use something like setup_development_environment
  • inconsistency in install (conda listed first) vs set-up your dev environment (pip listed first). Less controversial would have been to keep pip first ... maybe we can keep it like this (A foolish consistency is the hobgoblin of little minds) ...
  • clean-up misc_info, there are things I would definitely remove ... like "Note on dependencies for other Linux distributions" or the note about gcc being aliased to clang
  • other more ambitious things like contributing doc restructuring
  • probably other things I missed ...

@lesteve
lesteve merged commit 0088b0b into scikit-learn:main Oct 28, 2025
@adrinjalali

Copy link
Copy Markdown
Member

inconsistency in install (conda listed first) vs set-up your dev environment (pip listed first). Less controversial would have been to keep pip first

I think it's nice to have conda first there, and make sure other parts are consistent with it instead of doing pip first just for the sake of consistency.

In reality, I would recommend either [micro]mamba + conda-forge or uv, but none of those are in our guides

@lesteve

lesteve commented Oct 28, 2025

Copy link
Copy Markdown
Member

I think it's nice to have conda first there, and make sure other parts are consistent with it instead of doing pip first just for the sake of consistency.

Probably pip was first because it's what most people would use. Full disclosure: I am a conda user myself but I do recognize that for a lot of people conda is "weird", "confusing" and "non-standard".

In general, I don't think the scikit-learn documentation is the best place to explain which tools to use for setting up a Python environment and the tradeoffs involved, as I mentioned in #30193 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC Clearer linear "get your development environment" setup documentation

5 participants