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
Bring Doc/make.bat as close to Doc/Makefile as possible #61588
Comments
I have found Doc/make.bat to be very useful, but I have hit a few of its limitations now and then. Thus, I have made extensive modifications to bring it much closer to the way Doc/Makefile works. Among the things changed in the attached patch:
Everything seems to work for me, but I've only been able to test on Windows 7 (32 and 64 bit). I don't believe there's anything in there that doesn't exist in XP, though. Also, since this version of the file has a lot of labels, this patch does somewhat rely on resolution of bpo-17202. It should probably work without any changes to .hgeol, but that can't be guaranteed. There are a couple of drawbacks to the patched version; it's a much longer file, and it does lose a good chunk of the elegance of the original solution. If anyone has any suggestions for regaining some of that elegance without losing any of the functionality, I am of course all ears :). In particular, I'm not a huge fan of having to have "pushd ." at the beginning of every label, but the only other solutions I came up with involved setting and unsetting a "DISALLOW_POPD" variable in several places, and a condition on the popd at :end, or forgetting the pushd/popd thing entirely. I'm looking forward to hearing what anyone else thinks of this, positive or negative :) |
+1 I would worry more about performance than elegance. While this is debated, can you provide a mini-patch for at least 3.3+ that corrects the bug of trying to run sphinx with python 3, so that anything but 'make checkout' fails? I would apply that immediately. |
Sure can. This one should do it, at least for anyone with 3.3 installed. |
2.7 make.bat, which currently downloads sphinx v0.6.7 but not at least one needed file, does not work. See bpo-17412. I asked there whether simply updating the sphinx version, which seems to work, is the right fix. I believe this is currently the only different in make.bat between Python versions. |
New changeset 9b45873e5a68 by Terry Jan Reedy in branch '3.2': New changeset e45db319e590 by Terry Jan Reedy in branch '3.3': New changeset 99e72eae35bb by Terry Jan Reedy in branch 'default': |
I pushed the minipatch but did not add a news item as it may get superseded and will not affect anyone currently setting PYTHON. |
Applying the minipatch makes the big patch fail to apply, so here's an update. Also changed in this version of the patch:
Terry, you're right about make.bat being very similar between versions. About the only other difference I saw was the removal of the line that prints the Python version in use, and the version of Pygments used. I'd be happy to make patches for backporting this as far as desired (assuming, of course, that it is accepted and is desirable to backport :-). |
Any comments? Christian, I'd especially like to hear from you since it looks like you were the original author of Doc/make.bat (bpo-1472). |
Here's a new patch to address Ezio's review comments, including more updates to Doc/README.txt, the addition of an 'htmlview' target to make.bat, and documentation of the 'htmlview' target in the Makefile usage message. |
Terry, do you want to test and commit this? |
I do want to test this. If my regular machine does not get fixed soon, I will install svn on my current substitute to do so. |
I caught a small oversight. This new patch changes the example in README.txt to |
After finally finding a way to check the status of the pushd stack, I found a bug in my patch whereby an extra directory is left on the pushd stack at the end of each run. As such, the version 5 patch changes from using 'goto end' to using 'exit /B !ERRORLEVEL!', along with some other changes related to that change. Also, because of that change, error handling is made a little easier, so I've changed around some of the messages and the conditions for printing them. Everything still seems to work. For anyone testing this patch, I would suggest using the command "prompt |
Having looked at this again, the current patch is just far bigger than it needs to be and tries to do too much, not to mention being rather out of date now. So, here's a much less ambitious, much simpler patch with many fewer ways it can go wrong (but also not quite as close a match to using Makefile). Instead of only allowing specific targets, the script now only specifies non-Sphinx-builder targets (like clean, check, help, htmlview, and serve) and assumes that any first argument it doesn't recognize is supposed to be a Sphinx builder. "htmlhelp" is still special-cased in the "build" target. Not listing all the Sphinx builder targets explicitly means that builders like "dirhtml", "pickle", or "json", or any builders added in future Sphinx versions will just work without our having to do anything for them. |
New patch, fixes a typo bug in a useless statement (by removing the statement) and a few pesky tabs that made their way into make.bat. Also, a little better organization in the vars at the top. |
New changeset c75a2282166f by Zachary Ware in branch '3.4': New changeset c378c67c4170 by Zachary Ware in branch '3.4': New changeset a172f26195f6 by Zachary Ware in branch '3.4': New changeset 2b2577d79e80 by Zachary Ware in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: