diff --git a/.github/workflows/lint-black.yaml b/.github/workflows/lint-black.yaml index 845479e9..35a03624 100644 --- a/.github/workflows/lint-black.yaml +++ b/.github/workflows/lint-black.yaml @@ -20,7 +20,7 @@ jobs: python-version: 3.8 - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip wheel packaging make install-lint - name: Run black run: | diff --git a/.github/workflows/lint-darglint.yaml b/.github/workflows/lint-darglint.yaml index 7465bf05..d40b256c 100644 --- a/.github/workflows/lint-darglint.yaml +++ b/.github/workflows/lint-darglint.yaml @@ -20,7 +20,7 @@ jobs: python-version: 3.8 - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip wheel packaging make install-lint - name: Run darglint run: | diff --git a/.github/workflows/lint-flake8.yaml b/.github/workflows/lint-flake8.yaml index c9fe10a6..c0f2bfde 100644 --- a/.github/workflows/lint-flake8.yaml +++ b/.github/workflows/lint-flake8.yaml @@ -19,7 +19,7 @@ jobs: python-version: 3.8 - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip wheel packaging make install-lint - name: Run flake8 run: | diff --git a/.github/workflows/lint-isort.yaml b/.github/workflows/lint-isort.yaml index cdde1386..543a374c 100644 --- a/.github/workflows/lint-isort.yaml +++ b/.github/workflows/lint-isort.yaml @@ -20,7 +20,7 @@ jobs: python-version: 3.8 - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip wheel packaging make install-lint - name: Run isort run: | diff --git a/.github/workflows/lint-pydocstyle.yaml b/.github/workflows/lint-pydocstyle.yaml index 5cd4baa2..f18e8753 100644 --- a/.github/workflows/lint-pydocstyle.yaml +++ b/.github/workflows/lint-pydocstyle.yaml @@ -21,7 +21,7 @@ jobs: python-version: 3.8 - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip wheel packaging make install-lint - name: Run pydocstyle run: | diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0b1c9739..5389d3cf 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + python -m pip install setuptools wheel twine packaging - name: Build and publish env: TWINE_USERNAME: __token__ diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5dc6c116..335126b7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,7 +25,7 @@ jobs: python-version: "${{ matrix.python-version }}" - name: Install Dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip wheel packaging make install-test - name: Run test if: contains('refs/heads/master refs/heads/development', github.ref) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 3d33c3ec..6436f79b 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,6 +10,9 @@ build: os: ubuntu-22.04 tools: python: "3.8" + jobs: + post_install: + - pip install --upgrade pip packaging wheel setuptools==69.5.1 python: install: diff --git a/setup.cfg b/setup.cfg index 75924ff2..3527794b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py index 18aba9ef..5007a5ba 100644 --- a/setup.py +++ b/setup.py @@ -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)