InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

Support Python 3.12

Open JamesClarke7283 opened this issue 8 months ago • 36 comments

Summary

This PR updates the pinned dependencies in the pyproject.toml to support python3.12. this is a first draft.

If we are making use of asyncio in some capacity, it might improve performance a fair amount in some use cases, as a added bonus.

Related Issues / Discussions

Will likely fix #6214 Will also likely fix #5674 although, we may want to add scripts which update the pinned versions to the lowest version that x python version supports, as long as the version is equal to or greater than whats already in the dependencies.

QA Instructions

# Setting up the environment
export INVOKEAI_ROOT=~/invokeai
mkdir $INVOKEAI_ROOT
cd $INVOKEAI_ROOT
python3.12 -m venv .venv --prompt InvokeAI
source .venv/bin/activate

# Cloning Invoke
cd ~/Downloads
git clone https://github.com/JamesClarke7283/InvokeAI --depth 1

# Installing dependencies
cd InvokeAI
pip install -e . --use-pep517 --extra-index-url https://download.pytorch.org/whl/cu121 # if using cuda
cd $INVOKEAI_ROOT
deactivate && source .venv/bin/activate

# build the frontend
cd ~/Downloads/InvokeAI/invokeai/frontend/web/
pnpm i
pnpm build

# run the program
cd $INVOKEAI_ROOT
invokeai-web

Merge Plan

Should be fairly simple to merge, as long as the tests pass, its mostly only the pyproject.toml that needs editing at the moment.

Checklist

  • [x] Update pyproject.toml with dependencies that support 3.12.
  • [x] Check if it installs correctly.
  • [ ] Make changes to automatic install script to support 3.12.
  • [ ] Add Python3.12 build github workflow.

JamesClarke7283 avatar Jun 24 '24 13:06 JamesClarke7283