Skip to content

Commit

Permalink
sagemathgh-39139: Meson: install __init__ files
Browse files Browse the repository at this point in the history
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

As proposed in
sagemath#39030 (comment).
Namespace support is still not there for all tools (cython, pytest,
...), so it's a good idea to still distribute these `__init__.py` files
for now until the ecosystem catches up.

Also fixes failures of the meson workflow due to a missing python file.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

- sagemath#39140
    
URL: sagemath#39139
Reported by: Tobias Diez
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Dec 18, 2024
2 parents 1827e08 + 4568979 commit cf38367
Show file tree
Hide file tree
Showing 88 changed files with 113 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
key: ${{ runner.os }}-meson-${{ matrix.python }}

- name: Setup Conda environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python }}
miniforge-version: latest
Expand Down
1 change: 1 addition & 0 deletions src/sage/algebras/finite_dimensional_algebras/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'finite_dimensional_algebra.py',
'finite_dimensional_algebra_element.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/algebras/fusion_rings/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'f_matrix.py',
'fast_parallel_fmats_methods.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/algebras/letterplace/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'free_algebra_element_letterplace.pxd',
'free_algebra_letterplace.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/algebras/lie_algebras/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'abelian.py',
'affine_lie_algebra.py',
'all.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/algebras/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'affine_nil_temperley_lieb.py',
'algebra.py',
'all.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/algebras/quatalg/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'quaternion_algebra.py',
'quaternion_algebra_element.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/arith/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'all__sagemath_objects.py',
'constants.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/calculus/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'calculus.py',
'desolvers.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/calculus/transforms/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'dft.py',
'dwt.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/categories/examples/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'algebras_with_basis.py',
'all.py',
'commutative_additive_monoids.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/categories/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'action.pxd',
'additive_groups.py',
'additive_magmas.py',
Expand Down
7 changes: 6 additions & 1 deletion src/sage/coding/codecan/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
py.install_sources('all.py', 'codecan.pxd', subdir: 'sage/coding/codecan')
py.install_sources(
'__init__.py',
'all.py',
'codecan.pxd',
subdir: 'sage/coding/codecan',
)

extension_data = {
'autgroup_can_label' : files('autgroup_can_label.pyx'),
Expand Down
1 change: 1 addition & 0 deletions src/sage/coding/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'abstract_code.py',
'ag_code.py',
'all.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/combinat/crystals/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'affine.py',
'affine_factorization.py',
'affinization.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/combinat/designs/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
py.install_sources(
'MOLS_handbook_data.py',
'__init__.py',
'all.py',
'bibd.py',
'block_design.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/combinat/matrices/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'dlxcpp.py',
'hadamard_matrix.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/combinat/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
py.install_sources(
'SJT.py',
'__init__.py',
'abstract_tree.py',
'affine_permutation.py',
'algebraic_combinatorics.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/combinat/posets/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'cartesian_product.py',
'd_complete.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/combinat/rigged_configurations/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'bij_abstract_class.py',
'bij_infinity.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/combinat/root_system/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'ambient_space.py',
'associahedron.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/combinat/words/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'abstract_word.py',
'all.py',
'alphabet.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/data_structures/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'binary_matrix.pxd',
'binary_search.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/dynamics/arithmetic_dynamics/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'affine_ds.py',
'all.py',
'berkovich_ds.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/dynamics/complex_dynamics/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'mandel_julia.py',
subdir: 'sage/dynamics/complex_dynamics',
Expand Down
1 change: 1 addition & 0 deletions src/sage/dynamics/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'finite_dynamical_system.py',
'finite_dynamical_system_catalog.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/ext/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all__sagemath_objects.py',
'ccobject.h',
'cplusplus.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/functions/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'airy.py',
'all.py',
'bessel.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/games/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'hexad.py',
'quantumino.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'cone.py',
'cone_catalog.py',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'base.pxd',
'combinatorial_face.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/polyhedron/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'backend_cdd.py',
'backend_cdd_rdf.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/geometry/triangulation/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'data.pxd',
'element.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/graphs/base/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'boost_graph.pxd',
'c_graph.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/graphs/generators/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'basic.py',
'chessboard.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/graphs/graph_decompositions/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ endif
rw = cc.find_library('rw')

py.install_sources(
'__init__.py',
'all.py',
'all__sagemath_tdlib.py',
'fast_digraph.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/graphs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cliquer = cc.find_library('cliquer')
planarity = cc.find_library('planarity')

py.install_sources(
'__init__.py',
'all.py',
'all__sagemath_bliss.py',
'all__sagemath_mcqd.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/groups/matrix_gps/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'binary_dihedral.py',
'catalog.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/groups/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'artin.py',
'braid.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/groups/perm_gps/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'constructor.py',
'cubegroup.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/groups/perm_gps/partn_ref/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'automorphism_group_canonical_label.pxd',
'canonical_augmentation.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/groups/perm_gps/partn_ref2/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'refinement_generic.pxd',
subdir: 'sage/groups/perm_gps/partn_ref2',
Expand Down
1 change: 1 addition & 0 deletions src/sage/groups/semimonomial_transformations/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'semimonomial_transformation.pxd',
'semimonomial_transformation_group.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/interacts/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'algebra.py',
'all.py',
'calculus.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/interfaces/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'abc.py',
'all.py',
'all__sagemath_polyhedra.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/lfunctions/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'dokchitser.py',
'lcalc.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/gap/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'all_documented_functions.py',
'assigned_names.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gc = cc.find_library('gc')
homfly = cc.find_library('homfly', has_headers: ['homfly.h'])

py.install_sources(
'__init__.py',
'all.py',
'all__sagemath_coxeter3.py',
'all__sagemath_meataxe.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/matrix/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ iml = cc.find_library('iml')


py.install_sources(
'__init__.py',
'action.pxd',
'all.py',
'all__sagemath_meataxe.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/matroids/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'advanced.py',
'all.py',
'basis_exchange_matroid.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ foreach package : no_processing
endforeach

py.install_sources(
'__init__.py',
'all.py',
'all__sagemath_bliss.py',
'all__sagemath_categories.py',
Expand Down
11 changes: 0 additions & 11 deletions src/sage/misc/cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,6 @@ def cython(filename, verbose=0, compile_message=False,
....: from sage.misc.cachefunc cimport cache_key
....: ''')

In Cython 0.29.33 using `from PACKAGE cimport MODULE` is broken
when `PACKAGE` is a namespace package, see :issue:`35322`::

sage: cython('''
....: from sage.misc cimport cachefunc
....: ''')
Traceback (most recent call last):
...
RuntimeError: Error compiling Cython file:
...
...: 'sage/misc.pxd' not found
"""
if not filename.endswith('pyx'):
print("Warning: file (={}) should have extension .pyx".format(filename), file=sys.stderr)
Expand Down
1 change: 1 addition & 0 deletions src/sage/misc/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'abstract_method.py',
'all.py',
'all__sagemath_environment.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/modular/arithgroup/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'arithgroup_generic.py',
'arithgroup_perm.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/modular/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'buzzard.py',
'congroup.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/modular/modform/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'ambient.py',
'ambient_R.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/modular/modsym/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'ambient.py',
'apply.pxd',
Expand Down
1 change: 1 addition & 0 deletions src/sage/modular/pollack_stevens/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'dist.pxd',
'distributions.py',
Expand Down
2 changes: 2 additions & 0 deletions src/sage/modules/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'complex_double_vector.py',
'diamond_cutting.py',
Expand All @@ -16,6 +17,7 @@ py.install_sources(
'module.pxd',
'module_functors.py',
'multi_filtered_vector_space.py',
'numpy_util.pxd',
'quotient_module.py',
'real_double_vector.py',
'submodule.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/modules/with_basis/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
py.install_sources(
'__init__.py',
'all.py',
'cell_module.py',
'indexed_element.pxd',
Expand Down
Loading

0 comments on commit cf38367

Please sign in to comment.