Repository: eoyilmaz/displaycal-py3 (language: python)

Issue:
Build error: RuntimeError: Need Python version >= 3.8 <= 3.11, got 3.12.2
Excuse my little understanding on how to fix this problem. Perhaps others are having the same issue.

I've tried to force reinstall/rollback to python 3.10

brew install glib gtk+3 python@3.10

But I'm having this come up when I do the make launch:

source ./.venv/bin/activate; \
	displaycal
Traceback (most recent call last):
  File "/Users/mzdial/Downloads/displaycal-py3/.venv/bin/displaycal", line 4, in <module>
    from DisplayCAL.main import main
  File "/Users/mzdial/Downloads/displaycal-py3/.venv/lib/python3.12/site-packages/DisplayCAL/main.py", line 27, in <module>
    raise RuntimeError(
**RuntimeError: Need Python version >= 3.8 <= 3.11, got 3.12.2**
make: *** [launch] Error 1

How can I modify to make this work? Appreciate any help!


Discussion / hints:
[This guide helped me out a while back.](https://www.cyishere.dev/blog/fix-python-break)

You just need to update your `python3` path to specify the other version. You can have multiple versions installed in `brew`.

Specifically, in step 3, set the python version number in the path to the one you want to be the working default:
`export PATH="/usr/local/opt/python@3.10/libexec/bin:$PATH"`
On the otherhand we should start testing DisplayCAL with Python 3.12 too.
Thanks for the link! I was able to understand things a bit better. I ended up uninstalling 3.12 and rolling back to 3.10. I can get it to run now.

@eoyilmaz, Am I not understanding that this does not build a GUI MacOS executable? I found the command line binary in here: /displaycal-py3/.venv/bin/displaycal

Sorry for my lack of understanding. Not a python programmer!

> [This guide helped me out a while back.](https://www.cyishere.dev/blog/fix-python-break)
> 
> You just need to update your `python3` path to specify the other version. You can have multiple versions installed in `brew`.
> 
> Specifically, in step 3, set the python version number in the path to the one you want to be the working default: `export PATH="/usr/local/opt/python@3.10/libexec/bin:$PATH"`


I changed the max verion in the meta.py to:
`py_maxversion = (3, 12)`
and it compiles and runs fine :)

> I changed the max verion in the meta.py to:
> `py_maxversion = (3, 12)`
> and it compiles and runs fine :)

Yeah I'm currently testing DisplayCAL with Python 3.12 and it seems to be working fine. I'll release a new version soon that supports Python 3.12.

Fix patch:
diff --git a/DisplayCAL/meta.py b/DisplayCAL/meta.py
index 30797cdf..fa52e733 100644
--- a/DisplayCAL/meta.py
+++ b/DisplayCAL/meta.py
@@ -62,7 +62,7 @@
 name_html = '<span class="appname">Display<span>CAL</span></span>'
 
 py_minversion = (3, 8)
-py_maxversion = (3, 11)
+py_maxversion = (3, 12)
 
 version = VERSION_STRING
 version_lin = VERSION_STRING  # Linux


Test patch:
diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml
index 02666a76..c9236a93 100644
--- a/.github/workflows/pytest.yml
+++ b/.github/workflows/pytest.yml
@@ -20,12 +20,15 @@ jobs:
           - "3.9"
           - "3.10"
           - "3.11"
+          - "3.12"
         wx-version:
           - "4.1.1"
           - "4.2.1"
         exclude:
           - python-version: "3.11"
             wx-version: "4.1.1"
+          - python-version: "3.12"
+            wx-version: "4.1.1"
 
     steps: