From 15525b13d4c7a56f378a817f4b3dbd30620e434b Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 2 Feb 2025 03:45:27 +0200 Subject: [PATCH] - modified the makefile file (contribution from @Paul Munsch on bitbucket) - fixed an error from using the latest numpy version regarding missing Inf attribute (now it is inf, lower case) --- CHANGELOG.md | 5 +++++ Makefile | 12 ++++++++---- appHandlers/appIO.py | 5 ++++- appMain.py | 5 ++++- appObjects/ObjectCollection.py | 5 ++++- appPlugins/ToolCutOut.py | 5 ++++- appPlugins/ToolDblSided.py | 5 ++++- appPlugins/ToolPaint.py | 5 ++++- 8 files changed, 37 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9f73663..b2aee7fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ CHANGELOG for FlatCAM Evo beta ================================================= +02.02.2025 + +- modified the makefile file (contribution from @Paul Munsch on bitbucket) +- fixed an error from using the latest numpy version regarding missing Inf attribute (now it is inf, lower case) + 19.06.2024 - fixed Issues #49. Path mismatch for SVG icons -> missing checkboxes fixed as suggested by Stefan Bruens, by adapting the paths in the stylesheets files (dark and light) diff --git a/Makefile b/Makefile index a4b692de..51bd3beb 100644 --- a/Makefile +++ b/Makefile @@ -14,11 +14,15 @@ ASSEST_PATH = assets/linux INSTALL_PATH = /usr/share/flatcam-beta APPS_PATH = /usr/share/applications -MIN_PY3_MINOR_VERSION := 6 -PY3_MINOR_VERSION := $(shell python3 --version | cut -d'.' -f2) +MIN_PY3_MINOR_VERSION := 8 +# required version +MIN_PY3_MINOR_VERSION := $(shell python3 -c 'import sys; print($(MIN_PY3_MINOR_VERSION))') -ifneq ($(MIN_PY3_MINOR_VERSION), $(firstword $(sort $(PY3_MINOR_VERSION) $(MIN_PY3_MINOR_VERSION)))) - $(info Current python version is 3.$(PY3_MINOR_VERSION)) +# current version minimized to required (to allow ifneq test) +PY3_MIN_MINOR_VERSION := $(shell python3 -c 'import sys; print(min($(MIN_PY3_MINOR_VERSION),sys.version_info.minor))') + +ifneq ($(MIN_PY3_MINOR_VERSION), $(PY3_MIN_MINOR_VERSION)) + $(info Current python version is 3.$(PY3_MIN_MINOR_VERSION)) $(error You must have at least 3.$(MIN_PY3_MINOR_VERSION) installed) endif diff --git a/appHandlers/appIO.py b/appHandlers/appIO.py index adf4d6aa..ebb807bd 100644 --- a/appHandlers/appIO.py +++ b/appHandlers/appIO.py @@ -26,7 +26,10 @@ from copy import deepcopy import re import numpy as np -from numpy import Inf +try: + from numpy import Inf +except ImportError: + from numpy import inf as Inf from datetime import datetime import simplejson as json diff --git a/appMain.py b/appMain.py index 47880ffb..b2bbc2f6 100644 --- a/appMain.py +++ b/appMain.py @@ -114,7 +114,10 @@ from appWorkerStack import WorkerStack # App Plugins from appPlugins import * -from numpy import Inf +try: + from numpy import Inf +except ImportError: + from numpy import inf as Inf # App Translation import gettext diff --git a/appObjects/ObjectCollection.py b/appObjects/ObjectCollection.py index 28066f4f..43f97e2b 100644 --- a/appObjects/ObjectCollection.py +++ b/appObjects/ObjectCollection.py @@ -29,7 +29,10 @@ import inspect # TODO: Remove import re import logging from copy import deepcopy -from numpy import Inf +try: + from numpy import Inf +except ImportError: + from numpy import inf as Inf import gettext import appTranslation as fcTranslate diff --git a/appPlugins/ToolCutOut.py b/appPlugins/ToolCutOut.py index 7c37041a..43819095 100644 --- a/appPlugins/ToolCutOut.py +++ b/appPlugins/ToolCutOut.py @@ -16,7 +16,10 @@ import logging from copy import deepcopy import simplejson as json import sys -from numpy import Inf +try: + from numpy import Inf +except ImportError: + from numpy import inf as Inf from shapely import Polygon, MultiPolygon, box, Point, LineString, MultiLineString, LinearRing from shapely.ops import unary_union, linemerge diff --git a/appPlugins/ToolDblSided.py b/appPlugins/ToolDblSided.py index 65db329a..05986331 100644 --- a/appPlugins/ToolDblSided.py +++ b/appPlugins/ToolDblSided.py @@ -6,7 +6,10 @@ from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, G import logging from copy import deepcopy -from numpy import Inf +try: + from numpy import Inf +except ImportError: + from numpy import inf as Inf from shapely import Point from shapely.affinity import scale diff --git a/appPlugins/ToolPaint.py b/appPlugins/ToolPaint.py index 6efe069a..2784f477 100644 --- a/appPlugins/ToolPaint.py +++ b/appPlugins/ToolPaint.py @@ -20,7 +20,10 @@ import numpy as np import simplejson as json import sys import traceback -from numpy import Inf +try: + from numpy import Inf +except ImportError: + from numpy import inf as Inf from shapely import LineString, Polygon, MultiLineString, MultiPolygon, Point, LinearRing from shapely.geometry import base