Skip to content

Missing dependency on distutils #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
CharString opened this issue May 23, 2025 · 0 comments · May be fixed by #398
Open

Missing dependency on distutils #407

CharString opened this issue May 23, 2025 · 0 comments · May be fixed by #398

Comments

@CharString
Copy link

from distutils.version import LooseVersion
import IPython
ipython_version = LooseVersion(IPython.__version__)
if ipython_version < '0.11':
from IPython.genutils import page
from IPython.ipstruct import Struct
from IPython.ipapi import UsageError
else:
from IPython.core.page import page
from IPython.utils.ipstruct import Struct
from IPython.core.error import UsageError

In Python 3.12 distutils has been removed from the standard library.

We could

  • add setuptools to the dependencies (having it required for the build-system doesn't make it required for the built package).
  • write it like
    try: 
        from IPython.core.page import page 
        from IPython.utils.ipstruct import Struct 
        from IPython.core.error import UsageError
    except ImportError:
        # probably IPython < 0.11
        from IPython.genutils import page 
        from IPython.ipstruct import Struct 
        from IPython.ipapi import UsageError
  • drop support of IPython 0.11 from 2011 and just do
    from IPython.core.page import page
    from IPython.utils.ipstruct import Struct 
    from IPython.core.error import UsageError
@CharString CharString linked a pull request May 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant