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

Rework installer and requirement checks #449

Merged
merged 3 commits into from
May 31, 2023
Merged

Conversation

akx
Copy link
Collaborator

@akx akx commented May 24, 2023

This PR:

  • moves requirements from requirements.txt to the standard TOML project.dependencies list
  • guts install.py to move everything version-specific to sd_dynamic_prompts.version_tools
    • We now just always attempt to install the requirements from requirements. No good reason not to, IMO :)
  • switches to using packaging's utilities to check whether the currently installed dynamicprompts version matches our specifier; this means e.g. future [compatible] versions of dynamicprompts work without having to bump the requirement here; e.g. ~=0.25.2 is fine with any 0.25 series >= 0.25.2, ~=0.25 is fine with any 0.x >= 0.25, etc. This also allows using actual ranges, if we need to, in the requirements, e.g. ~=0.25.2,<0.30 (but hopefully it never gets to that).
  • improves the messaging a bit (though the formatting maybe got worse c.f. An incompatible library version disables the extension. #447); see screenshot.

Screenshot

Screenshot 2023-05-24 at 10 50 04


Follows up on #447, #450
Fixes #437

@akx akx added the enhancement New feature or request label May 24, 2023
@akx akx requested a review from adieyal May 24, 2023 07:56
@adieyal
Copy link
Owner

adieyal commented May 24, 2023

Shoot - didn't realise that you were working on this now. I just pushed some temporary changes in anticipation of your update. Feel free to revert my PR.

@akx
Copy link
Collaborator Author

akx commented May 24, 2023

@adieyal No worries, rebased :)

@adieyal
Copy link
Owner

adieyal commented May 24, 2023

I'm getting a ModuleNotFoundError:
ModuleNotFoundError: No module named 'tomli'

@akx
Copy link
Collaborator Author

akx commented May 24, 2023

@adieyal ah, good catch...

@akx
Copy link
Collaborator Author

akx commented May 30, 2023

@adieyal I pushed a new commit that adds compatibility imports for TOML and Packaging from pip's vendored libraries and tried that this works fine on e.g. a python:3.9 Docker image. I think we should be safe to assume that our users don't use a three-year-old pip, and if they do, they should upgrade.

This is conflicting on 53e69fe though (#479).

@akx akx marked this pull request as ready for review May 30, 2023 09:22
@adieyal adieyal merged commit 264c5a9 into adieyal:main May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make version compatibility checking stricter
2 participants