Skip to content

Commit

Permalink
Replace use of parse_requirements with simple constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 5, 2022
1 parent 73e08a8 commit 157e36e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions setuptools/command/egg_info.py
Expand Up @@ -23,7 +23,7 @@
from setuptools.command.setopt import edit_config
from setuptools.command import bdist_egg
from pkg_resources import (
parse_requirements, safe_name, parse_version,
Requirement, safe_name, parse_version,
safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename)
import setuptools.unicode_utils as unicode_utils
from setuptools.glob import glob
Expand Down Expand Up @@ -205,12 +205,8 @@ def finalize_options(self):

try:
is_version = isinstance(parsed_version, packaging.version.Version)
spec = (
"%s==%s" if is_version else "%s===%s"
)
list(
parse_requirements(spec % (self.egg_name, self.egg_version))
)
spec = "%s==%s" if is_version else "%s===%s"
Requirement(spec % (self.egg_name, self.egg_version))
except ValueError as e:
raise distutils.errors.DistutilsOptionError(
"Invalid distribution name or version syntax: %s-%s" %
Expand Down

0 comments on commit 157e36e

Please sign in to comment.