Skip to content

Get rid of setuptools as a runtime dependency #21

@flying-sheep

Description

@flying-sheep

pkg_resources is provided by setuptools:

__version__ = pkg_resources.require("altgraph")[0].version

The stdlib’s replacement for this line would be

from importlib.metadata import version

 __version__ = version("altgraph")

If you want to be compatible with Python <3.8, you could do:

try:
    from importlib.metadata import version
except ImportError:  # Python <3.8
    from importlib_metadata import version

 __version__ = version("altgraph")

which would use this conditional dependency: importlib-metadata; python_version < '3.8'

You could also just do #12 instead. Flit sources the metadata version from a version string in __init__.py so this would just become __version__ = '0.17.4'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions