Skip to content

Commit

Permalink
[REF] Switch version detection from pkg_resources to `importlib,pac…
Browse files Browse the repository at this point in the history
…kaging`
  • Loading branch information
f-dangel committed Jul 2, 2024
1 parent 92ccd9f commit 49e2363
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ lint =

# Dependencies needed to build/view the documentation (semicolon/line-separated)
docs =
setuptools==69.5.1 # RTD fails with setuptools>=70, see https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/15863
transformers
datasets
matplotlib
Expand Down
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"""

import sys
from importlib.metadata import version

from pkg_resources import VersionConflict, require
from packaging.version import Version
from setuptools import setup

try:
require("setuptools>=38.3")
except VersionConflict:
print("Error: version of setuptools is too old (<38.3)!")
setuptools_version = Version(version("setuptools"))

if setuptools_version < Version("38.3"):
print(f"Error: version of setuptools is too old (<38.3). Got {setuptools_version}.")
sys.exit(1)


Expand Down

0 comments on commit 49e2363

Please sign in to comment.