passagemath-docbuild 10.6.47__tar.gz → 10.8.1a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {passagemath_docbuild-10.6.47/passagemath_docbuild.egg-info → passagemath_docbuild-10.8.1a1}/PKG-INFO +3 -4
  2. passagemath_docbuild-10.8.1a1/VERSION.txt +1 -0
  3. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1/passagemath_docbuild.egg-info}/PKG-INFO +3 -4
  4. passagemath_docbuild-10.8.1a1/passagemath_docbuild.egg-info/requires.txt +1 -0
  5. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/pyproject.toml +2 -3
  6. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/__main__.py +57 -44
  7. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/build_options.py +6 -6
  8. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/builders.py +238 -341
  9. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/conf.py +37 -36
  10. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/ext/inventory_builder.py +8 -2
  11. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/ext/multidocs.py +1 -1
  12. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/ext/sage_autodoc.py +785 -468
  13. passagemath_docbuild-10.6.47/VERSION.txt +0 -1
  14. passagemath_docbuild-10.6.47/passagemath_docbuild.egg-info/requires.txt +0 -1
  15. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/MANIFEST.in +0 -0
  16. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/README.rst +0 -0
  17. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/passagemath_docbuild.egg-info/SOURCES.txt +0 -0
  18. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/passagemath_docbuild.egg-info/dependency_links.txt +0 -0
  19. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/passagemath_docbuild.egg-info/top_level.txt +0 -0
  20. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/pyproject.toml.m4 +0 -0
  21. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/requirements.txt +0 -0
  22. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/__init__.py +0 -0
  23. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/ext/__init__.py +0 -0
  24. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/sphinxbuild.py +0 -0
  25. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/utils.py +0 -0
  26. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/sage_docbuild/vendor.py +0 -0
  27. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/setup.cfg +0 -0
  28. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/setup.py +0 -0
  29. {passagemath_docbuild-10.6.47 → passagemath_docbuild-10.8.1a1}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: passagemath-docbuild
3
- Version: 10.6.47
3
+ Version: 10.8.1a1
4
4
  Summary: passagemath: Build system of the Sage documentation
5
5
  Author-email: The Sage Developers <sage-support@googlegroups.com>
6
6
  Maintainer: Matthias Köppe, passagemath contributors
@@ -20,16 +20,15 @@ Classifier: Operating System :: POSIX
20
20
  Classifier: Operating System :: POSIX :: Linux
21
21
  Classifier: Operating System :: MacOS :: MacOS X
22
22
  Classifier: Programming Language :: Python :: 3 :: Only
23
- Classifier: Programming Language :: Python :: 3.10
24
23
  Classifier: Programming Language :: Python :: 3.11
25
24
  Classifier: Programming Language :: Python :: 3.12
26
25
  Classifier: Programming Language :: Python :: 3.13
27
26
  Classifier: Programming Language :: Python :: 3.14
28
27
  Classifier: Programming Language :: Python :: Implementation :: CPython
29
28
  Classifier: Topic :: Scientific/Engineering :: Mathematics
30
- Requires-Python: <3.15,>=3.10
29
+ Requires-Python: <3.15,>=3.11
31
30
  Description-Content-Type: text/x-rst
32
- Requires-Dist: sphinx<9,>=5.2
31
+ Requires-Dist: sphinx<9,>=6.2
33
32
 
34
33
  ================================================================================
35
34
  passagemath: Build system of the Sage documentation
@@ -0,0 +1 @@
1
+ 10.8.1.alpha1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: passagemath-docbuild
3
- Version: 10.6.47
3
+ Version: 10.8.1a1
4
4
  Summary: passagemath: Build system of the Sage documentation
5
5
  Author-email: The Sage Developers <sage-support@googlegroups.com>
6
6
  Maintainer: Matthias Köppe, passagemath contributors
@@ -20,16 +20,15 @@ Classifier: Operating System :: POSIX
20
20
  Classifier: Operating System :: POSIX :: Linux
21
21
  Classifier: Operating System :: MacOS :: MacOS X
22
22
  Classifier: Programming Language :: Python :: 3 :: Only
23
- Classifier: Programming Language :: Python :: 3.10
24
23
  Classifier: Programming Language :: Python :: 3.11
25
24
  Classifier: Programming Language :: Python :: 3.12
26
25
  Classifier: Programming Language :: Python :: 3.13
27
26
  Classifier: Programming Language :: Python :: 3.14
28
27
  Classifier: Programming Language :: Python :: Implementation :: CPython
29
28
  Classifier: Topic :: Scientific/Engineering :: Mathematics
30
- Requires-Python: <3.15,>=3.10
29
+ Requires-Python: <3.15,>=3.11
31
30
  Description-Content-Type: text/x-rst
32
- Requires-Dist: sphinx<9,>=5.2
31
+ Requires-Dist: sphinx<9,>=6.2
33
32
 
34
33
  ================================================================================
35
34
  passagemath: Build system of the Sage documentation
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
9
9
  name = "passagemath-docbuild"
10
10
  description = "passagemath: Build system of the Sage documentation"
11
11
  dependencies = [
12
- 'sphinx >=5.2, <9',
12
+ 'sphinx >=6.2, <9',
13
13
  ]
14
14
  dynamic = ["version"]
15
15
  license = "GPL-2.0-or-later"
@@ -26,7 +26,6 @@ classifiers = [
26
26
  "Operating System :: POSIX :: Linux",
27
27
  "Operating System :: MacOS :: MacOS X",
28
28
  "Programming Language :: Python :: 3 :: Only",
29
- "Programming Language :: Python :: 3.10",
30
29
  "Programming Language :: Python :: 3.11",
31
30
  "Programming Language :: Python :: 3.12",
32
31
  "Programming Language :: Python :: 3.13",
@@ -34,7 +33,7 @@ classifiers = [
34
33
  "Programming Language :: Python :: Implementation :: CPython",
35
34
  "Topic :: Scientific/Engineering :: Mathematics",
36
35
  ]
37
- requires-python = ">=3.10, <3.15"
36
+ requires-python = ">=3.11, <3.15"
38
37
 
39
38
  [project.urls]
40
39
  "release notes" = "https://github.com/passagemath/passagemath/releases"
@@ -34,8 +34,6 @@ Standard options::
34
34
  -j, --mathjax, --jsmath
35
35
  ignored for backwards compatibility
36
36
  --no-plot do not include graphics auto-generated using the '.. plot' markup
37
- --no-preparsed-examples
38
- do not show preparsed versions of EXAMPLES blocks
39
37
  --include-tests-blocks
40
38
  include TESTS blocks in the reference manual
41
39
  --no-pdf-links do not include PDF links in DOCUMENT 'website';
@@ -72,15 +70,22 @@ Advanced options::
72
70
  en/reference. If ARG is 'all', list all main documents
73
71
  """
74
72
 
75
- import logging
76
73
  import argparse
74
+ import logging
77
75
  import os
78
- import shlex
79
76
  import sys
77
+ from pathlib import Path
78
+
80
79
  import sphinx.ext.intersphinx
81
- from sage.env import SAGE_DOC_SRC
82
- from .builders import DocBuilder, ReferenceBuilder, get_builder, get_documents
80
+
83
81
  from . import build_options
82
+ from .build_options import BuildOptions
83
+ from .builders import (
84
+ DocBuilder,
85
+ get_all_documents,
86
+ get_all_reference_documents,
87
+ get_builder,
88
+ )
84
89
 
85
90
  logger = logging.getLogger(__name__)
86
91
 
@@ -161,7 +166,7 @@ def help_documents():
161
166
  s += "\n"
162
167
  if 'reference' in docs:
163
168
  s += "Other valid document names take the form 'reference/DIR', where\n"
164
- s += "DIR is a subdirectory of SAGE_DOC_SRC/en/reference/.\n"
169
+ s += "DIR is a subdirectory of src/doc/en/reference/.\n"
165
170
  s += "This builds just the specified part of the reference manual.\n"
166
171
  s += "DOCUMENT may also have the form 'file=/path/to/FILE', which builds\n"
167
172
  s += "the documentation for the specified file.\n"
@@ -173,7 +178,7 @@ def get_formats():
173
178
  Return a list of output formats the Sage documentation builder
174
179
  will accept on the command-line.
175
180
  """
176
- tut_b = DocBuilder('en/tutorial')
181
+ tut_b = DocBuilder('en/tutorial', BuildOptions())
177
182
  formats = tut_b._output_formats()
178
183
  formats.remove('html')
179
184
  return ['html', 'pdf'] + formats
@@ -251,21 +256,6 @@ class help_wrapper(argparse.Action):
251
256
  print(help_formats(), end="")
252
257
  if self.dest == 'commands':
253
258
  print(help_commands(values), end="")
254
- if self.dest == 'all_documents':
255
- if values == 'reference':
256
- b = ReferenceBuilder('reference')
257
- refdir = os.path.join(os.environ['SAGE_DOC_SRC'], 'en', b.name)
258
- s = b.get_all_documents(refdir)
259
- # Put the bibliography first, because it needs to be built first:
260
- s.remove('reference/references')
261
- s.insert(0, 'reference/references')
262
- elif values == 'all':
263
- s = get_documents()
264
- # Put the reference manual first, because it needs to be built first:
265
- s.remove('reference')
266
- s.insert(0, 'reference')
267
- for d in s:
268
- print(d)
269
259
  setattr(namespace, 'printed_list', 1)
270
260
  sys.exit(0)
271
261
 
@@ -305,9 +295,6 @@ def setup_parser():
305
295
  standard.add_argument("--no-plot", dest="no_plot",
306
296
  action="store_true",
307
297
  help="do not include graphics auto-generated using the '.. plot' markup")
308
- standard.add_argument("--no-preparsed-examples", dest="no_preparsed_examples",
309
- action="store_true",
310
- help="do not show preparsed versions of EXAMPLES blocks")
311
298
  standard.add_argument("--include-tests-blocks", dest="skip_tests", default=True,
312
299
  action="store_false",
313
300
  help="include TESTS blocks in the reference manual")
@@ -339,7 +326,11 @@ def setup_parser():
339
326
  type=int, default=1, metavar="LEVEL",
340
327
  action="store",
341
328
  help="report progress at LEVEL=0 (quiet), 1 (normal), 2 (info), or 3 (debug); does not affect children")
329
+ standard.add_argument("-s", "--source", dest="source_dir", type=Path,
330
+ default=None, metavar="DIR", action="store",
331
+ help="directory containing the documentation source files")
342
332
  standard.add_argument("-o", "--output", dest="output_dir", default=None,
333
+ type=Path,
343
334
  metavar="DIR", action="store",
344
335
  help="if DOCUMENT is a single file ('file=...'), write output to this directory")
345
336
 
@@ -359,7 +350,6 @@ def setup_parser():
359
350
  advanced.add_argument("--all-documents", dest="all_documents",
360
351
  type=str, metavar="ARG",
361
352
  choices=['all', 'reference'],
362
- action=help_wrapper,
363
353
  help="if ARG is 'reference', list all subdocuments"
364
354
  " of en/reference. If ARG is 'all', list all main"
365
355
  " documents")
@@ -456,8 +446,35 @@ class IntersphinxCache:
456
446
  def main():
457
447
  # Parse the command-line.
458
448
  parser = setup_parser()
459
- args = parser.parse_args()
460
- DocBuilder._options = args
449
+ args: BuildOptions = parser.parse_args() # type: ignore
450
+
451
+ # Check that the docs source directory exists
452
+ if args.source_dir is None:
453
+ args.source_dir = Path(os.environ.get('SAGE_DOC_SRC', 'src/doc'))
454
+ args.source_dir = args.source_dir.absolute()
455
+ if not args.source_dir.is_dir():
456
+ parser.error(f"Source directory {args.source_dir} does not exist.")
457
+
458
+ if args.all_documents:
459
+ if args.all_documents == 'reference':
460
+ docs = get_all_reference_documents(args.source_dir / 'en')
461
+ elif args.all_documents == 'all':
462
+ docs = get_all_documents(args.source_dir)
463
+ else:
464
+ parser.error(f"Unknown argument {args.all_documents} for --all-documents.")
465
+ for d in docs:
466
+ print(d.as_posix())
467
+ sys.exit(0)
468
+
469
+ # Check that the docs output directory exists
470
+ if args.output_dir is None:
471
+ args.output_dir = Path(os.environ.get('SAGE_DOC', 'src/doc'))
472
+ args.output_dir = args.output_dir.absolute()
473
+ if not args.output_dir.exists():
474
+ try:
475
+ args.output_dir.mkdir(parents=True)
476
+ except Exception as e:
477
+ parser.error(f"Failed to create output directory {args.output_dir}: {e}")
461
478
 
462
479
  # Get the name and type (target format) of the document we are
463
480
  # trying to build.
@@ -465,30 +482,24 @@ def main():
465
482
  if not name or not typ:
466
483
  parser.print_help()
467
484
  sys.exit(1)
468
- elif name == 'all':
469
- sys.exit(os.system(f'cd {shlex.quote(SAGE_DOC_SRC)} '
470
- f'&& ${{MAKE:-make}} -j${{SAGE_NUM_THREADS_PARALLEL:-1}} doc-{typ}'))
471
485
 
472
486
  # Set up module-wide logging.
473
487
  setup_logger(args.verbose, args.color)
474
488
 
475
489
  def excepthook(*exc_info):
476
490
  logger.error('Error building the documentation.', exc_info=exc_info)
477
- if build_options.INCREMENTAL_BUILD:
478
- logger.error('''
479
- Note: incremental documentation builds sometimes cause spurious
480
- error messages. To be certain that these are real errors, run
481
- "make doc-clean doc-uninstall" first and try again.''')
491
+ logger.info('''
492
+ Note: incremental documentation builds sometimes cause spurious
493
+ error messages. To be certain that these are real errors, run
494
+ "make doc-clean doc-uninstall" first and try again.''')
482
495
 
483
496
  sys.excepthook = excepthook
484
497
 
485
- # Process selected options.
498
+ # Set up the environment based on the command-line options
486
499
  if args.check_nested:
487
500
  os.environ['SAGE_CHECK_NESTED'] = 'True'
488
-
489
501
  if args.underscore:
490
502
  os.environ['SAGE_DOC_UNDERSCORE'] = "True"
491
-
492
503
  if args.sphinx_opts:
493
504
  build_options.ALLSPHINXOPTS += args.sphinx_opts.replace(',', ' ') + " "
494
505
  if args.no_pdf_links:
@@ -497,21 +508,21 @@ def main():
497
508
  build_options.ALLSPHINXOPTS += "-n "
498
509
  if args.no_plot:
499
510
  os.environ['SAGE_SKIP_PLOT_DIRECTIVE'] = 'yes'
500
- if args.no_preparsed_examples:
501
- os.environ['SAGE_PREPARSED_DOC'] = 'no'
502
511
  if args.live_doc:
503
512
  os.environ['SAGE_LIVE_DOC'] = 'yes'
504
513
  if args.skip_tests:
505
514
  os.environ['SAGE_SKIP_TESTS_BLOCKS'] = 'True'
506
515
  if args.use_cdns:
507
516
  os.environ['SAGE_USE_CDNS'] = 'yes'
517
+ os.environ['SAGE_DOC_SRC'] = str(args.source_dir)
518
+ os.environ['SAGE_DOC'] = str(args.output_dir)
508
519
 
509
520
  build_options.ABORT_ON_ERROR = not args.keep_going
510
521
 
511
522
  # Set up Intersphinx cache
512
523
  _ = IntersphinxCache()
513
524
 
514
- builder = get_builder(name)
525
+ builder = get_builder(name, args)
515
526
 
516
527
  if not args.no_prune_empty_dirs:
517
528
  # Delete empty directories. This is needed in particular for empty
@@ -519,11 +530,13 @@ def main():
519
530
  # directories it leaves behind. See Issue #20010.
520
531
  # Issue #31948: This is not parallelization-safe; use the option
521
532
  # --no-prune-empty-dirs to turn it off
522
- for dirpath, dirnames, filenames in os.walk(builder.dir, topdown=False):
533
+ for dirpath, dirnames, filenames in os.walk(args.source_dir, topdown=False):
523
534
  if not dirnames + filenames:
524
535
  logger.warning('Deleting empty directory {0}'.format(dirpath))
525
536
  os.rmdir(dirpath)
526
537
 
538
+ import sage.all # TODO: Remove once all modules can be imported independently # noqa: F401
539
+
527
540
  build = getattr(builder, typ)
528
541
  build()
529
542
 
@@ -4,12 +4,10 @@ Build options
4
4
  This module defines options for building Sage documentation.
5
5
  """
6
6
 
7
+ import argparse
7
8
  import os
8
- import re
9
+ from pathlib import Path
9
10
 
10
- from sage.env import SAGE_DOC_SRC, SAGE_DOC
11
-
12
- LANGUAGES = [d for d in os.listdir(SAGE_DOC_SRC) if re.match('^[a-z][a-z]$', d)]
13
11
  SPHINXOPTS = ""
14
12
  PAPER = ""
15
13
  OMIT = ["introspect"] # docs/dirs to omit when listing and building 'all'
@@ -26,7 +24,9 @@ WEBSITESPHINXOPTS = ""
26
24
  # Number of threads to use for parallel-building the documentation.
27
25
  NUM_THREADS = int(os.environ.get('SAGE_NUM_THREADS', 1))
28
26
 
29
- INCREMENTAL_BUILD = os.path.isdir(SAGE_DOC)
30
-
31
27
  # Error out on errors
32
28
  ABORT_ON_ERROR = True
29
+
30
+ class BuildOptions(argparse.Namespace):
31
+ source_dir: Path
32
+ output_dir: Path