From 5e7b76f786e8a8fbfc3bfa4755033a8d9c2e06d8 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Tue, 24 Jan 2023 00:49:17 +0000 Subject: Replace/move _normalization.path with/to _path.samepath and _path.normpath --- setuptools/command/develop.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'setuptools/command/develop.py') diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index 5f9690f6..08ae7f0d 100644 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -6,8 +6,8 @@ import glob import io from setuptools.command.easy_install import easy_install +from setuptools import _path from setuptools import namespaces -from setuptools import _normalization import setuptools @@ -63,20 +63,17 @@ class develop(namespaces.DevelopInstaller, easy_install): if self.egg_path is None: self.egg_path = os.path.abspath(ei.egg_base) - target = _normalization.path(self.egg_base) - egg_path = _normalization.path( - os.path.join(self.install_dir, self.egg_path) - ) - if egg_path != target: + egg_path = os.path.join(self.install_dir, self.egg_path) + if not _path.same_path(egg_path, self.egg_base): raise DistutilsOptionError( "--egg-path must be a relative path from the install" - " directory to " + target + f" directory to {self.egg_base}" ) # Make a distribution for the package's source self.dist = pkg_resources.Distribution( - target, - pkg_resources.PathMetadata(target, os.path.abspath(ei.egg_info)), + self.egg_base, + pkg_resources.PathMetadata(self.egg_base, os.path.abspath(ei.egg_info)), project_name=ei.egg_name, ) @@ -96,15 +93,16 @@ class develop(namespaces.DevelopInstaller, easy_install): path_to_setup = egg_base.replace(os.sep, '/').rstrip('/') if path_to_setup != os.curdir: path_to_setup = '../' * (path_to_setup.count('/') + 1) - resolved = _normalization.path( + resolved = _path.normpath( os.path.join(install_dir, egg_path, path_to_setup) ) - if resolved != _normalization.path(os.curdir): + curdir = _path.normpath(os.curdir) + if resolved != curdir: raise DistutilsOptionError( "Can't get a consistent path to setup script from" " installation directory", resolved, - _normalization.path(os.curdir), + curdir, ) return path_to_setup -- cgit v1.2.1