5
5
Usage:
6
6
7
7
build_docs.py [-h] [-d] [-q] [-b 3.6] [-r BUILD_ROOT] [-w WWW_ROOT]
8
- [--devguide-checkout DEVGUIDE_CHECKOUT]
9
- [--devguide-target DEVGUIDE_TARGET]
10
8
[--skip-cache-invalidation] [--group GROUP] [--git]
11
9
[--log-directory LOG_DIRECTORY]
12
10
[--languages [fr [fr ...]]]
@@ -240,27 +238,6 @@ def build_one(version, isdev, quick, venv, build_root, www_root,
240
238
logging .info ("Finished %s" , checkout )
241
239
242
240
243
- def build_devguide (devguide_checkout , devguide_target , venv ,
244
- skip_cache_invalidation = False ):
245
- build_directory = os .path .join (devguide_checkout , "build/html" )
246
- logging .info ("Building devguide" )
247
- shell_out ("git -C %s pull" % (devguide_checkout ,))
248
- sphinxbuild = os .path .join (venv , "bin/sphinx-build" )
249
- shell_out ("%s %s %s" % (sphinxbuild , devguide_checkout , build_directory ))
250
- changed = changed_files (build_directory , devguide_target )
251
- shell_out ("mkdir -p {}" .format (devguide_target ))
252
- shell_out ("find %s -type d -exec chmod o+x {} ';'" % (build_directory ,))
253
- shell_out ("rsync -a --delete-delay {}/ {}" .format (
254
- build_directory , devguide_target ))
255
- shell_out ("chmod -R o+r %s" % (devguide_target ,))
256
- if changed and not skip_cache_invalidation :
257
- prefix = os .path .basename (devguide_target )
258
- to_purge = [prefix ]
259
- to_purge .extend (prefix + "/" + p for p in changed )
260
- logging .info ("Running CDN purge" )
261
- shell_out ("curl -X PURGE \" https://docs.python.org/{%s}\" " % "," .join (to_purge ))
262
-
263
-
264
241
def parse_args ():
265
242
from argparse import ArgumentParser
266
243
parser = ArgumentParser (
@@ -286,14 +263,6 @@ def parse_args():
286
263
"-w" , "--www-root" ,
287
264
help = "Path where generated files will be copied." ,
288
265
default = "/srv/docs.python.org" )
289
- parser .add_argument (
290
- "--devguide-checkout" ,
291
- help = "Path to a devguide checkout." ,
292
- default = "/srv/docsbuild/devguide" )
293
- parser .add_argument (
294
- "--devguide-target" ,
295
- help = "Path where the generated devguide should be copied." ,
296
- default = "/srv/docs.python.org/devguide" )
297
266
parser .add_argument (
298
267
"--skip-cache-invalidation" ,
299
268
help = "Skip fastly cache invalidation." ,
@@ -351,8 +320,6 @@ def main():
351
320
args .log_directory , language )
352
321
except Exception :
353
322
logging .exception ("docs build raised exception" )
354
- build_devguide (args .devguide_checkout , args .devguide_target ,
355
- venv , args .skip_cache_invalidation )
356
323
357
324
358
325
if __name__ == '__main__' :
0 commit comments