passagemath-environment 10.4.1__py3-none-any.whl

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 (70) hide show
  1. passagemath_environment-10.4.1.data/scripts/sage +1140 -0
  2. passagemath_environment-10.4.1.data/scripts/sage-env +667 -0
  3. passagemath_environment-10.4.1.data/scripts/sage-num-threads.py +105 -0
  4. passagemath_environment-10.4.1.data/scripts/sage-python +2 -0
  5. passagemath_environment-10.4.1.data/scripts/sage-venv-config +42 -0
  6. passagemath_environment-10.4.1.data/scripts/sage-version.sh +9 -0
  7. passagemath_environment-10.4.1.dist-info/METADATA +76 -0
  8. passagemath_environment-10.4.1.dist-info/RECORD +70 -0
  9. passagemath_environment-10.4.1.dist-info/WHEEL +5 -0
  10. passagemath_environment-10.4.1.dist-info/top_level.txt +1 -0
  11. sage/all__sagemath_environment.py +4 -0
  12. sage/env.py +496 -0
  13. sage/features/__init__.py +981 -0
  14. sage/features/all.py +126 -0
  15. sage/features/bliss.py +85 -0
  16. sage/features/cddlib.py +38 -0
  17. sage/features/coxeter3.py +45 -0
  18. sage/features/csdp.py +83 -0
  19. sage/features/cython.py +38 -0
  20. sage/features/databases.py +302 -0
  21. sage/features/dvipng.py +40 -0
  22. sage/features/ecm.py +42 -0
  23. sage/features/ffmpeg.py +119 -0
  24. sage/features/four_ti_2.py +55 -0
  25. sage/features/fricas.py +66 -0
  26. sage/features/gap.py +86 -0
  27. sage/features/gfan.py +38 -0
  28. sage/features/giac.py +30 -0
  29. sage/features/graph_generators.py +171 -0
  30. sage/features/graphviz.py +117 -0
  31. sage/features/igraph.py +44 -0
  32. sage/features/imagemagick.py +138 -0
  33. sage/features/interfaces.py +256 -0
  34. sage/features/internet.py +65 -0
  35. sage/features/jmol.py +44 -0
  36. sage/features/join_feature.py +146 -0
  37. sage/features/kenzo.py +77 -0
  38. sage/features/latex.py +300 -0
  39. sage/features/latte.py +85 -0
  40. sage/features/lrs.py +164 -0
  41. sage/features/mcqd.py +45 -0
  42. sage/features/meataxe.py +46 -0
  43. sage/features/mip_backends.py +114 -0
  44. sage/features/msolve.py +68 -0
  45. sage/features/nauty.py +70 -0
  46. sage/features/normaliz.py +43 -0
  47. sage/features/palp.py +65 -0
  48. sage/features/pandoc.py +42 -0
  49. sage/features/pdf2svg.py +41 -0
  50. sage/features/phitigra.py +42 -0
  51. sage/features/pkg_systems.py +195 -0
  52. sage/features/polymake.py +43 -0
  53. sage/features/poppler.py +58 -0
  54. sage/features/rubiks.py +180 -0
  55. sage/features/sagemath.py +1205 -0
  56. sage/features/sat.py +103 -0
  57. sage/features/singular.py +48 -0
  58. sage/features/sirocco.py +45 -0
  59. sage/features/sphinx.py +71 -0
  60. sage/features/standard.py +38 -0
  61. sage/features/symengine_py.py +44 -0
  62. sage/features/tdlib.py +38 -0
  63. sage/features/threejs.py +75 -0
  64. sage/features/topcom.py +67 -0
  65. sage/misc/all__sagemath_environment.py +2 -0
  66. sage/misc/package.py +570 -0
  67. sage/misc/package_dir.py +621 -0
  68. sage/misc/temporary_file.py +546 -0
  69. sage/misc/viewer.py +369 -0
  70. sage/version.py +5 -0
sage/features/sat.py ADDED
@@ -0,0 +1,103 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ r"""
3
+ Feature for testing the presence of SAT solvers
4
+ """
5
+
6
+ from . import Executable, PythonModule
7
+
8
+
9
+ class Glucose(Executable):
10
+ r"""
11
+ A :class:`~sage.features.Feature` describing the presence of an
12
+ executable from the :ref:`Glucose SAT solver <spkg_glucose>`.
13
+
14
+ EXAMPLES::
15
+
16
+ sage: from sage.features.sat import Glucose
17
+ sage: GlucoseExecutable().is_present() # optional - glucose
18
+ FeatureTestResult('glucose', True)
19
+ """
20
+ def __init__(self, executable="glucose"):
21
+ r"""
22
+ TESTS::
23
+
24
+ sage: from sage.features.sat import Glucose
25
+ sage: isinstance(Glucose(), Glucose)
26
+ True
27
+ """
28
+ Executable.__init__(self, name=executable, executable=executable,
29
+ spkg="glucose", type="optional")
30
+
31
+
32
+ class Kissat(Executable):
33
+ r"""
34
+ A :class:`~sage.features.Feature` describing the presence of the
35
+ :ref:`Kissat SAT solver <spkg_kissat>`.
36
+
37
+ EXAMPLES::
38
+
39
+ sage: from sage.features.sat import Kissat
40
+ sage: Kissat().is_present() # optional - kissat
41
+ FeatureTestResult('kissat', True)
42
+ """
43
+ def __init__(self):
44
+ r"""
45
+ TESTS::
46
+
47
+ sage: from sage.features.sat import Kissat
48
+ sage: isinstance(Kissat(), Kissat)
49
+ True
50
+ """
51
+ Executable.__init__(self, name="kissat", executable="kissat",
52
+ spkg="kissat", type="optional")
53
+
54
+
55
+ class Pycosat(PythonModule):
56
+ r"""
57
+ A :class:`~sage.features.Feature` describing the presence of :ref:`spkg_pycosat`.
58
+
59
+ EXAMPLES::
60
+
61
+ sage: from sage.features.sat import Pycosat
62
+ sage: PycosatExecutable().is_present() # optional - pycosat
63
+ FeatureTestResult('pycosat', True)
64
+ """
65
+ def __init__(self):
66
+ r"""
67
+ TESTS::
68
+
69
+ sage: from sage.features.sat import Pycosat
70
+ sage: isinstance(Pycosat(), Pycosat)
71
+ True
72
+ """
73
+ PythonModule.__init__(self, "pycosat",
74
+ spkg="pycosat", type="optional")
75
+
76
+
77
+ class Pycryptosat(PythonModule):
78
+ r"""
79
+ A :class:`~sage.features.Feature` describing the presence of :ref:`spkg_pycryptosat`.
80
+
81
+ EXAMPLES::
82
+
83
+ sage: from sage.features.sat import Pycryptosat
84
+ sage: PycryptosatExecutable().is_present() # optional - pycryptosat
85
+ FeatureTestResult('pycryptosat', True)
86
+ """
87
+ def __init__(self):
88
+ r"""
89
+ TESTS::
90
+
91
+ sage: from sage.features.sat import Pycryptosat
92
+ sage: isinstance(Pycryptosat(), Pycryptosat)
93
+ True
94
+ """
95
+ PythonModule.__init__(self, "pycryptosat",
96
+ spkg="pycryptosat", type="optional")
97
+
98
+
99
+ def all_features():
100
+ return [Glucose(),
101
+ Kissat(),
102
+ Pycosat(),
103
+ Pycryptosat()]
@@ -0,0 +1,48 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ r"""
3
+ Features for testing the presence of ``singular`` and the SageMath interfaces to it
4
+ """
5
+
6
+ # *****************************************************************************
7
+ # Copyright (C) 2022-2023 Matthias Koeppe
8
+ #
9
+ # Distributed under the terms of the GNU General Public License (GPL)
10
+ # as published by the Free Software Foundation; either version 2 of
11
+ # the License, or (at your option) any later version.
12
+ # https://www.gnu.org/licenses/
13
+ # *****************************************************************************
14
+
15
+ from . import Executable, PythonModule
16
+ from .join_feature import JoinFeature
17
+ from .sagemath import sage__libs__singular
18
+ from sage.env import SINGULAR_BIN
19
+
20
+
21
+ class Singular(Executable):
22
+ r"""
23
+ A :class:`~sage.features.Feature` describing the presence of the :ref:`singular <spkg_singular>` executable.
24
+
25
+ .. SEEALSO::
26
+
27
+ :class:`Feature sage.libs.singular <~sage.features.sagemath.sage__libs__singular>`
28
+
29
+ EXAMPLES::
30
+
31
+ sage: from sage.features.singular import Singular
32
+ sage: Singular().is_present() # needs singular
33
+ FeatureTestResult('singular', True)
34
+ """
35
+ def __init__(self):
36
+ r"""
37
+ TESTS::
38
+
39
+ sage: from sage.features.singular import Singular
40
+ sage: isinstance(Singular(), Singular)
41
+ True
42
+ """
43
+ Executable.__init__(self, "singular", SINGULAR_BIN,
44
+ spkg='singular', type='standard')
45
+
46
+
47
+ def all_features():
48
+ return [Singular()]
@@ -0,0 +1,45 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ r"""
3
+ Features for testing the presence of ``sirocco``
4
+ """
5
+
6
+ # *****************************************************************************
7
+ # Copyright (C) 2016 Julian Rüth
8
+ # 2018 Jeroen Demeyer
9
+ # 2021-2024 Matthias Koeppe
10
+ #
11
+ # Distributed under the terms of the GNU General Public License (GPL)
12
+ # as published by the Free Software Foundation; either version 2 of
13
+ # the License, or (at your option) any later version.
14
+ # https://www.gnu.org/licenses/
15
+ # *****************************************************************************
16
+
17
+ from . import PythonModule
18
+ from .join_feature import JoinFeature
19
+
20
+
21
+ class Sirocco(JoinFeature):
22
+ r"""
23
+ A :class:`~sage.features.Feature` which describes whether the :mod:`sage.libs.sirocco`
24
+ module is available in this installation of Sage.
25
+
26
+ EXAMPLES::
27
+
28
+ sage: from sage.features.sirocco import Sirocco
29
+ sage: Sirocco().require() # optional - sirocco
30
+ """
31
+ def __init__(self):
32
+ r"""
33
+ TESTS::
34
+
35
+ sage: from sage.features.sirocco import Sirocco
36
+ sage: Sirocco()
37
+ Feature('sirocco')
38
+ """
39
+ JoinFeature.__init__(self, "sirocco",
40
+ [PythonModule("sage.libs.sirocco",
41
+ spkg='sagemath_sirocco')])
42
+
43
+
44
+ def all_features():
45
+ return [Sirocco()]
@@ -0,0 +1,71 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ r"""
3
+ Features for testing the presence of ``sphinx``
4
+ """
5
+
6
+ # *****************************************************************************
7
+ # Copyright (C) 2021 Matthias Koeppe
8
+ #
9
+ # Distributed under the terms of the GNU General Public License (GPL)
10
+ # as published by the Free Software Foundation; either version 2 of
11
+ # the License, or (at your option) any later version.
12
+ # https://www.gnu.org/licenses/
13
+ # *****************************************************************************
14
+
15
+ from . import PythonModule
16
+
17
+
18
+ class Sphinx(PythonModule):
19
+ r"""
20
+ A :class:`sage.features.Feature` describing the presence of :ref:`Sphinx <spkg_sphinx>`.
21
+
22
+ Sphinx is provided by a standard package in the Sage distribution,
23
+ but it can be disabled by ``configure --disable-doc``.
24
+
25
+ EXAMPLES::
26
+
27
+ sage: from sage.features.sphinx import Sphinx
28
+ sage: Sphinx().is_present() # optional - sphinx
29
+ FeatureTestResult('sphinx', True)
30
+ """
31
+ def __init__(self):
32
+ r"""
33
+ TESTS::
34
+
35
+ sage: from sage.features.sphinx import Sphinx
36
+ sage: isinstance(Sphinx(), Sphinx)
37
+ True
38
+ """
39
+ PythonModule.__init__(self, 'sphinx', spkg='sphinx', type='standard')
40
+
41
+
42
+ class JupyterSphinx(PythonModule):
43
+ r"""
44
+ A :class:`sage.features.Feature` describing the presence of
45
+ :ref:`jupyter_sphinx <spkg_jupyter_sphinx>`.
46
+
47
+ It is provided by a standard package in the Sage distribution,
48
+ but it can be disabled by ``configure --disable-doc`` and
49
+ ``configure --disable-notebook``.
50
+
51
+ EXAMPLES::
52
+
53
+ sage: from sage.features.sphinx import JupyterSphinx
54
+ sage: JupyterSphinx().is_present() # optional - jupyter_sphinx
55
+ FeatureTestResult('jupyter_sphinx', True)
56
+ """
57
+ def __init__(self):
58
+ r"""
59
+ TESTS::
60
+
61
+ sage: from sage.features.sphinx import JupyterSphinx
62
+ sage: isinstance(JupyterSphinx(), JupyterSphinx)
63
+ True
64
+ """
65
+ PythonModule.__init__(self, 'jupyter_sphinx',
66
+ spkg='jupyter_sphinx', type='standard')
67
+
68
+
69
+ def all_features():
70
+ return [Sphinx(),
71
+ JupyterSphinx()]
@@ -0,0 +1,38 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ r"""
3
+ Check for various standard packages (for modularized distributions)
4
+
5
+ These features are provided by standard packages in the Sage distribution.
6
+ """
7
+
8
+ # *****************************************************************************
9
+ # Copyright (C) 2023 Matthias Koeppe
10
+ #
11
+ # Distributed under the terms of the GNU General Public License (GPL)
12
+ # as published by the Free Software Foundation; either version 2 of
13
+ # the License, or (at your option) any later version.
14
+ # https://www.gnu.org/licenses/
15
+ # *****************************************************************************
16
+
17
+ from . import PythonModule
18
+ from .join_feature import JoinFeature
19
+
20
+
21
+ def all_features():
22
+ return [PythonModule('cvxopt', spkg='cvxopt', type='standard'),
23
+ PythonModule('fpylll', spkg='fpylll', type='standard'),
24
+ JoinFeature('ipython', (PythonModule('IPython'),), spkg='ipython', type='standard'),
25
+ JoinFeature('lrcalc_python', (PythonModule('lrcalc'),), spkg='lrcalc_python', type='standard'),
26
+ PythonModule('mpmath', spkg='mpmath', type='standard'),
27
+ PythonModule('networkx', spkg='networkx', type='standard'),
28
+ PythonModule('numpy', spkg='numpy', type='standard'),
29
+ PythonModule('pexpect', spkg='pexpect', type='standard'),
30
+ JoinFeature('pillow', (PythonModule('PIL'),), spkg='pillow', type='standard'),
31
+ JoinFeature('pplpy', (PythonModule('ppl'),), spkg='pplpy', type='standard'),
32
+ PythonModule('primecountpy', spkg='primecountpy', type='standard'),
33
+ PythonModule('ptyprocess', spkg='ptyprocess', type='standard'),
34
+ PythonModule('pyparsing', spkg='pyparsing', type='standard'),
35
+ PythonModule('requests', spkg='requests', type='standard'),
36
+ PythonModule('rpy2', spkg='rpy2', type='standard'),
37
+ PythonModule('scipy', spkg='scipy', type='standard'),
38
+ PythonModule('sympy', spkg='sympy', type='standard')]
@@ -0,0 +1,44 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ r"""
3
+ Check for symengine_py
4
+ """
5
+
6
+ # ****************************************************************************
7
+ # Copyright (C) 2023 Dima Pasechnik
8
+ #
9
+ # This program is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU General Public License as published by
11
+ # the Free Software Foundation, either version 2 of the License, or
12
+ # (at your option) any later version.
13
+ # https://www.gnu.org/licenses/
14
+ # ****************************************************************************
15
+
16
+ from . import PythonModule
17
+ from .join_feature import JoinFeature
18
+
19
+
20
+ class symengine_py(JoinFeature):
21
+ r"""
22
+ A :class:`sage.features.Feature` describing the presence of the
23
+ Python package :ref:`symengine_py <spkg_symengine_py>`.
24
+
25
+ EXAMPLES::
26
+
27
+ sage: from sage.features.symengine_py import symengine_py
28
+ sage: symengine_py().is_present() # optional - symengine_py
29
+ FeatureTestResult('symengine_py', True)
30
+ """
31
+ def __init__(self):
32
+ r"""
33
+ TESTS::
34
+
35
+ sage: from sage.features.symengine_py import symengine_py
36
+ sage: isinstance(symengine_py(), symengine_py)
37
+ True
38
+ """
39
+ JoinFeature.__init__(self, 'symengine_py',
40
+ [PythonModule('symengine', spkg='symengine_py',
41
+ url='https://pypi.org/project/symengine')])
42
+
43
+ def all_features():
44
+ return [symengine_py()]
sage/features/tdlib.py ADDED
@@ -0,0 +1,38 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ r"""
3
+ Features for testing the presence of ``tdlib``
4
+ """
5
+
6
+ # *****************************************************************************
7
+ # Copyright (C) 2021 Matthias Koeppe
8
+ # 2021 Kwankyu Lee
9
+ #
10
+ # Distributed under the terms of the GNU General Public License (GPL)
11
+ # as published by the Free Software Foundation; either version 2 of
12
+ # the License, or (at your option) any later version.
13
+ # https://www.gnu.org/licenses/
14
+ # *****************************************************************************
15
+
16
+ from . import PythonModule
17
+ from .join_feature import JoinFeature
18
+
19
+
20
+ class Tdlib(JoinFeature):
21
+ r"""
22
+ A :class:`~sage.features.Feature` describing the presence of the SageMath interface to the :ref:`tdlib <spkg_tdlib>` library.
23
+ """
24
+ def __init__(self):
25
+ r"""
26
+ TESTS::
27
+
28
+ sage: from sage.features.tdlib import Tdlib
29
+ sage: isinstance(Tdlib(), Tdlib)
30
+ True
31
+ """
32
+ JoinFeature.__init__(self, 'tdlib',
33
+ [PythonModule('sage.graphs.graph_decompositions.tdlib',
34
+ spkg='sagemath_tdlib')])
35
+
36
+
37
+ def all_features():
38
+ return [Tdlib()]
@@ -0,0 +1,75 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ from pathlib import Path
3
+
4
+ from . import StaticFile
5
+
6
+
7
+ class Threejs(StaticFile):
8
+ r"""
9
+ A :class:`~sage.features.Feature` which describes the presence of
10
+ threejs-sage in a few standard locations.
11
+
12
+ EXAMPLES::
13
+
14
+ sage: from sage.features.threejs import Threejs
15
+ sage: bool(Threejs().is_present()) # needs threejs
16
+ True
17
+ """
18
+
19
+ def __init__(self):
20
+ r"""
21
+ TESTS::
22
+
23
+ sage: from sage.features.threejs import Threejs
24
+ sage: isinstance(Threejs(), Threejs)
25
+ True
26
+ """
27
+ from sage.env import SAGE_SHARE, THREEJS_DIR
28
+
29
+ share_dir = Path(SAGE_SHARE)
30
+ threejs_search_path = THREEJS_DIR or (
31
+ (share_dir / "jupyter" / "nbextensions" / "threejs-sage"),
32
+ (share_dir / "sagemath" / "threejs-sage"),
33
+ (share_dir / "sage" / "threejs"),
34
+ (share_dir / "threejs-sage")
35
+ )
36
+
37
+ try:
38
+ version = self.required_version()
39
+ filename = Path(version) / "three.min.js"
40
+ except FileNotFoundError:
41
+ filename = 'unknown'
42
+
43
+ StaticFile.__init__(
44
+ self, name='threejs',
45
+ filename=filename,
46
+ spkg='threejs',
47
+ type='standard',
48
+ search_path=threejs_search_path,
49
+ description="JavaScript library to display 3D graphics")
50
+
51
+ def required_version(self):
52
+ """
53
+ Return the version of threejs that Sage requires.
54
+
55
+ Defining what version is required is delegated to the distribution package
56
+ that provides the file ``threejs-version.txt`` in :mod:`sage.ext_data.threejs`.
57
+
58
+ If the file is not provided, :exc:`FileNotFoundError` is raised.
59
+
60
+ EXAMPLES::
61
+
62
+ sage: from sage.features.threejs import Threejs
63
+ sage: Threejs().required_version()
64
+ 'r...'
65
+ """
66
+ from sage.env import SAGE_EXTCODE
67
+
68
+ filename = Path(SAGE_EXTCODE) / 'threejs' / 'threejs-version.txt'
69
+
70
+ with open(filename) as f:
71
+ return f.read().strip()
72
+
73
+
74
+ def all_features():
75
+ return [Threejs()]
@@ -0,0 +1,67 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ r"""
3
+ Features for testing the presence of topcom executables
4
+ """
5
+
6
+ # *****************************************************************************
7
+ # Copyright (C) 2022-2024 Matthias Koeppe
8
+ #
9
+ # Distributed under the terms of the GNU General Public License (GPL)
10
+ # as published by the Free Software Foundation; either version 2 of
11
+ # the License, or (at your option) any later version.
12
+ # https://www.gnu.org/licenses/
13
+ # *****************************************************************************
14
+
15
+ from . import Executable
16
+ from .join_feature import JoinFeature
17
+
18
+
19
+ class TOPCOMExecutable(Executable):
20
+ r"""
21
+ A :class:`~sage.features.Feature` which checks for executables from the :ref:`TOPCOM <spkg_topcom>` package.
22
+
23
+ EXAMPLES::
24
+
25
+ sage: from sage.features.topcom import TOPCOMExecutable
26
+ sage: TOPCOMExecutable('points2allfinetriangs').is_present() # optional - topcom
27
+ FeatureTestResult('topcom_points2allfinetriangs', True)
28
+ """
29
+ def __init__(self, name):
30
+ r"""
31
+ TESTS::
32
+
33
+ sage: from sage.features.topcom import TOPCOMExecutable
34
+ sage: isinstance(TOPCOMExecutable('points2finetriangs'), TOPCOMExecutable)
35
+ True
36
+ """
37
+ Executable.__init__(self, name=f"topcom_{name}",
38
+ executable=name,
39
+ spkg="topcom")
40
+
41
+
42
+ class TOPCOM(JoinFeature):
43
+ r"""
44
+ A :class:`~sage.features.Feature` describing the presence of the executables
45
+ which comes as a part of :ref:`TOPCOM <spkg_topcom>`.
46
+
47
+ EXAMPLES::
48
+
49
+ sage: from sage.features.topcom import TOPCOM
50
+ sage: TOPCOM().is_present() # optional - topcom
51
+ FeatureTestResult('topcom', True)
52
+ """
53
+ def __init__(self):
54
+ r"""
55
+ TESTS::
56
+
57
+ sage: from sage.features.topcom import TOPCOM
58
+ sage: isinstance(TOPCOM(), TOPCOM)
59
+ True
60
+ """
61
+ JoinFeature.__init__(self, "topcom",
62
+ [TOPCOMExecutable(name)
63
+ for name in ('points2allfinetriangs',)])
64
+
65
+
66
+ def all_features():
67
+ return [TOPCOM()]
@@ -0,0 +1,2 @@
1
+ # sage_setup: distribution = sagemath-environment
2
+ from sage.misc.temporary_file import tmp_dir, tmp_filename