From 315b4fade7d5b4123fba24b59c30ccb0574d96f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Thu, 21 May 2026 17:18:12 +0200 Subject: [PATCH 1/7] add tests to setup.py --- .github/workflows/build_tests.yml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index e964aaff2..f81e53d0e 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -77,7 +77,7 @@ jobs: cache: 'pip' - name: Install POT run: | - pip install -e . + pip install . - name: Install dependencies run: | python -m pip install --upgrade pip setuptools diff --git a/setup.py b/setup.py index 0452fcf25..a2324a41d 100644 --- a/setup.py +++ b/setup.py @@ -116,6 +116,7 @@ "networkx", "memory_profiler", ], + "tests": ["pytest", "pytest-cov"], "all": [ "jax", "jaxlib", From 1435ae66dcb754af9bb25dda6e994f8630ba7447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 22 May 2026 15:47:48 +0200 Subject: [PATCH 2/7] try something --- .github/workflows/build_tests.yml | 15 +++++++++------ RELEASES.md | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index f81e53d0e..0531e20cb 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -75,14 +75,17 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'pip' - - name: Install POT + - name: Install POT and dependencies run: | - pip install . - - name: Install dependencies + pip install -e .[all,tests] + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip setuptools + # pip install -r requirements_all.txt + # pip install pytest pytest-cov + - name: test POT import run: | - python -m pip install --upgrade pip setuptools - pip install -r requirements_all.txt - pip install pytest pytest-cov + python -c "import ot; print(ot.__version__)" - name: Run tests run: | python -m pytest --durations=20 -v test/ ot/ --doctest-modules --color=yes --cov=./ --cov-report=xml diff --git a/RELEASES.md b/RELEASES.md index 0f8918cac..d187eec78 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -29,7 +29,7 @@ This new release adds support for sparse cost matrices and a new lazy EMD solver - Fix test of the version of jax in `ot.backend` (PR #794) - Reverting the openmp fix on macOS (PR #789) for macOS (PR #797) - Align documentation build dependencies and doc extras (PR #801) - +- Debug Debug linux test core dump (PR #815) ## 0.9.6.post1 From f9e2ca995e59bf47bd3e63b6c2571cf4951be33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 22 May 2026 16:24:15 +0200 Subject: [PATCH 3/7] test without pytorch geometric --- requirements_all.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_all.txt b/requirements_all.txt index a015855f6..a4ef9fa05 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -10,7 +10,7 @@ jax jaxlib tensorflow pytest -torch_geometric +# torch_geometric cvxpy geomloss pykeops From 36d59c74f60846aa5a250f4951fbfa6ca764a366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 22 May 2026 16:34:58 +0200 Subject: [PATCH 4/7] test without torch_geometric --- .github/workflows/build_tests.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 0531e20cb..b46dab81b 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -75,14 +75,14 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'pip' - - name: Install POT and dependencies + - name: Install POT + run: | + pip install -e . + - name: Install dependencies run: | - pip install -e .[all,tests] - # - name: Install dependencies - # run: | - # python -m pip install --upgrade pip setuptools - # pip install -r requirements_all.txt - # pip install pytest pytest-cov + python -m pip install --upgrade pip setuptools + pip install -r requirements_all.txt + pip install pytest pytest-cov - name: test POT import run: | python -c "import ot; print(ot.__version__)" From c12291e876fbdb7eea07f0d87db09a6ba10a3dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 22 May 2026 17:16:28 +0200 Subject: [PATCH 5/7] fix tests without torch_geometric --- ot/gnn/__init__.py | 2 +- ot/gnn/_utils.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ot/gnn/__init__.py b/ot/gnn/__init__.py index 5f3a93fed..9567f1ecc 100644 --- a/ot/gnn/__init__.py +++ b/ot/gnn/__init__.py @@ -17,9 +17,9 @@ # All submodules and packages from ._utils import FGW_distance_to_templates, wasserstein_distance_to_templates - from ._layers import TFGWPooling, TWPooling + __all__ = [ "FGW_distance_to_templates", "wasserstein_distance_to_templates", diff --git a/ot/gnn/_utils.py b/ot/gnn/_utils.py index 16487c210..dc1342bf6 100644 --- a/ot/gnn/_utils.py +++ b/ot/gnn/_utils.py @@ -12,7 +12,15 @@ from ..utils import dist from ..gromov import fused_gromov_wasserstein2 from ..lp import emd2 -from torch_geometric.utils import subgraph +import warnings + +try: + from torch_geometric.utils import subgraph +except ImportError: + warnings.warn( + "torch_geometric is not installed. The ot.gnn module requires torch_geometric to be installed." + ) + pass def TFGW_template_initialization( From 7f1f997f6a8d8c9ac449ae76b38c12c240f73392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 22 May 2026 17:49:58 +0200 Subject: [PATCH 6/7] fix older torch --- requirements_all.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_all.txt b/requirements_all.txt index a4ef9fa05..b7e14e106 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -5,7 +5,7 @@ autograd pymanopt @ git+https://github.com/pymanopt/pymanopt.git@master cvxopt scikit-learn -torch +torch<=2.11 jax jaxlib tensorflow From 7f7b8642c8846430e50cc42c82873958faf7a31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 22 May 2026 17:50:22 +0200 Subject: [PATCH 7/7] also add bac torch geomeric --- requirements_all.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_all.txt b/requirements_all.txt index b7e14e106..890d6ceb4 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -10,7 +10,7 @@ jax jaxlib tensorflow pytest -# torch_geometric +torch_geometric cvxpy geomloss pykeops