From 76f8ce6222304c45a890e60ab75493ac6e839f19 Mon Sep 17 00:00:00 2001 From: Capocchi Date: Thu, 20 Mar 2025 16:36:36 +0100 Subject: [PATCH] update --- .github/workflows/ci-build-ubuntu.yml | 2 +- .github/workflows/publish-pypi.yml | 13 +++++++++++++ devsimpy/Utilities.py | 12 ++++++++++++ devsimpy/devsimpy-nogui.py | 7 ++++--- devsimpy/devsimpy.py | 16 ++++++++-------- pyproject.toml | 2 +- 6 files changed, 39 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-build-ubuntu.yml b/.github/workflows/ci-build-ubuntu.yml index a359af28..80a460e6 100644 --- a/.github/workflows/ci-build-ubuntu.yml +++ b/.github/workflows/ci-build-ubuntu.yml @@ -12,7 +12,7 @@ jobs: max-parallel: 1 # X Display is not supported on parallel jobs fail-fast: true # Stop all jobs if one fails matrix: - python-version: ['3.11'] + python-version: ['3.10','3.11','3.12','3.13'] defaults: run: shell: bash -l {0} diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 771e5f6c..f34bd305 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,3 +1,7 @@ +### action execute when the commands are executed: +### git tag v1.0.0 +### git push origin v1.0.0 + name: Publish to PyPI on: @@ -19,6 +23,15 @@ jobs: with: python-version: "3.11" + - name: Verify release tag + run: | + TAG_NAME="${{ github.ref_name }}" + if [[ ! "$TAG_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "❌ Le tag '$TAG_NAME' ne suit pas le format vX.Y.Z (ex: v1.0.0)." + exit 1 + fi + echo "✅ Le tag est valide : $TAG_NAME" + - name: Install build dependencies run: | python -m pip install --upgrade pip diff --git a/devsimpy/Utilities.py b/devsimpy/Utilities.py index 8d460690..4f9de295 100644 --- a/devsimpy/Utilities.py +++ b/devsimpy/Utilities.py @@ -111,8 +111,20 @@ def load_and_resize_image(filename, width=16, height=16): sys.stdout.write("Unknown operating system.\n") sys.exit() +import tomllib +from pathlib import Path + #------------------------------------------------------------------------------- +def get_version(): + """Récupère la version du package depuis pyproject.toml.""" + pyproject_path = Path(__file__).parent.parent / "pyproject.toml" + + with pyproject_path.open("rb") as f: + pyproject_data = tomllib.load(f) + return pyproject_data["project"]["version"] + + def getFilePathInfo(path): """ """ diff --git a/devsimpy/devsimpy-nogui.py b/devsimpy/devsimpy-nogui.py index df2e86d4..25cb7453 100644 --- a/devsimpy/devsimpy-nogui.py +++ b/devsimpy/devsimpy-nogui.py @@ -8,7 +8,7 @@ # Laurent CAPOCCHI # SPE - University of Corsica # -------------------------------- -# Version 5.0 last modified: 03/11/25 +# Version 5.1.0 last modified: 03/11/25 ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # # GENERAL NOTES AND REMARKS: @@ -30,8 +30,6 @@ # ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## -__version__ = '5.1' - def serialize_date(obj): if isinstance(obj, date): return obj.isoformat() @@ -50,6 +48,9 @@ def serialize_date(obj): from InteractionYAML import YAMLHandler from InteractionJSON import JSONHandler from StandaloneNoGUI import StandaloneNoGUI +from Utilities import get_version + +__version__ = get_version() ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # diff --git a/devsimpy/devsimpy.py b/devsimpy/devsimpy.py index 283f2201..42cf4109 100644 --- a/devsimpy/devsimpy.py +++ b/devsimpy/devsimpy.py @@ -9,7 +9,7 @@ # L. CAPOCCHI (capocchi@univ-corse.fr) # SPE Lab - SISU Group - University of Corsica # -------------------------------- -# Version 4.0 last modified: 03/11/25 +# Version 5.1.0 last modified: 03/11/25 ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # # GENERAL NOTES AND REMARKS: @@ -56,12 +56,6 @@ if sys.version_info[0] < 3: raise Exception("Must be using Python 3") -__authors__ = "Laurent Capocchi , " -__date__ = str(datetime.datetime.now()) -__version__ = '5.1' -__docformat__ = 'epytext' -__min_wx_version__ = '4.0' - ################################################################ ### Loading wx python library ################################################################ @@ -142,7 +136,7 @@ from Reporter import ExceptionHook from PreferencesGUI import PreferencesGUI from PluginManager import PluginManager -from Utilities import GetUserConfigDir, install, install_and_import, updatePiPPackages, load_and_resize_image, updateFromGitRepo, updateFromGitArchive, NotificationMessage, getTopLevelWindow +from Utilities import GetUserConfigDir, install, install_and_import, updatePiPPackages, load_and_resize_image, updateFromGitRepo, updateFromGitArchive, NotificationMessage, getTopLevelWindow, get_version from Decorators import redirectStdout, BuzyCursorNotification, ProgressNotification, cond_decorator from DetachedFrame import DetachedFrame from LibraryTree import LibraryTree @@ -156,6 +150,12 @@ from XMLModule import getDiagramFromXMLSES from StandaloneGUI import StandaloneGUI +__authors__ = "Laurent Capocchi , " +__date__ = str(datetime.datetime.now()) +__version__ = get_version() +__docformat__ = 'epytext' +__min_wx_version__ = '4.0' + ### http://comments.gmane.org/gmane.comp.python.wxpython/98744 wx.Log.SetLogLevel(0) diff --git a/pyproject.toml b/pyproject.toml index 9fb988b7..13131909 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ devsimpy = "devsimpy.devsimpy:main" [project] name = "devsimpy" -version = "5.0.4" +version = "5.1.0" dependencies = [ "wxpython>=4.2.2", "psutil",