Commit 87cf6767 authored by PJ Eby's avatar PJ Eby

Don't modify .pth files when in --dry-run/-n mode.

--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041085
parent 6a241540
......@@ -4,41 +4,6 @@ from pkg_resources import Distribution, PathMetadata
from distutils import log
import sys, os
class develop(easy_install):
"""Set up package for development"""
......@@ -59,10 +24,21 @@ class develop(easy_install):
command_consumes_arguments = False # override base
def run(self):
if self.uninstall:
self.multi_version = True
self.uninstall_link()
else:
self.install_for_development()
def initialize_options(self):
self.uninstall = None
easy_install.initialize_options(self)
def finalize_options(self):
ei = self.get_finalized_command("egg_info")
self.args = [ei.egg_name]
......@@ -78,15 +54,6 @@ class develop(easy_install):
name = ei.egg_name
)
def run(self):
if self.uninstall:
self.multi_version = True
self.uninstall_link()
else:
self.install_for_development()
def install_for_development(self):
# Ensure metadata is up-to-date
self.run_command('egg_info')
......@@ -108,6 +75,11 @@ class develop(easy_install):
# and handling requirements
self.process_distribution(None, self.dist)
def uninstall_link(self):
if os.path.exists(self.egg_link):
log.info("Removing %s (link to %s)", self.egg_link, self.egg_base)
......@@ -117,10 +89,12 @@ class develop(easy_install):
return
if not self.dry_run:
os.unlink(self.egg_link)
self.update_pth(self.dist) # remove any .pth link to us
if not self.dry_run:
self.update_pth(self.dist) # remove any .pth link to us
if self.distribution.scripts:
log.warn("Note: you must uninstall or replace scripts manually!")
def install_egg_scripts(self, dist):
if dist is not self.dist:
# Installing a dependency, so fall back to normal behavior
......@@ -142,21 +116,6 @@ class develop(easy_install):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment