-
-
Notifications
You must be signed in to change notification settings - Fork 482
/
meson.build
215 lines (211 loc) · 7.92 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
project(
'SageMath',
['c', 'cpp', 'cython'],
version: files('src/VERSION.txt'),
license: 'GPL v3',
default_options: ['c_std=c17', 'cpp_std=c++17'],
)
# Python module
# https://mesonbuild.com/Python-module.html
py_module = import('python')
py = py_module.find_installation(pure: false)
py_dep = py.dependency()
# Additional targets
py_with_pytest = py_module.find_installation(
required: false,
modules: ['pytest'],
)
if py_with_pytest.found()
test(
'pytest',
py_with_pytest,
args: [
'-m',
'pytest',
'-c',
meson.current_source_dir() / 'tox.ini',
'--doctest',
meson.current_source_dir() / 'src' / 'sage' / 'categories',
],
timeout: 0,
)
endif
# Workaround for missing init files (Cython doesn't handle namespace packages well)
create_files_command = [
py,
'-c',
'''
import os
content = "# Here so that cython creates the correct module name"
file_paths = [
'src/sage/interfaces/__init__.py',
'src/sage/crypto/block_cipher/__init__.py',
'src/sage/crypto/public_key/__init__.py',
'src/sage/logic/__init__.py',
'src/sage/parallel/__init__.py',
'src/sage/dynamics/cellular_automata/__init__.py',
'src/sage/dynamics/arithmetic_dynamics/__init__.py',
'src/sage/dynamics/__init__.py',
'src/sage/dynamics/complex_dynamics/__init__.py',
'src/sage/knots/__init__.py',
'src/sage/topology/__init__.py',
'src/sage/functions/__init__.py',
'src/sage/manifolds/subsets/__init__.py',
'src/sage/manifolds/__init__.py',
'src/sage/manifolds/differentiable/examples/__init__.py',
'src/sage/manifolds/differentiable/__init__.py',
'src/sage/coding/source_coding/__init__.py',
'src/sage/coding/guruswami_sudan/__init__.py',
'src/sage/coding/__init__.py',
'src/sage/coding/codecan/__init__.py',
'src/sage/games/__init__.py',
'src/sage/quivers/__init__.py',
'src/sage/schemes/cyclic_covers/__init__.py',
'src/sage/schemes/plane_conics/__init__.py',
'src/sage/schemes/curves/__init__.py',
'src/sage/schemes/plane_quartics/__init__.py',
'src/sage/schemes/jacobians/__init__.py',
'src/sage/schemes/toric/sheaf/__init__.py',
'src/sage/schemes/toric/__init__.py',
'src/sage/schemes/product_projective/__init__.py',
'src/sage/schemes/elliptic_curves/__init__.py',
'src/sage/schemes/riemann_surfaces/__init__.py',
'src/sage/schemes/hyperelliptic_curves/__init__.py',
'src/sage/schemes/berkovich/__init__.py',
'src/sage/schemes/generic/__init__.py',
'src/sage/schemes/projective/__init__.py',
'src/sage/schemes/__init__.py',
'src/sage/schemes/affine/__init__.py',
'src/sage/modular/hecke/__init__.py',
'src/sage/modular/pollack_stevens/__init__.py',
'src/sage/modular/overconvergent/__init__.py',
'src/sage/modular/modform/__init__.py',
'src/sage/modular/quasimodform/__init__.py',
'src/sage/modular/modsym/__init__.py',
'src/sage/modular/local_comp/__init__.py',
'src/sage/modular/quatalg/__init__.py',
'src/sage/modular/ssmod/__init__.py',
'src/sage/modular/abvar/__init__.py',
'src/sage/modular/__init__.py',
'src/sage/modular/btquotients/__init__.py',
'src/sage/modular/arithgroup/__init__.py',
'src/sage/modular/modform_hecketriangle/__init__.py',
'src/sage/combinat/cluster_algebra_quiver/__init__.py',
'src/sage/combinat/root_system/__init__.py',
'src/sage/combinat/species/__init__.py',
'src/sage/combinat/designs/__init__.py',
'src/sage/combinat/posets/__init__.py',
'src/sage/combinat/matrices/__init__.py',
'src/sage/combinat/rigged_configurations/__init__.py',
'src/sage/combinat/ncsf_qsym/__init__.py',
'src/sage/combinat/path_tableaux/__init__.py',
'src/sage/combinat/sf/__init__.py',
'src/sage/combinat/__init__.py',
'src/sage/combinat/chas/__init__.py',
'src/sage/combinat/ncsym/__init__.py',
'src/sage/combinat/words/__init__.py',
'src/sage/combinat/crystals/__init__.py',
'src/sage/tensor/modules/__init__.py',
'src/sage/tensor/__init__.py',
'src/sage/groups/matrix_gps/__init__.py',
'src/sage/groups/semimonomial_transformations/__init__.py',
'src/sage/groups/perm_gps/partn_ref2/__init__.py',
'src/sage/groups/perm_gps/partn_ref/__init__.py',
'src/sage/groups/perm_gps/__init__.py',
'src/sage/groups/__init__.py',
'src/sage/groups/affine_gps/__init__.py',
'src/sage/groups/abelian_gps/__init__.py',
'src/sage/groups/additive_abelian/__init__.py',
'src/sage/groups/lie_gps/__init__.py',
'src/sage/groups/misc_gps/__init__.py',
'src/sage/symbolic/__init__.py',
'src/sage/symbolic/integration/__init__.py',
'src/sage/lfunctions/__init__.py',
'src/sage/arith/__init__.py',
'src/sage/ext/__init__.py',
'src/sage/ext/interpreters/__init__.py',
'src/sage/categories/examples/__init__.py',
'src/sage/categories/__init__.py',
'src/sage/modules/fg_pid/__init__.py',
'src/sage/modules/__init__.py',
'src/sage/modules/with_basis/__init__.py',
'src/sage/modules/fp_graded/steenrod/__init__.py',
'src/sage/modules/fp_graded/__init__.py',
'src/sage/misc/__init__.py',
'src/sage/rings/convert/__init__.py',
'src/sage/rings/invariants/__init__.py',
'src/sage/rings/finite_rings/__init__.py',
'src/sage/rings/function_field/__init__.py',
'src/sage/rings/function_field/drinfeld_modules/__init__.py',
'src/sage/rings/semirings/__init__.py',
'src/sage/rings/number_field/__init__.py',
'src/sage/rings/__init__.py',
'src/sage/rings/padics/__init__.py',
'src/sage/rings/valuation/__init__.py',
'src/sage/rings/asymptotic/__init__.py',
'src/sage/rings/polynomial/weil/__init__.py',
'src/sage/rings/polynomial/__init__.py',
'src/sage/rings/polynomial/padics/__init__.py',
'src/sage/monoids/__init__.py',
'src/sage/matrix/__init__.py',
'src/sage/matroids/__init__.py',
'src/sage/interacts/__init__.py',
'src/sage/__init__.py',
'src/sage/plot/__init__.py',
'src/sage/plot/plot3d/__init__.py',
'src/sage/typeset/__init__.py',
'src/sage/algebras/lie_conformal_algebras/__init__.py',
'src/sage/algebras/fusion_rings/__init__.py',
'src/sage/algebras/letterplace/__init__.py',
'src/sage/algebras/quatalg/__init__.py',
'src/sage/algebras/steenrod/__init__.py',
'src/sage/algebras/finite_dimensional_algebras/__init__.py',
'src/sage/algebras/__init__.py',
'src/sage/algebras/hecke_algebras/__init__.py',
'src/sage/algebras/lie_algebras/__init__.py',
'src/sage/algebras/quantum_groups/__init__.py',
'src/sage/quadratic_forms/genera/__init__.py',
'src/sage/quadratic_forms/__init__.py',
'src/sage/game_theory/__init__.py',
'src/sage/sandpiles/__init__.py',
'src/sage/sat/__init__.py',
'src/sage/homology/__init__.py',
'src/sage/geometry/riemannian_manifolds/__init__.py',
'src/sage/geometry/hyperplane_arrangement/__init__.py',
'src/sage/geometry/triangulation/__init__.py',
'src/sage/geometry/polyhedron/modules/__init__.py',
'src/sage/geometry/polyhedron/__init__.py',
'src/sage/geometry/polyhedron/combinatorial_polyhedron/__init__.py',
'src/sage/geometry/__init__.py',
'src/sage/geometry/hyperbolic_space/__init__.py',
'src/sage/sets/__init__.py',
'src/sage/probability/__init__.py',
'src/sage/numerical/backends/__init__.py',
'src/sage/numerical/__init__.py',
'src/sage/data_structures/__init__.py',
'src/sage/graphs/graph_decompositions/__init__.py',
'src/sage/graphs/generators/__init__.py',
'src/sage/graphs/__init__.py',
'src/sage/graphs/base/__init__.py',
'src/sage/databases/__init__.py',
'src/sage/stats/hmm/__init__.py',
'src/sage/stats/__init__.py',
'src/sage/stats/distributions/__init__.py',
'src/sage/libs/gap/__init__.py',
'src/sage/libs/mpfi/__init__.py',
'src/sage/libs/__init__.py',
'src/sage/libs/polybori/__init__.py',
'src/sage/libs/mpfr/__init__.py',
'src/sage/libs/mpc/__init__.py',
'src/sage/calculus/transforms/__init__.py',
'src/sage/calculus/__init__.py',
]
for path in file_paths:
path = "''' + meson.current_source_dir() + '''/" + path
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, 'w') as f:
f.write(content)
''',
]
run_command(create_files_command, check: true)
subdir('src')