@@ -608,14 +608,12 @@ def build(self):
608608 sphinxopts = list (self .language .sphinxopts )
609609 if self .language .tag != "en" :
610610 locale_dirs = self .build_root / self .version .name / "locale"
611- sphinxopts .extend (
612- (
613- f"-D locale_dirs={ locale_dirs } " ,
614- f"-D language={ self .language .iso639_tag } " ,
615- "-D gettext_compact=0" ,
616- "-D translation_progress_classes=1" ,
617- )
618- )
611+ sphinxopts .extend ((
612+ f"-D locale_dirs={ locale_dirs } " ,
613+ f"-D language={ self .language .iso639_tag } " ,
614+ "-D gettext_compact=0" ,
615+ "-D translation_progress_classes=1" ,
616+ ))
619617 if self .language .tag == "ja" :
620618 # Since luatex doesn't support \ufffd, replace \ufffd with '?'.
621619 # https://gist.github.com/zr-tex8r/e0931df922f38fbb67634f05dfdaf66b
@@ -667,20 +665,18 @@ def build(self):
667665 self .version ,
668666 self .checkout / "Doc" / "tools" / "templates" / "indexsidebar.html" ,
669667 )
670- run_with_logging (
671- [
672- "make" ,
673- "-C" ,
674- self .checkout / "Doc" ,
675- "PYTHON=" + str (python ),
676- "SPHINXBUILD=" + str (sphinxbuild ),
677- "BLURB=" + str (blurb ),
678- "VENVDIR=" + str (self .venv ),
679- "SPHINXOPTS=" + " " .join (sphinxopts ),
680- "SPHINXERRORHANDLING=" ,
681- maketarget ,
682- ]
683- )
668+ run_with_logging ([
669+ "make" ,
670+ "-C" ,
671+ self .checkout / "Doc" ,
672+ "PYTHON=" + str (python ),
673+ "SPHINXBUILD=" + str (sphinxbuild ),
674+ "BLURB=" + str (blurb ),
675+ "VENVDIR=" + str (self .venv ),
676+ "SPHINXOPTS=" + " " .join (sphinxopts ),
677+ "SPHINXERRORHANDLING=" ,
678+ maketarget ,
679+ ])
684680 run (["mkdir" , "-p" , self .log_directory ])
685681 run (["chgrp" , "-R" , self .group , self .log_directory ])
686682 if self .includes_html :
@@ -743,69 +739,57 @@ def copy_build_to_webroot(self, http: urllib3.PoolManager) -> None:
743739 # Copy built HTML files to webroot (default /srv/docs.python.org)
744740 changed = changed_files (self .checkout / "Doc" / "build" / "html" , target )
745741 logging .info ("Copying HTML files to %s" , target )
746- run (
747- [
748- "chown" ,
749- "-R" ,
750- ":" + self .group ,
751- self .checkout / "Doc" / "build" / "html/" ,
752- ]
753- )
742+ run ([
743+ "chown" ,
744+ "-R" ,
745+ ":" + self .group ,
746+ self .checkout / "Doc" / "build" / "html/" ,
747+ ])
754748 run (["chmod" , "-R" , "o+r" , self .checkout / "Doc" / "build" / "html" ])
755- run (
756- [
757- "find" ,
758- self .checkout / "Doc" / "build" / "html" ,
759- "-type" ,
760- "d" ,
761- "-exec" ,
762- "chmod" ,
763- "o+x" ,
764- "{}" ,
765- ";" ,
766- ]
767- )
768- run (
769- [
770- "rsync" ,
771- "-a" ,
772- "--delete-delay" ,
773- "--filter" ,
774- "P archives/" ,
775- str (self .checkout / "Doc" / "build" / "html" ) + "/" ,
776- target ,
777- ]
778- )
749+ run ([
750+ "find" ,
751+ self .checkout / "Doc" / "build" / "html" ,
752+ "-type" ,
753+ "d" ,
754+ "-exec" ,
755+ "chmod" ,
756+ "o+x" ,
757+ "{}" ,
758+ ";" ,
759+ ])
760+ run ([
761+ "rsync" ,
762+ "-a" ,
763+ "--delete-delay" ,
764+ "--filter" ,
765+ "P archives/" ,
766+ str (self .checkout / "Doc" / "build" / "html" ) + "/" ,
767+ target ,
768+ ])
779769
780770 if not self .quick :
781771 # Copy archive files to /archives/
782772 logging .debug ("Copying dist files." )
783- run (
784- [
785- "chown" ,
786- "-R" ,
787- ":" + self .group ,
788- self .checkout / "Doc" / "dist" ,
789- ]
790- )
791- run (
792- [
793- "chmod" ,
794- "-R" ,
795- "o+r" ,
796- self .checkout / "Doc" / "dist" ,
797- ]
798- )
773+ run ([
774+ "chown" ,
775+ "-R" ,
776+ ":" + self .group ,
777+ self .checkout / "Doc" / "dist" ,
778+ ])
779+ run ([
780+ "chmod" ,
781+ "-R" ,
782+ "o+r" ,
783+ self .checkout / "Doc" / "dist" ,
784+ ])
799785 run (["mkdir" , "-m" , "o+rx" , "-p" , target / "archives" ])
800786 run (["chown" , ":" + self .group , target / "archives" ])
801- run (
802- [
803- "cp" ,
804- "-a" ,
805- * (self .checkout / "Doc" / "dist" ).glob ("*" ),
806- target / "archives" ,
807- ]
808- )
787+ run ([
788+ "cp" ,
789+ "-a" ,
790+ * (self .checkout / "Doc" / "dist" ).glob ("*" ),
791+ target / "archives" ,
792+ ])
809793 changed .append ("archives/" )
810794 for file in (target / "archives" ).iterdir ():
811795 changed .append ("archives/" + file .name )
@@ -984,7 +968,8 @@ def parse_args():
984968 default = Path ("/var/log/docsbuild/" ),
985969 )
986970 parser .add_argument (
987- "--languages" , "--language" ,
971+ "--languages" ,
972+ "--language" ,
988973 nargs = "*" ,
989974 help = "Language translation, as a PEP 545 language tag like"
990975 " 'fr' or 'pt-br'. "
0 commit comments