Skip to content

Can setuptools rely on importlib_metadata instead of pkg_resources? #38

Closed

Description

@jaraco

In GitLab by @jaraco on Dec 24, 2018, 16:54

As an academic exercise, I'd like to survey the setuptools source code and see what functions within pkg_resources that setuptools (the Python package) relies on that could be supported by importlib_resources. I think it would be useful to know what functionality might be used there that's not implemented here.

Activity

  1. jaraco commented on Oct 22, 2020

    @jaraco
    MemberAuthor

    In GitLab by @jaraco on Dec 24, 2018, 17:59

    Below is my survey of the package. I've left some sections incomplete. I've tried to mark some functionality I consider deprecated. I intend to use the checkboxes to show where importlib_metadata could fairly readily support the use-case.

    setuptools.archive_util

    • ensure directory

    setuptools.dist

    • parse entry points
    • check marker validity (packaging)
    • parse requirements (packaging)
    • test entry points parseable
    • convert package name to a 'safe' name
    • load version from that safe name
    • convert a version to a 'safe' version
    • load entry points
    • resolve package in local environment
    • install and add package to local working set if missing (deprecated)
    • install dependencies of an entry point (based on extras?; deprecated)

    setuptools.package_index, setuptools.sandbox

    • Lots of usage (deprecated)

    setuptools.ssl_support

    • raise exceptions from pkg_resources

    setuptools.version

    • Load version from metadata

    setuptools.wheel

    • Get the "egg name" for project, version, and platform.
    • Load install requirements and extra requirements from a wheel.
    • Parse a version (packaging)

    setuptools.command.bdist_egg

    • Determine egg name from name, version, and platform info.
    • get_build_platform
    • ensure directory
    • Parse and load entry points from the distribution being built

    setuptools.command.develop

    • normalize_path (extensive)
    • constructs a pkg_resources.Distribution, usage unknown

    setuptools.command.easy_install

    • Various usage, not investigated (deprecated)

    setuptools.command.egg_info (metadata constructor)

    • parse_requirements, safe_name, parse_version, safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename

    setuptools.command.install_egg_info

    • Determine egg name from name, version.
    • ensure directory

    setuptools.command.install_scripts

    • Determine egg name from name, version
    • ensure directory

    setuptools.command.sdist

    • load entry points

    setuptools.command.test

    Lots here not investigated

    • resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, evaluate_marker, add_activation_listener, require, EntryPoint

    setuptools.command.upload_docs

    • load entry points
  2. jaraco commented on Oct 22, 2020

    @jaraco
    MemberAuthor

    In GitLab by @jaraco on Sep 2, 2019, 15:07

    I don't foresee any action for importlib_metadata from this ticket, so I'm closing as the analysis is done.

  3. jaraco commented on Oct 22, 2020

    @jaraco
    MemberAuthor

    In GitLab by @jaraco on Sep 2, 2019, 15:07

    closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions