Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
)
from sage.doctest.parsing import SageDocTestParser, SageOutputChecker


class SageDoctestModule(DoctestModule):
"""
This is essentially a copy of `DoctestModule` from
Expand Down Expand Up @@ -125,15 +124,26 @@ def _find(
checker=SageOutputChecker(),
continue_on_failure=_get_continue_on_failure(self.config),
)
# Monkey patch exception reporting to ignore FeatureNotPresentError
old_report_unexpected_exception = runner.report_unexpected_exception
def _report_unexpected_exception(self, test, example, exc_info):
if isinstance(exc_info[1], FeatureNotPresentError):
# Ignore FeatureNotPresentError
# (it's not an error in the doctest)
return
return old_report_unexpected_exception(self, test, example, exc_info)
runner.report_unexpected_exception = _report_unexpected_exception
try:
print(f"Collecting doctests from { self.path }: { module }")
for test in finder.find(module, module.__name__):
print(test)
if test.examples: # skip empty doctests
yield DoctestItem.from_parent(
self, name=test.name, runner=runner, dtest=test
)
except FeatureNotPresentError as exception:
pytest.skip(
f"unable to import module { self.path } due to missing feature { exception.feature.name }"
f"unable to import module { self.path } due to { exception }"
)
except ModuleNotFoundError as exception:
# TODO: Remove this once all optional things are using Features
Expand Down Expand Up @@ -175,6 +185,7 @@ def pytest_collect_file(
# We don't allow pytests to be defined in Cython files.
# Normally, Cython files are filtered out already by pytest and we only
# hit this here if someone explicitly runs `pytest some_file.pyx`.
#return SageDoctestModule.from_parent(parent, path=file_path)
return IgnoreCollector.from_parent(parent)
elif file_path.suffix == ".py":
if parent.config.option.doctest:
Expand Down
21 changes: 20 additions & 1 deletion src/sage/algebras/fusion_rings/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,33 @@ extension_data_cpp = {
}

foreach name, pyx : extension_data_cpp
deps = [py_dep, cysignals, gmp, singular]
py.extension_module(
name,
sources: pyx,
subdir: 'sage/algebras/fusion_rings',
install: true,
override_options: ['cython_language=cpp'],
include_directories: [inc_cpython, inc_ntl, inc_numpy, inc_rings],
dependencies: [py_dep, cysignals, gmp, singular],
dependencies: deps,
)

all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'algebras/fusion_rings',
install: true,
copy: true,
)
endif
endforeach

21 changes: 20 additions & 1 deletion src/sage/algebras/letterplace/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,33 @@ extension_data_cpp = {
}

foreach name, pyx : extension_data_cpp
deps = [py_dep, gmp, singular]
py.extension_module(
name,
sources: pyx,
subdir: 'sage/algebras/letterplace',
install: true,
override_options: ['cython_language=cpp'],
include_directories: [inc_cpython, inc_rings],
dependencies: [py_dep, gmp, singular],
dependencies: deps,
)

all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'algebras/letterplace',
install: true,
copy: true,
)
endif
endforeach

21 changes: 20 additions & 1 deletion src/sage/algebras/quatalg/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,33 @@ extension_data_cpp = {
}

foreach name, pyx : extension_data_cpp
deps = [py_dep, flint, gmp, m, ntl]
py.extension_module(
name,
sources: pyx,
subdir: 'sage/algebras/quatalg',
install: true,
override_options: ['cython_language=cpp'],
include_directories: [inc_cpython, inc_ext, inc_flint, inc_ntl, inc_rings],
dependencies: [py_dep, flint, gmp, m, ntl],
dependencies: deps,
)

all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'algebras/quatalg',
install: true,
copy: true,
)
endif
endforeach

21 changes: 20 additions & 1 deletion src/sage/calculus/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,33 @@ extension_data = {
}

foreach name, pyx : extension_data
deps = [py_dep, cysignals, gmp, gsl, interpreters_dep]
py.extension_module(
name,
sources: pyx,
subdir: 'sage/calculus',
install: true,
include_directories: [inc_numpy],
dependencies: [py_dep, cysignals, gmp, gsl, interpreters_dep],
dependencies: deps,
)

all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'calculus',
install: true,
copy: true,
)
endif
endforeach

subdir('transforms')
21 changes: 20 additions & 1 deletion src/sage/calculus/transforms/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,32 @@ py.install_sources(
extension_data = {'dwt' : files('dwt.pyx'), 'fft' : files('fft.pyx')}

foreach name, pyx : extension_data
deps = [py_dep, cysignals, gmp, gsl]
py.extension_module(
name,
sources: pyx,
subdir: 'sage/calculus/transforms',
install: true,
include_directories: [inc_gsl],
dependencies: [py_dep, cysignals, gmp, gsl],
dependencies: deps,
)

all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'calculus/transforms',
install: true,
copy: true,
)
endif
endforeach

21 changes: 20 additions & 1 deletion src/sage/coding/codecan/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ extension_data = {
}

foreach name, pyx : extension_data
deps = [py_dep, cysignals, gap, gmp]
py.extension_module(
name,
sources: pyx,
Expand All @@ -22,7 +23,25 @@ foreach name, pyx : extension_data
inc_partn_ref2,
inc_rings,
],
dependencies: [py_dep, cysignals, gap, gmp],
dependencies: deps,
)

all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'coding/codecan',
install: true,
copy: true,
)
endif
endforeach

18 changes: 18 additions & 0 deletions src/sage/combinat/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ foreach name, pyx : extension_data
include_directories: [inc_cpython, inc_data_structures, inc_rings],
dependencies: deps,
)

all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'combinat',
install: true,
copy: true,
)
endif
endforeach

install_subdir('chas', install_dir: sage_install_dir / 'combinat')
Expand Down
21 changes: 20 additions & 1 deletion src/sage/combinat/posets/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,32 @@ extension_data = {
}

foreach name, pyx : extension_data
deps = [py_dep, cysignals, flint, gmp]
py.extension_module(
name,
sources: pyx,
subdir: 'sage/combinat/posets',
install: true,
include_directories: [inc_cpython, inc_ext, inc_flint, inc_rings],
dependencies: [py_dep, cysignals, flint, gmp],
dependencies: deps,
)

all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'combinat/posets',
install: true,
copy: true,
)
endif
endforeach

18 changes: 18 additions & 0 deletions src/sage/combinat/root_system/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,23 @@ foreach name, pyx : extension_data
include_directories: [inc_cpython, inc_rings],
dependencies: deps,
)

all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'combinat/root_system',
install: true,
copy: true,
)
endif
endforeach

24 changes: 20 additions & 4 deletions src/sage/data_structures/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extension_data = {
}

foreach name, pyx : extension_data
deps = [py_dep, cysignals, flint, gmp]
py.extension_module(
name,
sources: pyx,
Expand All @@ -38,13 +39,28 @@ foreach name, pyx : extension_data
inc_flint,
inc_rings,
],
dependencies: [py_dep, cysignals, flint, gmp],
dependencies: deps,
)
all_deps_found = true
foreach dep : deps
if not dep.found()
all_deps_found = false
break
endif
endforeach
if not all_deps_found
configure_file(
input: not_available,
output: name + '.py',
install_tag: 'python-runtime',
install_dir: sage_install_dir / 'data_structures',
install: true,
copy: true,
)
endif
endforeach

extension_data_cpp = {
'pairing_heap' : files('pairing_heap.pyx'),
}
extension_data_cpp = {'pairing_heap' : files('pairing_heap.pyx')}

foreach name, pyx : extension_data_cpp
py.extension_module(
Expand Down
Loading