@@ -610,14 +610,12 @@ def build(self):
610610 sphinxopts = list (self .language .sphinxopts )
611611 if self .language .tag != "en" :
612612 locale_dirs = self .build_root / self .version .name / "locale"
613- sphinxopts .extend (
614- (
615- f"-D locale_dirs={ locale_dirs } " ,
616- f"-D language={ self .language .iso639_tag } " ,
617- "-D gettext_compact=0" ,
618- "-D translation_progress_classes=1" ,
619- )
620- )
613+ sphinxopts .extend ((
614+ f"-D locale_dirs={ locale_dirs } " ,
615+ f"-D language={ self .language .iso639_tag } " ,
616+ "-D gettext_compact=0" ,
617+ "-D translation_progress_classes=1" ,
618+ ))
621619 if self .language .tag == "ja" :
622620 # Since luatex doesn't support \ufffd, replace \ufffd with '?'.
623621 # https://gist.github.com/zr-tex8r/e0931df922f38fbb67634f05dfdaf66b
@@ -669,20 +667,18 @@ def build(self):
669667 self .version ,
670668 self .checkout / "Doc" / "tools" / "templates" / "indexsidebar.html" ,
671669 )
672- run_with_logging (
673- [
674- "make" ,
675- "-C" ,
676- self .checkout / "Doc" ,
677- "PYTHON=" + str (python ),
678- "SPHINXBUILD=" + str (sphinxbuild ),
679- "BLURB=" + str (blurb ),
680- "VENVDIR=" + str (self .venv ),
681- "SPHINXOPTS=" + " " .join (sphinxopts ),
682- "SPHINXERRORHANDLING=" ,
683- maketarget ,
684- ]
685- )
670+ run_with_logging ([
671+ "make" ,
672+ "-C" ,
673+ self .checkout / "Doc" ,
674+ "PYTHON=" + str (python ),
675+ "SPHINXBUILD=" + str (sphinxbuild ),
676+ "BLURB=" + str (blurb ),
677+ "VENVDIR=" + str (self .venv ),
678+ "SPHINXOPTS=" + " " .join (sphinxopts ),
679+ "SPHINXERRORHANDLING=" ,
680+ maketarget ,
681+ ])
686682 run (["mkdir" , "-p" , self .log_directory ])
687683 run (["chgrp" , "-R" , self .group , self .log_directory ])
688684 if self .includes_html :
@@ -745,69 +741,57 @@ def copy_build_to_webroot(self, http: urllib3.PoolManager) -> None:
745741 # Copy built HTML files to webroot (default /srv/docs.python.org)
746742 changed = changed_files (self .checkout / "Doc" / "build" / "html" , target )
747743 logging .info ("Copying HTML files to %s" , target )
748- run (
749- [
750- "chown" ,
751- "-R" ,
752- ":" + self .group ,
753- self .checkout / "Doc" / "build" / "html/" ,
754- ]
755- )
744+ run ([
745+ "chown" ,
746+ "-R" ,
747+ ":" + self .group ,
748+ self .checkout / "Doc" / "build" / "html/" ,
749+ ])
756750 run (["chmod" , "-R" , "o+r" , self .checkout / "Doc" / "build" / "html" ])
757- run (
758- [
759- "find" ,
760- self .checkout / "Doc" / "build" / "html" ,
761- "-type" ,
762- "d" ,
763- "-exec" ,
764- "chmod" ,
765- "o+x" ,
766- "{}" ,
767- ";" ,
768- ]
769- )
770- run (
771- [
772- "rsync" ,
773- "-a" ,
774- "--delete-delay" ,
775- "--filter" ,
776- "P archives/" ,
777- str (self .checkout / "Doc" / "build" / "html" ) + "/" ,
778- target ,
779- ]
780- )
751+ run ([
752+ "find" ,
753+ self .checkout / "Doc" / "build" / "html" ,
754+ "-type" ,
755+ "d" ,
756+ "-exec" ,
757+ "chmod" ,
758+ "o+x" ,
759+ "{}" ,
760+ ";" ,
761+ ])
762+ run ([
763+ "rsync" ,
764+ "-a" ,
765+ "--delete-delay" ,
766+ "--filter" ,
767+ "P archives/" ,
768+ str (self .checkout / "Doc" / "build" / "html" ) + "/" ,
769+ target ,
770+ ])
781771
782772 if not self .quick :
783773 # Copy archive files to /archives/
784774 logging .debug ("Copying dist files." )
785- run (
786- [
787- "chown" ,
788- "-R" ,
789- ":" + self .group ,
790- self .checkout / "Doc" / "dist" ,
791- ]
792- )
793- run (
794- [
795- "chmod" ,
796- "-R" ,
797- "o+r" ,
798- self .checkout / "Doc" / "dist" ,
799- ]
800- )
775+ run ([
776+ "chown" ,
777+ "-R" ,
778+ ":" + self .group ,
779+ self .checkout / "Doc" / "dist" ,
780+ ])
781+ run ([
782+ "chmod" ,
783+ "-R" ,
784+ "o+r" ,
785+ self .checkout / "Doc" / "dist" ,
786+ ])
801787 run (["mkdir" , "-m" , "o+rx" , "-p" , target / "archives" ])
802788 run (["chown" , ":" + self .group , target / "archives" ])
803- run (
804- [
805- "cp" ,
806- "-a" ,
807- * (self .checkout / "Doc" / "dist" ).glob ("*" ),
808- target / "archives" ,
809- ]
810- )
789+ run ([
790+ "cp" ,
791+ "-a" ,
792+ * (self .checkout / "Doc" / "dist" ).glob ("*" ),
793+ target / "archives" ,
794+ ])
811795 changed .append ("archives/" )
812796 for file in (target / "archives" ).iterdir ():
813797 changed .append ("archives/" + file .name )
@@ -986,7 +970,8 @@ def parse_args():
986970 default = Path ("/var/log/docsbuild/" ),
987971 )
988972 parser .add_argument (
989- "--languages" , "--language" ,
973+ "--languages" ,
974+ "--language" ,
990975 nargs = "*" ,
991976 help = "Language translation, as a PEP 545 language tag like"
992977 " 'fr' or 'pt-br'. "
0 commit comments