]> granicus.if.org Git - python/commitdiff
Packaging cleanup: remove use of script_name where obsolete
authorÉric Araujo <merwok@netwok.org>
Wed, 8 Jun 2011 02:06:50 +0000 (04:06 +0200)
committerÉric Araujo <merwok@netwok.org>
Wed, 8 Jun 2011 02:06:50 +0000 (04:06 +0200)
Lib/packaging/run.py
Lib/packaging/tests/test_command_bdist_dumb.py
Lib/packaging/tests/test_command_build_py.py
Lib/packaging/tests/test_command_install_dist.py
Lib/packaging/tests/test_command_install_lib.py
Lib/packaging/tests/test_command_sdist.py

index c17ccfdf4bf3ae390665eeb5434d30695d6b6774..3afda5af5e629a34b42068611a6c27f19d7f46a5 100644 (file)
@@ -405,7 +405,6 @@ class Dispatcher:
         self.verbose = 1
         self.dry_run = False
         self.help = False
-        self.script_name = 'pysetup'
         self.cmdclass = {}
         self.commands = []
         self.command_options = {}
index 41b0dd0dc9cec03f5a9baf764338c0ebbc3472e5..b2357953a637abeea38afaef5a4a98c066dcd351 100644 (file)
@@ -49,7 +49,6 @@ class BuildDumbTestCase(support.TempdirManager,
                              'py_modules': ['foo'],
                              'url': 'xxx', 'author': 'xxx',
                              'author_email': 'xxx'})
-        dist.script_name = 'setup.py'
         os.chdir(pkg_dir)
 
         sys.argv[:] = ['setup.py']
index 49069f51f028cdf75aeaf835e8fe0539a4e33dc4..243a863a609d5f0064ef201aa09d2e54bd6d82da 100644 (file)
@@ -33,9 +33,7 @@ class BuildPyTestCase(support.TempdirManager,
 
         dist = Distribution({"packages": ["pkg"],
                              "package_dir": sources})
-        # script_name need not exist, it just need to be initialized
 
-        dist.script_name = os.path.join(sources, "setup.py")
         dist.command_obj["build"] = support.DummyCommand(
             force=False,
             build_lib=destination,
@@ -89,8 +87,6 @@ class BuildPyTestCase(support.TempdirManager,
             dist = Distribution({"packages": ["pkg"],
                                  "package_dir": sources,
                                  "package_data": {"pkg": ["doc/*"]}})
-            # script_name need not exist, it just need to be initialized
-            dist.script_name = os.path.join(sources, "setup.py")
             dist.script_args = ["build"]
             dist.parse_command_line()
 
index 1974a2fc09241eef14bfc47f520aeca80e6be770..7821a3afde7c02ef82d816d377ec96b0c91cd32a 100644 (file)
@@ -30,8 +30,6 @@ class InstallTestCase(support.TempdirManager,
         destination = os.path.join(builddir, "installation")
 
         dist = Distribution({"name": "foopkg"})
-        # script_name need not exist, it just need to be initialized
-        dist.script_name = os.path.join(builddir, "setup.py")
         dist.command_obj["build"] = support.DummyCommand(
             build_base=builddir,
             build_lib=os.path.join(builddir, "lib"),
index 96749e3bf3869267835fabaf8595544115ca0db0..b46f3bd2bb578d69974b5c19ddf220c860dad82f 100644 (file)
@@ -65,7 +65,6 @@ class InstallLibTestCase(support.TempdirManager,
         self.write_file(f, '# python package')
         cmd.distribution.ext_modules = [Extension('foo', ['xxx'])]
         cmd.distribution.packages = [pkg_dir]
-        cmd.distribution.script_name = 'setup.py'
 
         # make sure the build_lib is set the temp dir
         build_dir = os.path.split(pkg_dir)[0]
@@ -86,7 +85,6 @@ class InstallLibTestCase(support.TempdirManager,
         self.write_file(f, '# python package')
         cmd.distribution.ext_modules = [Extension('foo', ['xxx'])]
         cmd.distribution.packages = [pkg_dir]
-        cmd.distribution.script_name = 'setup.py'
 
         # get_input should return 2 elements
         self.assertEqual(len(cmd.get_inputs()), 2)
index 7be349f1ece770687d3920410d2753d8be9774a3..bcaa63087ae1e4236f0fb4308408c9a3be0ee83f 100644 (file)
@@ -24,12 +24,6 @@ from packaging.util import find_executable
 from packaging.tests import support
 from shutil import get_archive_formats
 
-SETUP_PY = """
-from packaging.core import setup
-import somecode
-
-setup(name='fake')
-"""
 
 MANIFEST = """\
 # file GENERATED by packaging, do NOT edit
@@ -57,8 +51,6 @@ class SDistTestCase(support.TempdirManager,
     restore_environ = ['HOME']
 
     def setUp(self):
-        # PyPIRCCommandTestCase creates a temp dir already
-        # and put it in self.tmp_dir
         super(SDistTestCase, self).setUp()
         self.tmp_dir = self.mkdtemp()
         os.environ['HOME'] = self.tmp_dir
@@ -69,7 +61,6 @@ class SDistTestCase(support.TempdirManager,
         # a package, and a README
         self.write_file((self.tmp_dir, 'README'), 'xxx')
         self.write_file((self.tmp_dir, 'somecode', '__init__.py'), '#')
-        self.write_file((self.tmp_dir, 'setup.py'), SETUP_PY)
         os.chdir(self.tmp_dir)
 
     def tearDown(self):
@@ -84,7 +75,6 @@ class SDistTestCase(support.TempdirManager,
                         'url': 'xxx', 'author': 'xxx',
                         'author_email': 'xxx'}
         dist = Distribution(metadata)
-        dist.script_name = 'setup.py'
         dist.packages = ['somecode']
         dist.include_package_data = True
         cmd = sdist(dist)