Commit eafde2c8 authored by Jason R. Coombs's avatar Jason R. Coombs

easy_install once again honors setup.cfg if found in the current directory

--HG--
branch : Setuptools-Distribute merge
extra : source : 422fc7e84eb2a22aa13df44dea6f138d7c840e83
parent f86079e4
......@@ -35,3 +35,7 @@ Minor Changes
* The patch for `#174 <https://bitbucket.org/tarek/distribute/issue/174>`_
has been rolled-back, as the comment on the ticket indicates that the patch
addressed a symptom and not the fundamental issue.
* ``easy_install`` (the command) once again honors setup.cfg if found in the
current directory. The "mis-behavior" characterized in `#99
<https://bitbucket.org/tarek/distribute/issue/99>`_ is actually intended
behavior, and no substantial rationale was given for the deviation.
......@@ -1925,12 +1925,6 @@ usage: %(script)s [options] requirement_or_url ...
def _show_help(self,*args,**kw):
with_ei_usage(lambda: Distribution._show_help(self,*args,**kw))
def find_config_files(self):
files = Distribution.find_config_files(self)
if 'setup.cfg' in files:
files.remove('setup.cfg')
return files
if argv is None:
argv = sys.argv[1:]
......
......@@ -13,7 +13,7 @@ import StringIO
import distutils.core
from setuptools.sandbox import run_setup, SandboxViolation
from setuptools.command.easy_install import easy_install, fix_jython_executable, get_script_args, main
from setuptools.command.easy_install import easy_install, fix_jython_executable, get_script_args
from setuptools.command.easy_install import PthDistributions
from setuptools.command import easy_install as easy_install_pkg
from setuptools.dist import Distribution
......@@ -84,41 +84,6 @@ class TestEasyInstallTest(unittest.TestCase):
self.assertEqual(script, WANTED)
def test_no_setup_cfg(self):
# makes sure easy_install as a command (main)
# doesn't use a setup.cfg file that is located
# in the current working directory
dir = tempfile.mkdtemp()
setup_cfg = open(os.path.join(dir, 'setup.cfg'), 'w')
setup_cfg.write('[easy_install]\nfind_links = http://example.com')
setup_cfg.close()
setup_py = open(os.path.join(dir, 'setup.py'), 'w')
setup_py.write(SETUP_PY)
setup_py.close()
from setuptools.dist import Distribution
def _parse_command_line(self):
msg = 'Error: a local setup.cfg was used'
opts = self.command_options
if 'easy_install' in opts:
assert 'find_links' not in opts['easy_install'], msg
return self._old_parse_command_line()
Distribution._old_parse_command_line = Distribution.parse_command_line
Distribution.parse_command_line = _parse_command_line
old_wd = os.getcwd()
try:
os.chdir(dir)
reset_setup_stop_context(
lambda: self.assertRaises(SystemExit, main, [])
)
finally:
os.chdir(old_wd)
shutil.rmtree(dir)
Distribution.parse_command_line = Distribution._old_parse_command_line
def test_no_find_links(self):
# new option '--no-find-links', that blocks find-links added at
# the project level
......
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