Skip to content

Missing dependency on distutils#407

@CharString

Description

@CharString

fromdistutils.versionimportLooseVersion
importIPython
ipython_version=LooseVersion(IPython.__version__)
ifipython_version<'0.11':
fromIPython.genutilsimportpage
fromIPython.ipstructimportStruct
fromIPython.ipapiimportUsageError
else:
fromIPython.core.pageimportpage
fromIPython.utils.ipstructimportStruct
fromIPython.core.errorimportUsageError

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: fromIPython.core.pageimportpagefromIPython.utils.ipstructimportStructfromIPython.core.errorimportUsageErrorexceptImportError: # probably IPython < 0.11fromIPython.genutilsimportpagefromIPython.ipstructimportStructfromIPython.ipapiimportUsageError
  • drop support of IPython 0.11 from 2011 and just do
    fromIPython.core.pageimportpagefromIPython.utils.ipstructimportStructfromIPython.core.errorimportUsageError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions