Skip to content

Commit

Permalink
fix: prevent distutils warning (#3663)
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Jan 3, 2024
1 parent 8afaedd commit 5954aac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Expand Up @@ -314,6 +314,7 @@ module = [
"ruamel",
"rq",
"shellingham",
"setuptools",
"toil.*",
"tqdm",
"urllib3.*",
Expand Down
8 changes: 8 additions & 0 deletions renku/__init__.py
Expand Up @@ -23,6 +23,14 @@

from renku.version import __template_version__, __version__

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


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

0 comments on commit 5954aac

Please sign in to comment.