Skip to content

Commit

Permalink
simplifies platform/CPU gathering mechanis on acOS to avoid crashes u…
Browse files Browse the repository at this point in the history
…nder macOS 14
  • Loading branch information
MAKOMO committed Oct 5, 2023
1 parent 25a8d98 commit ff7fa77
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 201 deletions.
3 changes: 0 additions & 3 deletions .ci/install-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@ if [ -n "${PYUPGRADE_V:-}" ]; then
source ${VIRTUAL_ENV}/bin/activate
deactivate
# brew update Python
# export HOMEBREW_NO_INSTALL_CLEANUP=TRUE # no cleanup here, not to delete libs needed by curl!
brew update && brew upgrade python # no "brew cleanup" here, not to delete libs needed by curl!
# relink Python
brew unlink python@${PYTHON_V} && brew link --force --overwrite python@${PYTHON_V}
hash -r
brew install jq
# add path
export PATHT="$(brew --prefix)/Cellar/python@${PYTHON_V}/${PYUPGRADE_V}/bin:${PATH}"
echo $PATHT
export PATH="$(brew --cellar python@${PYTHON_V})/$(brew info --json python@${PYTHON_V} | jq -r '.[0].installed[0].version')/bin:${PATH}"
echo $PATH
which python3
Expand Down
4 changes: 2 additions & 2 deletions src/artisan.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
pass

from artisanlib import main, command_utility
#from multiprocessing import freeze_support # no longer needed after Hottop/WebLCDs have been reimplemented
#from multiprocessing import freeze_support

# from pyinstaller 5.8:
class NullWriter:
Expand Down Expand Up @@ -121,7 +121,7 @@ def isatty(self):

# Manage commands that does not need to start the whole application
if command_utility.handleCommands():
# freeze_support() # no longer needed after Hottop/WebLCDs have been reimplemented
# freeze_support() # needed for multiprocessing; was used by Hottop/WebLCDs module, as well as for py-cpuinfo!
main.main()


Expand Down
2 changes: 1 addition & 1 deletion src/artisanlib/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class tgraphcanvas(FigureCanvas):
'dropSpikes', 'dropDuplicates', 'dropDuplicatesLimit', 'liveMedianRoRfilter', 'liveMedianETfilter', 'liveMedianBTfilter', 'interpolatemax', 'swapETBT', 'wheelflag', 'wheelnames', 'segmentlengths', 'segmentsalpha',
'wheellabelparent', 'wheelcolor', 'wradii', 'startangle', 'projection', 'wheeltextsize', 'wheelcolorpattern', 'wheeledge',
'wheellinewidth', 'wheellinecolor', 'wheeltextcolor', 'wheelconnections', 'wheelx', 'wheelz', 'wheellocationx', 'wheellocationz',
'wheelaspect', 'samplingSemaphore', 'profileDataSemaphore', 'messagesemaphore', 'errorsemaphore', 'serialsemaphore', 'seriallogsemaphore',
'wheelaspect', 'samplingSemaphore', 'updateGraphicsSemaphore', 'profileDataSemaphore', 'messagesemaphore', 'errorsemaphore', 'serialsemaphore', 'seriallogsemaphore',
'eventactionsemaphore', 'updateBackgroundSemaphore', 'alarmSemaphore', 'rampSoakSemaphore', 'crossmarker', 'crossmouseid', 'onreleaseid',
'analyzer_connect_id', 'extra309T3', 'extra309T4', 'extra309TX', 'hottop_ET', 'hottop_BT', 'hottop_HEATER', 'hottop_MAIN_FAN', 'hottop_TX',
'R1_DT', 'R1_BT', 'R1_BT_ROR', 'R1_EXIT_TEMP', 'R1_HEATER', 'R1_FAN', 'R1_DRUM', 'R1_VOLTAGE', 'R1_TX', 'R1_STATE', 'R1_FAN_RPM', 'R1_STATE_STR',
Expand Down
314 changes: 131 additions & 183 deletions src/artisanlib/main.py

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,15 @@ check_untyped_defs = true
plugins = ["numpy.typing.mypy_plugin"]

[[tool.mypy.overrides]]
module = "matplotlib.*"
module = ["matplotlib.*", "aiohttp.*", "aiohttp.web.*", "aiohttp_jinja2.*"]
ignore_missing_imports = true


[[tool.mypy.overrides]]
module = "uic.*"
follow_imports = 'skip'


## ruff conf

[tool.ruff]
Expand All @@ -240,7 +242,7 @@ follow_imports = 'skip'
## next: flake8-use-pathlib (PTH), flake8-print (T20)
select = ["E", "F", "UP", "B", "A", "YTT", "COM", "C4", "DTZ", "PIE", "RSE", "RET", "SIM", "ARG", "PLE", "PLR", "PLW", "INT"]

format = "pylint" # one of: text, json, junit, grouped, github, gitlab, pylint, azure
output-format = "pylint" # one of: text, json, junit, grouped, github, gitlab, pylint, azure

# Same as Black.
line-length = 80
Expand Down
8 changes: 4 additions & 4 deletions src/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
types-openpyxl==3.1.0.20
types-openpyxl==3.1.0.22
types-protobuf==4.24.0.2
types-psutil==5.9.5.16
types-pyserial==3.5.0.10
types-python-dateutil==2.8.19.14
types-PyYAML==6.0.12.12
types-requests==2.31.0.6
types-requests==2.31.0.7
types-setuptools==68.2.0.0
types-urllib3==1.26.25.14
mypy==1.5.1
pyright==1.1.327
ruff>=0.0.285
pylint==2.17.6
pylint==3.0.0
pre-commit>=3.3.3
pytest==7.4.2
pytest-cov==4.1.0
Expand All @@ -22,5 +22,5 @@ pytest-qt==4.2.0
#pytest-benchmark==4.0.0
#pytest-mock==3.11.1
hypothesis==6.87.0
coverage==7.3.1
coverage==7.3.2
coverage-badge==1.1.0
12 changes: 6 additions & 6 deletions src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
######
# the following commented package versions are read by appveyor.yml and downloaded outside of pip.
#
# pyinstaller==5.13.2; platform_system='Windows'
# pyinstaller==6.0.0; platform_system='Windows'
# libusb==1.2.7.3; platform_system='Windows' #1.2.6.0
# libusb==1.0.26; platform_system='Linux'
#
Expand All @@ -32,7 +32,7 @@ wheel==0.41.2
pyserial==3.5
pymodbus==3.5.2
python-snap7==1.3
Phidget22==1.17.20230824
Phidget22==1.17.20231004
Unidecode==1.3.6
#bottle==0.12.25 # not used any longer after reimplementation of WebLCDs
qrcode==7.4.2
Expand All @@ -47,7 +47,7 @@ websockets==11.0.3
PyYAML==6.0.1
psutil==5.9.4
typing-extensions==4.8.0; python_version < '3.8' # required for supporting Final and TypeDict on Python <3.8
protobuf==4.24.3
protobuf==4.24.4
numpy==1.24.3; python_version < '3.9' # last Python 3.8 release
numpy==1.26.0; python_version >= '3.9'
scipy==1.10.1; python_version < '3.9' # last Python 3.8 release
Expand Down Expand Up @@ -88,7 +88,7 @@ PyQtWebEngine==5.15.6; (sys_platform=='darwin' and platform_release<'20.0') or (
PyQt6==6.5.2; (sys_platform=='darwin' and platform_release>='20.0') or (platform_system=='Windows' and python_version>'3.10') or platform_system=='Linux'
PyQt6-WebEngine==6.5.0; (sys_platform=='darwin' and platform_release>='20.0') or (platform_system=='Windows' and python_version>'3.10') or platform_system=='Linux'
###
pyinstaller==5.13.2; platform_system=='Linux' # on Windows pyinstaller is separately installed (see above)
pyinstaller==6.0.0; platform_system=='Linux' # on Windows pyinstaller is separately installed (see above)
###
### Qt build tools not part of PyQt but required by build-derived
qt5-tools==5.15.2.1.3; (sys_platform=='darwin' and platform_release<'20.0') or (platform_system=='Windows' and python_version<'3.9')
Expand All @@ -101,7 +101,7 @@ appnope==0.1.3; sys_platform=='darwin'
pyobjc-core==10.0; sys_platform=='darwin'
pyobjc-framework-Cocoa==10.0; sys_platform=='darwin'
py2app==0.28.6; sys_platform=='darwin'
py-cpuinfo==9.0.0; sys_platform=='darwin' # used for proper CPU arch detection running under Rosetta2
#py-cpuinfo==9.0.0; sys_platform=='darwin' # used for proper CPU arch detection running under Rosetta2
darkdetect==0.8.0; sys_platform=='darwin' and platform_release<'20.0' # detect if dark mode is active (only used by macOS legacy builds)
###
########
Expand All @@ -116,6 +116,6 @@ SecretStorage==3.3.3; platform_system=='Linux'
########
### Windows specific packages
###
build==0.10.0; platform_system=='Windows' # required to build pyinstaller bootloader
build==1.0.3; platform_system=='Windows' # required to build pyinstaller bootloader
pywin32==306; platform_system=='Windows'
pyinstaller-versionfile==2.1.1; platform_system=='Windows'

0 comments on commit ff7fa77

Please sign in to comment.