Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hooks: improve scipy hooks #1896

Merged
merged 1 commit into from
Jun 5, 2023
Merged
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
23 changes: 20 additions & 3 deletions cx_Freeze/hooks/scipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
scipy package is included.
"""


from __future__ import annotations

from .._compat import IS_MINGW, IS_WINDOWS
Expand All @@ -23,8 +22,14 @@ def load_scipy(finder: ModuleFinder, module: Module) -> None:
finder.include_package("scipy._lib")
finder.include_package("scipy.misc")
finder.include_package("scipy.optimize")
if IS_WINDOWS or IS_MINGW:
finder.exclude_module("scipy.spatial.cKDTree")


def load_scipy_interpolate(
finder: ModuleFinder, module: Module # noqa: ARG001
) -> None:
"""The scipy.interpolate must be loaded as a package."""
finder.exclude_module("scipy.interpolate.tests")
finder.include_package("scipy.interpolate")


def load_scipy_linalg(finder: ModuleFinder, module: Module) -> None:
Expand Down Expand Up @@ -67,6 +72,16 @@ def load_scipy_sparse_linalg_dsolve_linsolve(
module.ignore_names.add("scikits.umfpack")


def load_scipy_spatial(
finder: ModuleFinder, module: Module # noqa: ARG001
) -> None:
"""The scipy.spatial must be loaded as a package."""
finder.include_package("scipy.spatial")
finder.exclude_module("scipy.spatial.tests")
if IS_WINDOWS or IS_MINGW:
finder.exclude_module("scipy.spatial.cKDTree")


def load_scipy_spatial_transform(
finder: ModuleFinder, module: Module # noqa: ARG001
) -> None:
Expand All @@ -79,7 +94,9 @@ def load_scipy_special(
finder: ModuleFinder, module: Module # noqa: ARG001
) -> None:
"""The scipy.special must be loaded as a package."""
finder.exclude_module("scipy.special.tests")
finder.include_package("scipy.special")
finder.include_package("scipy.special._precompute")


def load_scipy_special__cephes(
Expand Down