Skip to content

Commit

Permalink
Merge pull request #996 from ToFuProject/Issue951_DistutilsMsvCompiler
Browse files Browse the repository at this point in the history
Pinned `setuptools` version to `>=40.8.0, <64`
  • Loading branch information
Didou09 authored Dec 3, 2024
2 parents 2c613f2 + d3bb3fb commit 1e8477c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-complete-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools>=40.8.0",
"setuptools>=40.8.0, <64",
"wheel",
"Cython>=0.26",
"numpy",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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, <64
matplotlib
contourpy
requests
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, <64",
"numpy",
"scipy",
# "scikit-sparse",
Expand Down
15 changes: 9 additions & 6 deletions tofu/geom/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = [
Expand Down
20 changes: 9 additions & 11 deletions tofu/tests/tests00_root/test_03_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))
Expand All @@ -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
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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')

0 comments on commit 1e8477c

Please sign in to comment.