Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Some changes in make.bat and the build documentation documentation#11121

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

fredrik-1
Copy link
Contributor

PR Summary

I changed themake.bat file so that it is possible to set command line options and wrote a more detailed instruction on how to build the documentation on windows.

(I am not really sure if everything works when building on windows though because I get some warnings but it works for my use)

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@timhoffm
Copy link
Member

Thanks! Looks good.

@ImportanceOfBeingErnest
Copy link
Member

I do not understand the changes made here. Previously you'd just runmake html and get the documentation out. Now you have to set the options manually?

@fredrik-1
Copy link
ContributorAuthor

You can still run justmake html but you can also set some extra sphinx options, for example set-Dplot_gallery=0 to not run the scripts in the gallery.

There is one different though, the default was-W (make warnings to errors) before but this couldn't be changed on the command line for windows and I couldn't find a nice way to get the old behavior in themake.bat file.

@ImportanceOfBeingErnest
Copy link
Member

So you are proposing to keepSPHINXOPTS=-W on linux, but makeSPHINXOPTS= the default on windows?

workaround is to not build the gallery by commenting out
``sphinx_gallery.gen_gallery`` in ``extensions`` in the ``conf.py`` file
or to delete the code in or delete the
``examples\userdemo\pgf_preamble_sgskip.py`` file.

Choose a reason for hiding this comment

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

This seems kind of a strange workaround. I'd say the workaround is to wait a few more days until 0.1.14 is finally released or install the current development version of sphinx-gallery.

@fredrik-1
Copy link
ContributorAuthor

That is how it is implemented now at-least and I don't know how to write the same default options functionality in themake.bat file as is done in theMakefile but it is of course possible to add a non sphinx option that resets the default. For exampleSPHINXOPTS=-W by default andSPHINXOPTS=clear ->SPHINXOPTS= in the sphinx call.

I think thatSPHINXOPTS= is a better default in both though but I have very limited experience in building the documentation.

I am open to changing the work around but those two methods works good for my use right now and are simple to do.

anntzer
anntzer previously requested changesApr 26, 2018
Copy link
Contributor

@anntzeranntzer left a comment

Choose a reason for hiding this comment

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

In agreement with@ImportanceOfBeingErnest: let's not document "delete the nonworking example" but rather let's wait for s-g 0.1.14. We can always revisit this if s-g 0.1.14 takes "too long" to get out.

@ImportanceOfBeingErnest
Copy link
Member

So what about removing-W from make.bat? Is it acceptable to have different defaults for windows and linux? I think one would have to weight here: Is the default setting rather for people aiming at getting a local copy of the docs or at people trying to test if they build fine for submitting changes to matplotlib? Depending on that one or the other option may make more sense.

@anntzer
Copy link
Contributor

That was discussed in#9513 (comment).

@ImportanceOfBeingErnest
Copy link
Member

So over there the decision was tokeep-W. (To which I would agree.)

What this means for this PR is that one would need to find a way to set this parameter via the command line; or leave make.bat as it currently is and let the user edit the file. I think this is fine as well; the drawback is then that you need to edit it back before each commit not to have it wandering around in your PR.

@timhoffm
Copy link
Member

We could add some code that makesmake.bat make SPHINXOPTS= html work. Doesn't neccessarily have to be part of this PR. Just keeping-W is good enough for the moment.

@fredrik-1
Copy link
ContributorAuthor

I changed the default to-W and made it possible to also change it on the command line.

@@ -47,7 +47,7 @@ requirements that are needed to build the documentation. They are listed in
* IPython
* numpydoc>=0.4
* Pillow
* sphinx-gallery>=0.1.13
* sphinx-gallery>=0.1.13 (>=0.2.0 on windows)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just document >=0.2.0 everywhere. The benefit of allowing 0.1.13 on non-Windows is minimal.

@anntzeranntzer dismissed theirstale reviewJune 7, 2018 12:48

new version of s-g released

* ``make O=-Dplot_gallery=0 html`` skips the gallery build.
.. code-block:: sh

#runs a parallel build with 4 processes.
Copy link
Member

Choose a reason for hiding this comment

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

I'd go for# run a parallel build with 4 processes, i.e. use an imperative style rather than a statement, similar to how we write docstrings. The same holds for the following two comments.

Please also add a space between# and text (multiple places throughout the PR).

Windows
~~~~~~~

The documentation is build using the ``make.bat`` file. The options are set using
Copy link
Member

Choose a reason for hiding this comment

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

usingthemake.batfile

~~~~~~~

The documentation is build using the ``make.bat`` file. The options are set using
environment variables and variables can be set either in the
Copy link
Member

Choose a reason for hiding this comment

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

a bit less repetitive:

The options are controlled using environment variables. They can be set either inmake.bat or on the command line before runningmake.bat.

#in cmd
#use the default -W option
make html
set SPHINXOPTS=& make html
Copy link
Member

Choose a reason for hiding this comment

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

Can be left out. Or if you insist, put a# or line above.

.. code-block:: sh

#in cmd
set SPHINXOPTS=-W
Copy link
Member

Choose a reason for hiding this comment

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

Can we use an example that is not the default value? IMHO that would make more sense.


Multiple options can be combined using e.g. ``make O='-j4 -Dplot_gallery=0'
html``.
#in powershell
Copy link
Member

Choose a reason for hiding this comment

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

PowerShell is a proper name, so we should capitalize it appropriately (multiple occurences throughout the PR).


if "%SPHINXOPTS%" == "" (
Copy link
Member

Choose a reason for hiding this comment

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

Go forif not defined SPHINXOPTShttps://docs.microsoft.com/en-us/windows-server/administration/windows-commands/if.

That also makes it possible to useset SPHINXOPTS=& make html for setting an empty variable, i.e. we do not need the "set to anything but nothing" workaround.

@timhoffm
Copy link
Member

I think the technical issues (sg) and discussion about the default are resolved.

This just needs a bit of cleanup.

@jklymak
Copy link
Member

I'll close this as abandoned and probably obsolete, but feel free to reopen if someone is going to look at it again....

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

@anntzeranntzeranntzer left review comments

@ImportanceOfBeingErnestImportanceOfBeingErnestImportanceOfBeingErnest left review comments

@timhoffmtimhoffmtimhoffm requested changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@fredrik-1@timhoffm@ImportanceOfBeingErnest@anntzer@jklymak@QuLogic@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp