Skip to content

from modelgenerator.tasks import Embed fails with docstring-inheritance==3.0.0 #31

Description

@LittletreeZou

Summary

Importing Embed from modelgenerator.tasks fails when docstring-inheritance==3.0.0 is installed. Downgrading to docstring-inheritance==2.2.1 resolves the issue.

This looks like a dependency compatibility issue: modelgenerator imports from an internal module path that is not available in docstring-inheritance==3.0.0.

Environment

OS: Linux
Python: 3.12.13
Python build: conda-forge, GCC 14.3.0
Conda env: cell-cond
Package: modelgenerator
docstring-inheritance version before fix: 3.0.0
docstring-inheritance version after fix: 2.2.1

Reproduction

pip install modelgenerator
pip install git+https://github.com/genbio-ai/openfold.git@c4aa2fd0d920c06d3fd80b177284a22573528442
pip install git+https://github.com/NVIDIA/dllogger.git@0540a43971f4a8a16693a9de9de73c1072020769
from modelgenerator.tasks import Embed

Actual behavior

The import fails with:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/shuxian.zou/miniforge3/envs/cell-cond/lib/python3.12/site-packages/modelgenerator/tasks/__init__.py", line 1, in <module>
    from modelgenerator.tasks.base import *
  File "/home/shuxian.zou/miniforge3/envs/cell-cond/lib/python3.12/site-packages/modelgenerator/tasks/base.py", line 7, in <module>
    from modelgenerator.utils import GoogleKwargsDocstringInheritanceInitMeta
  File "/home/shuxian.zou/miniforge3/envs/cell-cond/lib/python3.12/site-packages/modelgenerator/utils/__init__.py", line 1, in <module>
    from modelgenerator.utils.kwargs_doc import GoogleKwargsDocstringInheritanceInitMeta
  File "/home/shuxian.zou/miniforge3/envs/cell-cond/lib/python3.12/site-packages/modelgenerator/utils/kwargs_doc.py", line 10, in <module>
    from docstring_inheritance.docstring_inheritors.bases import SectionsType
ModuleNotFoundError: No module named 'docstring_inheritance.docstring_inheritors'

Installed dependency version

python -m pip show docstring-inheritance

Output:

Name: docstring-inheritance
Version: 3.0.0
Summary: Avoid writing and maintaining duplicated docstrings.
Home-page: https://github.com/AntoineD/docstring-inheritance
License-Expression: MIT
Location: /home/shuxian.zou/miniforge3/envs/cell-cond/lib/python3.12/site-packages
Requires: typing-extensions
Required-by: modelgenerator

Workaround

Downgrading docstring-inheritance fixes the issue:

python -m pip install --force-reinstall "docstring-inheritance<=2.2.1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions