From 14827711f669a830190313951ab5aef7b71ab2c6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 6 Nov 2016 15:54:07 -0500 Subject: Install -nspkg.pth under develop command. Fixes namespace package support as long as __init__.py is omitted. --- setuptools/command/develop.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'setuptools/command/develop.py') diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index 3eb86120..8de24fd7 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -9,10 +9,11 @@ from setuptools.extern import six from pkg_resources import Distribution, PathMetadata, normalize_path from setuptools.command.easy_install import easy_install +from setuptools import namespaces import setuptools -class develop(easy_install): +class develop(namespaces.DevelopInstaller, easy_install): """Set up package for development""" description = "install package in 'development mode'" @@ -123,6 +124,8 @@ class develop(easy_install): self.easy_install(setuptools.bootstrap_install_from) setuptools.bootstrap_install_from = None + self.install_namespaces() + # create an .egg-link in the installation dir, pointing to our egg log.info("Creating %s (link to %s)", self.egg_link, self.egg_base) if not self.dry_run: -- cgit v1.2.1 From 355603259aa37e424cf7466c3de6518375a935e3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 6 Nov 2016 16:41:23 -0500 Subject: Add uninstall support for namespace packages --- setuptools/command/develop.py | 1 + 1 file changed, 1 insertion(+) (limited to 'setuptools/command/develop.py') diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index 8de24fd7..aa82f959 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -31,6 +31,7 @@ class develop(namespaces.DevelopInstaller, easy_install): if self.uninstall: self.multi_version = True self.uninstall_link() + self.uninstall_namespaces() else: self.install_for_development() self.warn_deprecated_options() -- cgit v1.2.1 From ff371f18f0076bc63da05334f7e551c1cc29e10d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 1 Jan 2017 22:34:28 -0500 Subject: Strip out vendored packages and require them instead. Ref #581. --- setuptools/command/develop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/develop.py') diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index aa82f959..1489de9e 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -5,7 +5,7 @@ import os import glob import io -from setuptools.extern import six +import six from pkg_resources import Distribution, PathMetadata, normalize_path from setuptools.command.easy_install import easy_install -- cgit v1.2.1 From e9f0e6f16b46d084bdf92606cd0217b3f12ed25a Mon Sep 17 00:00:00 2001 From: David Szotten Date: Thu, 5 Jan 2017 11:47:09 +0000 Subject: strip trailing slash from package_dir before counting slashes --- setuptools/command/develop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/develop.py') diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index aa82f959..ca05d1e3 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -79,7 +79,7 @@ class develop(namespaces.DevelopInstaller, easy_install): project_name=ei.egg_name ) - p = self.egg_base.replace(os.sep, '/') + p = self.egg_base.replace(os.sep, '/').rstrip('/') if p != os.curdir: p = '../' * (p.count('/') + 1) self.setup_path = p -- cgit v1.2.1 From 322472e4ffdc03901be1f584a548b00f1372037d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 24 Jan 2017 10:13:24 -0500 Subject: Extract staticmethod for resolving setup path --- setuptools/command/develop.py | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'setuptools/command/develop.py') diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index 1489de9e..97708ba3 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -79,15 +79,28 @@ class develop(namespaces.DevelopInstaller, easy_install): project_name=ei.egg_name ) - p = self.egg_base.replace(os.sep, '/') - if p != os.curdir: - p = '../' * (p.count('/') + 1) - self.setup_path = p - p = normalize_path(os.path.join(self.install_dir, self.egg_path, p)) - if p != normalize_path(os.curdir): + self.setup_path = self._resolve_setup_path( + self.egg_base, + self.install_dir, + self.egg_path, + ) + + @staticmethod + def _resolve_setup_path(egg_base, install_dir, egg_path): + """ + Generate a path from egg_base back to '.' where the + setup script resides and ensure that path points to the + setup path from $install_dir/$egg_path. + """ + path_to_setup = egg_base.replace(os.sep, '/') + if path_to_setup != os.curdir: + path_to_setup = '../' * (path_to_setup.count('/') + 1) + resolved = normalize_path(os.path.join(install_dir, egg_path, path_to_setup)) + if resolved != normalize_path(os.curdir): raise DistutilsOptionError( "Can't get a consistent path to setup script from" - " installation directory", p, normalize_path(os.curdir)) + " installation directory", resolved, normalize_path(os.curdir)) + return path_to_setup def install_for_development(self): if six.PY3 and getattr(self.distribution, 'use_2to3', False): -- cgit v1.2.1 From 3d0cc355fb5e8012cb8c72f0e25042a5a44f31d6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 24 Feb 2017 11:49:51 -0500 Subject: Revert "Merge pull request #933 from pypa/feature/581-depend-not-bundle" This reverts commit 089cdeb489a0fa94d11b7307b54210ef9aa40511, reversing changes made to aaec654d804cb78dbb6391afff721a63f26a71cd. --- setuptools/command/develop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/develop.py') diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index ddfdc662..85b23c60 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -5,7 +5,7 @@ import os import glob import io -import six +from setuptools.extern import six from pkg_resources import Distribution, PathMetadata, normalize_path from setuptools.command.easy_install import easy_install -- cgit v1.2.1