Skip to content

Commit 5954aac

Browse files
authored
fix: prevent distutils warning (#3663)
1 parent 8afaedd commit 5954aac

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ module = [
314314
"ruamel",
315315
"rq",
316316
"shellingham",
317+
"setuptools",
317318
"toil.*",
318319
"tqdm",
319320
"urllib3.*",

renku/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323

2424
from renku.version import __template_version__, __version__
2525

26+
# distutils is deprecated and fully replaced by setuptools. we don't depend on either, but some of our
27+
# dependencies do and if distutils gets imported before setuptools, we get an annoying warning.
28+
# By forcing the import here first, we prevent that warning and ensure the setuptools version is used.
29+
try:
30+
import setuptools # noqa: F401 # type: ignore
31+
except ImportError:
32+
pass
33+
2634

2735
class LoaderWrapper(importlib.abc.Loader):
2836
"""Wrap an importlib loader and add the loaded module to sys.modules with an additional name."""

0 commit comments

Comments
 (0)