Skip to content
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

[docs] How to build the docs on macOS using conda #9276

Merged
merged 3 commits into from
Jun 14, 2023

Conversation

jaceklaskowski
Copy link
Contributor

  1. Describe the steps to build the docs on macOS using conda in "Contribute to XGBoost"
  2. Fix a typo in "XGBoost JVM Package" main page

Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

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

Thank you for the detailed instructions on building the documents, @jaceklaskowski ! Some comments on the details.

The online document is hosted by `Read the Docs <https://readthedocs.org/>`__ where the imported project is managed by `Hyunsu Cho <https://github.com/hcho3>`__ and `Jiaming Yuan <https://github.com/trivialfis>`__.

===============================
Build Docs on macOS using Conda
Copy link
Member

Choose a reason for hiding this comment

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

Since you use conda for illustration, it should work across various platforms. We just need to replace the brew step with graphviz from conda forge.

Aside from this, let's make it clear that this is building the HTML document.

conda activate xgboost-docs

#. Install required packages (in the current environment) using ``pip`` command.
For some reason, it is currently not possible to install the required packages using ``conda``.
Copy link
Member

Choose a reason for hiding this comment

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

I installed the required packages from conda with packages from the conda-forge channel.

Would be great to keep the toolchain as consistent as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue I had was with ray and Python version. I started with Python 3.11 and make html couldn't resolve xgboost-ray. Once I switched to Python 3.10 it all started well but only with pip. I couldn't convince conda to resolve all the deps. I'll give it a try again and report back with the findings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the issue I'm facing with conda install. Any idea how to fix it (and how it's possible that it works for you?!)

$ conda install --file requirements.txt --yes -c conda-forge
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - xgboost_ray

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/osx-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.


===============================
Build Docs on macOS using Conda
===============================
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't build the C++ doc, which requires the C++ document tools like doxygen. After having doxygen, one can run:

READTHEDOCS=True make html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The C++-part of xgboost was of little to no interest to me honestly and so I didn't even bother myself with this. I also simply followed the current version of the doc how to use make html and since there was no mention about the other options I didn't add them either.

...
The HTML pages are in _build/html.

Build finished. The HTML pages are in _build/html.
Copy link
Member

Choose a reason for hiding this comment

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

A reference to the sphinx doc build would be great. There are many other options like output format, each with a different set of dependencies (like pdflatex for pdf).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A reference to the sphinx doc build would be great. is already included in the Documentation section at the top of the page so I skip this. I added a note about the other options (make help).

Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

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

Thank you for improving the doc, @jaceklaskowski !

@trivialfis
Copy link
Member

Some edits:

  • Remove the macOS-specific header since conda is cross-platform.
  • Specify this is only for Python.

@trivialfis trivialfis merged commit 0df1272 into dmlc:master Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants