-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Simplified 'sphinx-build' #4320
Conversation
5f91902
to
38a6f0b
Compare
Before reviewing this PR in detail, I'd like to ask you to some question. At first, please let me know the motivation to define the
And another question is about this guessing. Is this behavior important? I feel this does not follow the UNIX philosophy. I prefer to determine current directory is source directory if it is not given. |
I see no reason not to 😄 This works towards two things I'd like to do long term - adding support for INI-style configuration files (to complement
I feel it is very important, yes. The idea here is that you can run
As you can see, we do actually check the current directory, although it's lower on the list than the other three. I can change this ordering if you'd like? As for it not being UNIX like, I don't think that's quite relevant here. The UNIX philosophy is that you have lots of small tools which you chain together to achieve something and that doesn't seem to apply here. In addition, popular tools like |
Could you please elaborate what you mean by this about make mode. Personally I never use sphinx-build but only the lean Makefile interface. For example for testing Sphinx itself, I find This may not be best place to post my comment, as you have extended range of PRs, but I would like to know if your final goal is simply to drop shipped out |
I'm referring to the
This one's different. Have you used
This will take some time on the first run (because it's installing all your packages) but subsequent runs won't.
Nope, as clarified above, I just want the Makefile to be unnecessary. I do want to remove As an aside, I have a few more things on top of these two items planned but I'm not actually sure where the best place to discuss these plans is. The mailing list doesn't seem to be actively monitored and I don't know if RFE bugs are a things here. Perhaps you or @tk0miya might have some ideas? |
@stephenfin thanks for the additional info. I will reply in a more detailed manner but I am currently on tight schedule and will only report one issue I currently have (at 2e04c2a):
reports a failure
which seems to indicate something is wrong at my locale with makeinfo, but on the other hand
Possibly the tox virtual env is missing something. I can provide more log if required, but perhaps the explanation will be clear to others already. (I don't have time now to even read closely the error report, possibly simply a missing dependency) |
Fair enough. Current docs (of master branch, since #3938 was merged, thus for 1.7) of sphinx-build explains how "make mode" adds two targets (latexpdf and info) which are not per se Sphinx builders as understood by sphinx-build
Yes, this is nice and the current docs (possibly as contributed by your commits, I did not check) do explain that clearly and even the Now in my recollection I did want to use
tox was already promoted by Sphinx developer guide as the way to go, but I was really too lazy... Now, I see it has great benefits. I have installed it, via the conda-forge channel, (it currently required a downgrade of conda itself, but that's not too serious) and I am quite willing to use it. Currently I find it adds some time overhead if I use it for testing. These steps:
take each time noticeable time. But this is good as it forces me to think more and test less often after trivial changes ;-) On a pitnicky mode, I find the printing of dots ". . . . . . . " during execution of testing a bit boring and not self-explanatory. It is how it was until some months ago also with Now I find the output of current With conda I have the possibility to create environments with various Python and Docutils versions ; switching environments and running Still with the underlying thinking that PR are tested via various services upstream here at Sphinx, which protects us againt lazy guys like me who are going to test only one combination (and often involuntarily forget the
I do subscribe via Gmane interface and Thunderbid to the sphinx-dev list and I am quite willing to participate to discussions of this type over there rather than here at Github which provides no such thing and limits discussions to PR's and issues. |
Are there environment variables required for this target? If so, we need to explicitly call them out. Could you try adding replacing the current
This should (if StackOverflow is to be believed) pass all configuration options through. If this is the case, we need to go find what options need to be passed and add them to that list. |
You read my mind 😄 I have added an additional builder called
Good catch! I will add this shortly.
Yes, we should work on ways to improve this. Usually this should only rebuild if dependencies have changed (which doesn't happen often). If that's not the case, I need to fix something.
Yes, as noted previously, if there are still people using this then I will not remove it. I just wanted to use
Good to know. I will likely post something over the Xmas period outlining my ideas in this area (I have lots, thanks to my experience with Sphinx from writing extensions and using it with Also, good to know who the person to talk to about LaTeX issues is. I had never built LaTeX/PDF documents using Sphinx before last week so this is all new to me 😄. |
Confirmed!
|
Excellent. If you could figure out what options are needed and add them to that, it would resolve the problem. I know you're busy though, so if you could provide a sanitized version of Also, we should probably open a bug for this? |
The |
Good to know. I should go and clean up some documentation so, as there are references to this in |
I will do it, I have to do my share here! but soup is boiling, so not now ;-) |
I removed recently mention of latexpdfja in the doc/man/sphinx-build.rst |
...hmm... wait about latexpdfja I will have to check the Windows situation, I can't test on Windows, and we ship the old latex Makefile with it, not using latexmk. I think setting language to |
Yeah, the references I'm seeing as in |
@stephenfin the needed environment variable to avoid the failed texinfo test is Its setting in my environment is
vz the Apple shipped one
With |
About BTW, I also feel make-mode is ugly. So +1 for removing it. But I guess many projects uses it by default because it is enabled by default of Makefile since 1.6. |
@tk0miya Is there any other clarifications needed here? |
38a6f0b
to
97c2550
Compare
@tk0miya Is this something we could consider for 1.7? I'm willing to do any rework necessary before the deadline. |
I'm sorry. I don't have enough time to discuss this. So this would not merged before 1.7. TBH, I can understand your idea. But I feel it is not good to me. The basic concept of current In addition, this is very big change for Sphinx. so all of maintainers should discuss for this. Now @shimizukawa ; the another maintainer of this project is very busy since last summer. So I'd like to wait his comeback. |
That's no problem. I understand. I will pick this up again after 1.7 is released.
Yes, the key thing I'm trying to remove here is the need to use the
I disagree 😉 I think this is a small change. Remember that nothing changes if you keep doing what you were doing - we don't break However, you have enough on your plate for now. Let's discuss this more once 1.8 window opens 👍 In the interim, feel free to ask me any questions you have about make-mode, including why I (and @jfbu, I think 😉) dislike it so much. |
97c2550
to
81fb16c
Compare
This is part one of two of the "make 'sphinx-build' easier to call" effort. In this part, we allow users to define the build directory in the 'conf.py' file. This means a user no longer needs to pass the option via the command line, though they can continue to do so if they wish. We use the behavior of the setuptools extension, whereby the results are output to a subfolder in the outdir named after the code of the builder. For example, if using the 'html' builder with 'output_dir = "test"', files would be written to 'test/html'. Signed-off-by: Stephen Finucane <stephen@that.guru>
This is part two of two of the "make 'sphinx-build' easier to call" effort. In this part, we attempt to guess where the source directory is if the user does not provide one. This is possible because many users use one of three directory names - doc, docs, or Documentation - for their documentation. We check these, along with all immediate subdirectories for these directories. If a 'conf.py' file is found in any of these directories, we assume this is the documentation source. This means a user no longer needs to pass any argument to 'sphinx-build' is they do not wish to. This is, of course, best-effort, and users can continue to provide these options manually if they so wish. Signed-off-by: Stephen Finucane <stephen@that.guru>
Now that 'sphinx.application.Application' can do this for us, there's no reason to duplicate this logic. This does change behavior slightly, in that only subdirectories one level deep are searched, but this change in behavior seems to be an improvement over the boundless search we were doing before. Signed-off-by: Stephen Finucane <stephen@that.guru>
81fb16c
to
b127ebf
Compare
(sorry for late replying..) IMO,
For me, it is good to redesign the configuration file location and startup process by making make-mode an independent command (like |
I'm picking this up again, but it's quite out of date and could do with a new approach, so I'm going to abandon this and start a new pull request. |
Subject: Simplify calling of
sphinx-build
Feature or Bugfix
Feature
Purpose
Make
sphinx-build
easier to call by moving configuration of the build directory to the configuration file and auto-detecting the source directory. This will allow most users to callsphinx-build
without any arguments.Detail
sphinx-build
: Configureoutdir
fromconf.py
This is part one of two of the "make 'sphinx-build' easier to call" effort. In this part, we allow users to define the build directory in the 'conf.py' file. This means a user no longer needs to pass the option via the command line, though they can continue to do so if they wish.
We use the behavior of the setuptools extension, whereby the results are output to a subfolder in the outdir named after the code of the builder. For example, if using the 'html' builder with 'output_dir = "test"', files would be written to 'test/html'.
sphinx-build
: Guesssourcedir
if none providedThis is part two of two of the "make 'sphinx-build' easier to call" effort. In this part, we attempt to guess where the source directory is if the user does not provide one. This is possible because many users use one of three directory names - doc, docs, or Documentation - for their documentation. We check these, along with a possible 'source' subdirectory, which is based on Sphinx's own defaults, for a 'conf.py' file. Is one is found, we assume this is the documentation source. This means a user no longer needs to pass any argument to 'sphinx-build' is they do not wish to.
This is, of course, best-effort, and users can continue to provide these options manually if they so wish.
You can validate this right now by pulling down the pull request and running
sphinx-build
without any arguments. The required change has been made toconf.py
.