From e9ecb378ddbfa21b0a0d04d69fa971dfab9da662 Mon Sep 17 00:00:00 2001 From: Didier Vezinet Date: Tue, 3 Dec 2024 08:41:26 -0500 Subject: [PATCH 1/6] [#951] Pinned setuptools to >=40.8.0 and <65.* in setp.py, requirements.txt and pyproject.toml --- pyproject.toml | 2 +- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1b3abd013..7efdefef8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=40.8.0", + "setuptools>=40.8.0, <65.*", "wheel", "Cython>=0.26", "numpy", diff --git a/requirements.txt b/requirements.txt index 8e71ee444..91da8cf49 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ scipy numpy # scikit-sparse # does not work on windows, and requires "apt/brew install libsuitesparse-dev/suite-sparse" on linux / MacOs # scikit-umfpack # similar issue -setuptools!=65.*,!=74.* +setuptools>=40.8.0, <65.* matplotlib contourpy requests diff --git a/setup.py b/setup.py index ad473b495..f502da4e4 100644 --- a/setup.py +++ b/setup.py @@ -314,7 +314,7 @@ def get_version_tofu(path=_HERE): # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=[ - "setuptools!=65.*,!=74.*", + "setuptools>=40.8.0, <65.*", "numpy", "scipy", # "scikit-sparse", From 1299e4558e547fd56fe0432afed48808c086cd30 Mon Sep 17 00:00:00 2001 From: Didier Vezinet Date: Tue, 3 Dec 2024 08:45:42 -0500 Subject: [PATCH 2/6] [#951] Syntax correction --- pyproject.toml | 2 +- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7efdefef8..21a586413 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=40.8.0, <65.*", + "setuptools>=40.8.0, <65", "wheel", "Cython>=0.26", "numpy", diff --git a/requirements.txt b/requirements.txt index 91da8cf49..0b34b7b4e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ scipy numpy # scikit-sparse # does not work on windows, and requires "apt/brew install libsuitesparse-dev/suite-sparse" on linux / MacOs # scikit-umfpack # similar issue -setuptools>=40.8.0, <65.* +setuptools>=40.8.0, <65 matplotlib contourpy requests diff --git a/setup.py b/setup.py index f502da4e4..315cf7f70 100644 --- a/setup.py +++ b/setup.py @@ -314,7 +314,7 @@ def get_version_tofu(path=_HERE): # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=[ - "setuptools>=40.8.0, <65.*", + "setuptools>=40.8.0, <65", "numpy", "scipy", # "scikit-sparse", From 25eb1e982a4b3419974f0e880813c84a80baee1b Mon Sep 17 00:00:00 2001 From: Didier Vezinet Date: Tue, 3 Dec 2024 09:02:28 -0500 Subject: [PATCH 3/6] [#951] Trying to fix circular import 0 --- tofu/tests/tests00_root/test_03_plot.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tofu/tests/tests00_root/test_03_plot.py b/tofu/tests/tests00_root/test_03_plot.py index 9b7714c90..eea664f1d 100644 --- a/tofu/tests/tests00_root/test_03_plot.py +++ b/tofu/tests/tests00_root/test_03_plot.py @@ -8,12 +8,6 @@ import os import numpy as np import matplotlib.pyplot as plt -import warnings as warn - - -# Importing package tofu.geom -import tofu as tf -from tofu import __version__ _here = os.path.abspath(os.path.dirname(__file__)) @@ -29,6 +23,7 @@ ####################################################### def setup_module(module): + from tofu import __version__ print("") # this is to get a newline after the dots lf = os.listdir(_here) lf = [f for f in lf @@ -53,6 +48,7 @@ def setup_module(module): #print("setup_module before anything in this file") def teardown_module(module): + from tofu import __version__ #os.remove(VesTor.Id.SavePath + VesTor.Id.SaveName + '.npz') #os.remove(VesLin.Id.SavePath + VesLin.Id.SaveName + '.npz') #print("teardown_module after everything in this file") @@ -95,6 +91,7 @@ def setup_class(cls): #print("---- "+cls.__name__) # conf + import tofu as tf cls.conf = tf.geom.utils.create_config('B3') # time vectors @@ -139,17 +136,18 @@ def teardown_method(self): def test01_plot_shotoverview(self): # One by one, without conf + import tofu as tf for shot, dextra in self.dobj.items(): - kh = tf._plot.plot_shotoverview({shot:dextra}) + _ = tf._plot.plot_shotoverview({shot:dextra}) # All together, without conf - kh = tf._plot.plot_shotoverview(self.dobj) + _ = tf._plot.plot_shotoverview(self.dobj) plt.close('all') # One by one, with conf for shot, dextra in self.dobj.items(): - kh = tf._plot.plot_shotoverview({shot:dextra}, config=self.conf) + _ = tf._plot.plot_shotoverview({shot:dextra}, config=self.conf) # All together, with conf - kh = tf._plot.plot_shotoverview(self.dobj, config=self.conf) - plt.close('all') + _ = tf._plot.plot_shotoverview(self.dobj, config=self.conf) + plt.close('all') \ No newline at end of file From 02b689933b44e9f048f02621aa2a32a7adb71938 Mon Sep 17 00:00:00 2001 From: Didier Vezinet Date: Tue, 3 Dec 2024 09:10:42 -0500 Subject: [PATCH 4/6] [#951] Trying to fix circular import 1 --- tofu/geom/_core.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index e8602396e..321754545 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -32,12 +32,15 @@ import tofu.geom._comp as _comp import tofu.geom._comp_solidangles as _comp_solidangles import tofu.geom._plot as _plot -except Exception: - from . import _def as _def - from . import _GG as _GG - from . import _comp as _comp - from . import _comp_solidangles - from . import _plot as _plot +except Exception as err0: + try: + from . import _def as _def + from . import _GG as _GG + from . import _comp as _comp + from . import _comp_solidangles + from . import _plot as _plot + except Exception as err1: + raise err1 from err0 __all__ = [ From f021c3f4e0b88b1b615b54212916996d1617326b Mon Sep 17 00:00:00 2001 From: Didier Vezinet Date: Tue, 3 Dec 2024 09:17:30 -0500 Subject: [PATCH 5/6] [#951] Trying to fix circular import 2 --- .github/workflows/test-complete-matrix.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-complete-matrix.yml b/.github/workflows/test-complete-matrix.yml index 51d741d74..dc95ce28c 100644 --- a/.github/workflows/test-complete-matrix.yml +++ b/.github/workflows/test-complete-matrix.yml @@ -42,6 +42,7 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: install tofu run: | + python -c "import setuptools; print(f'\nsetuptools version = {setuptools.__version__}\n')" pip install -e ".[dev]" --no-build-isolation - name: Test with pytest and coverage run: | From d3bb3fb86189d4fd4a106d051212a71281dd3dbb Mon Sep 17 00:00:00 2001 From: Didier Vezinet Date: Tue, 3 Dec 2024 11:47:28 -0500 Subject: [PATCH 6/6] [#951] Trying to fix circular import 3, setuptools<64 --- pyproject.toml | 2 +- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 21a586413..15b9ed22f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=40.8.0, <65", + "setuptools>=40.8.0, <64", "wheel", "Cython>=0.26", "numpy", diff --git a/requirements.txt b/requirements.txt index 0b34b7b4e..c379f233c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ scipy numpy # scikit-sparse # does not work on windows, and requires "apt/brew install libsuitesparse-dev/suite-sparse" on linux / MacOs # scikit-umfpack # similar issue -setuptools>=40.8.0, <65 +setuptools>=40.8.0, <64 matplotlib contourpy requests diff --git a/setup.py b/setup.py index 315cf7f70..0a4e3e572 100644 --- a/setup.py +++ b/setup.py @@ -314,7 +314,7 @@ def get_version_tofu(path=_HERE): # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=[ - "setuptools>=40.8.0, <65", + "setuptools>=40.8.0, <64", "numpy", "scipy", # "scikit-sparse",