Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@

from os.path import join, dirname
from setuptools import setup, find_packages, __version__ as setuptools_version
from pkg_resources import parse_version

import pkg_resources
try:
from pkg_resources import parse_version
import pkg_resources
except ModuleNotFoundError:
from setuptools._vendor.packaging.version import parse as parse_version
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chenrui333 @grawlinson this does not work on Arch linux. The vendor namespace is an internal implementation detail that should not be relied upon. setuptools 82 that removed pkg_resources requires the packaging package so if pkg_resources is not provided by setuptools packing will be available not withstanding a broken installation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like @loqs has said; It is 100% better to just do from packaging import parse as parse_version rather than depending on an internal implementation which will change at some point in the future.

pkg_resources = None

try:
import _markerlib.markers
Expand Down