Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py 3.9 compatibility #16169

Merged
merged 2 commits into from
Jul 8, 2024
Merged

Py 3.9 compatibility #16169

merged 2 commits into from
Jul 8, 2024

Conversation

w-e-w
Copy link
Collaborator

@w-e-w w-e-w commented Jul 8, 2024

Description

since we are trying to keey compatibility with python 3.9 some changes need to be made

match case syntax in xyz.find_vae()

from __future__ import annotations for extensions-builtin/Lora/networks.py

def process_network_files(names: list[str] | None = None):


this person was using python 3.9


push to RC

Checklist:

@w-e-w w-e-w requested a review from AUTOMATIC1111 as a code owner July 8, 2024 05:24
@AUTOMATIC1111 AUTOMATIC1111 merged commit bad47dc into dev Jul 8, 2024
18 checks passed
AUTOMATIC1111 added a commit that referenced this pull request Jul 8, 2024
@markg85
Copy link

markg85 commented Jul 8, 2024

Is there some build server CI/CD magic to enforce this?
I've had version issues before and those are not always easy to find out. In this case the syntax error made it easy to discover as a python feature that was newer then the python i had.

What also doesn't help is the mention spread on this site in various install documents (ex. here and here) that 3.10.6 is the minimal python requirement. I'd say that either all those docs would have to reflect the actual minimal requirement (3.9.something) or that 3.10.6 should in fact be the minimal requirement but then things like this docker image should be updated to reflect that.

@w-e-w
Copy link
Collaborator Author

w-e-w commented Jul 8, 2024

from the start the intended version is always being 3.10
but it used to be that Google Colab is on an old version of python
so an effort was made to maintaining compatibility with old versions
but since then Colab has upgreaded so most devs just don't care any more


if you use other versions python from you will get big warning

modules.errors.print_error_explanation(f"""
INCOMPATIBLE PYTHON VERSION
This program is tested with 3.10.6 Python, but you have {major}.{minor}.{micro}.
If you encounter an error with "RuntimeError: Couldn't install torch." message,
or any other error regarding unsuccessful package (library) installation,
please downgrade (or upgrade) to the latest version of 3.10 Python
and delete current Python and "venv" folder in WebUI's directory.
You can download 3.10 Python from here: https://www.python.org/downloads/release/python-3106/
{"Alternatively, use a binary release of WebUI: https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.0.0-pre" if is_windows else ""}
Use --skip-python-version-check to suppress this warning.
""")

but most people just ignore the warning

update,
ahh I see, the warning is basically disabled on linux


I only made this PR because someone made a prior PR that change the match case (whitch I myself introduced)
and since somemade that PR and was merged, I made this since it's a trivial change to follow suit

if in the future that due to reason such as package incompatibility or if 3.9 is preventing us development we will probably just don't care about 3.9 and continue on

quoting someone other dev

I would put zero effort into trying to make 3.9 work, but if people are contributing things that make it work, I would take them

personally if it's up to me I would have deliberately broken compatibility for python 3.9
forcing people to upgrade and reducing the chance of potential odd issues

I would even upgrade to 3.11, I know for a fact that a couple of devs are using 3.11 for a long time now


as far as I'm where we are did not made any official docker container image
if you're using an image that use 3.9 then whoever made that image didn't configure the image correctly

@markg85
Copy link

markg85 commented Jul 8, 2024

Hi @w-e-w,

Thank you for your elaborate response! That's nice and helps :)
I only have one remark left, that's for docker.
While this repo might not host a container, the instructions to get one up and running are here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs And that container by default has that python 3.9.x version.

It's simple to fix the instructions:

  • conda init bash
  • and then a line to setup conda with the right python version
  • plus a line to use that environment
  • and the container works (probably.. i did have to install the timm so there might be something wrong with the requirements too somewhere..

But that's about it and gives a "hey, it works with instructions" experience again :)

@w-e-w
Copy link
Collaborator Author

w-e-w commented Jul 9, 2024

oh my it worte 3.9...

w-e-w added a commit that referenced this pull request Jul 11, 2024
Co-Authored-By: SLAPaper Pang <slapaper.pku@gmail.com>
@w-e-w w-e-w mentioned this pull request Jul 11, 2024
4 tasks
AUTOMATIC1111 added a commit that referenced this pull request Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants