Commit d08c74fb authored by Godefroid Chapelle's avatar Godefroid Chapelle

Problem: `TypeError: dist must be a Distribution instance`

Solution: workaround pip _distutils_hack
parent eb3f073f
...@@ -27,7 +27,6 @@ jobs: ...@@ -27,7 +27,6 @@ jobs:
env: env:
PACKAGE: ${{matrix.package}} PACKAGE: ${{matrix.package}}
PYTHON_VERSION: ${{matrix.python-version}} PYTHON_VERSION: ${{matrix.python-version}}
SETUPTOOLS_USE_DISTUTILS: stdlib
run: | run: |
sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout
sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg
......
...@@ -25,7 +25,6 @@ jobs: ...@@ -25,7 +25,6 @@ jobs:
env: env:
PACKAGE: ${{matrix.package}} PACKAGE: ${{matrix.package}}
PYTHON_VERSION: ${{matrix.python-version}} PYTHON_VERSION: ${{matrix.python-version}}
SETUPTOOLS_USE_DISTUTILS: stdlib
run: | run: |
sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout
sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg
......
Fix `TypeError: dist must be a Distribution instance` due to issue between
`setuptools` and `pip`.
...@@ -13,8 +13,25 @@ ...@@ -13,8 +13,25 @@
############################################################################## ##############################################################################
"""Buildout package """Buildout package
""" """
# do not change the import order
# deleting the spec_for_pip hack needs to be done before importing pip
# see https://github.com/pypa/pip/issues/8761 to understand
# the reason for the hack.
# I think it is reasonable to assume we will not run into the race.
import setuptools
try:
from _distutils_hack import DistutilsMetaFinder
if hasattr(DistutilsMetaFinder, 'spec_for_pip'):
del DistutilsMetaFinder.spec_for_pip
except ImportError:
pass
import pip # NOQA
import sys import sys
import zc.buildout.patches # NOQA import zc.buildout.patches # NOQA
WINDOWS = sys.platform.startswith('win') WINDOWS = sys.platform.startswith('win')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment