summaryrefslogtreecommitdiff
path: root/setuptools
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-05-13 07:07:03 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-05-13 07:07:03 -0400
commit8f05565451ef38cc10074582ad826941f8f8c899 (patch)
tree3b13af466ad891a3481fd420c63f612a7621b44e /setuptools
parenta0d19667eaa92bd95f2bebfcb50a68d0921282eb (diff)
parent068ab0e3a6e5146137ee9f913e3b1fbc5b337c22 (diff)
downloadpython-setuptools-git-8f05565451ef38cc10074582ad826941f8f8c899.tar.gz
Merge with Distribute 0.6.39
--HG-- rename : distribute_setup.py => ez_setup.py
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/cli-32.exebin69632 -> 65536 bytes
-rw-r--r--setuptools/cli-64.exebin75264 -> 74752 bytes
-rw-r--r--setuptools/cli-arm-32.exebin0 -> 69120 bytes
-rw-r--r--setuptools/cli.exebin69632 -> 0 bytes
-rwxr-xr-xsetuptools/command/easy_install.py23
-rw-r--r--setuptools/command/launcher manifest.xml15
-rw-r--r--setuptools/gui-32.exebin65536 -> 65536 bytes
-rw-r--r--setuptools/gui-64.exebin75264 -> 75264 bytes
-rw-r--r--setuptools/gui-arm-32.exebin0 -> 69120 bytes
-rw-r--r--setuptools/gui.exebin65536 -> 0 bytes
-rw-r--r--setuptools/tests/win_script_wrapper.txt6
11 files changed, 41 insertions, 3 deletions
diff --git a/setuptools/cli-32.exe b/setuptools/cli-32.exe
index 9b7717b7..b1487b78 100644
--- a/setuptools/cli-32.exe
+++ b/setuptools/cli-32.exe
Binary files differ
diff --git a/setuptools/cli-64.exe b/setuptools/cli-64.exe
index 265585af..675e6bf3 100644
--- a/setuptools/cli-64.exe
+++ b/setuptools/cli-64.exe
Binary files differ
diff --git a/setuptools/cli-arm-32.exe b/setuptools/cli-arm-32.exe
new file mode 100644
index 00000000..2f40402d
--- /dev/null
+++ b/setuptools/cli-arm-32.exe
Binary files differ
diff --git a/setuptools/cli.exe b/setuptools/cli.exe
deleted file mode 100644
index 9b7717b7..00000000
--- a/setuptools/cli.exe
+++ /dev/null
Binary files differ
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index a2d2ed6a..4cd058bb 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -19,7 +19,9 @@ import zipfile
import re
import stat
import random
+import platform
from glob import glob
+import pkg_resources
from setuptools import Command, _dont_write_bytecode
from setuptools.sandbox import run_setup
from distutils import log, dir_util
@@ -522,6 +524,10 @@ Please make the appropriate changes for your system and try again.
"""Write all the scripts for `dist`, unless scripts are excluded"""
if not self.exclude_scripts and dist.metadata_isdir('scripts'):
for script_name in dist.metadata_listdir('scripts'):
+ if dist.metadata_isdir('scripts/' + script_name):
+ # The "script" is a directory, likely a Python 3
+ # __pycache__ directory, so skip it.
+ continue
self.install_script(
dist, script_name,
dist.get_metadata('scripts/'+script_name)
@@ -1833,6 +1839,8 @@ def get_script_args(dist, executable=sys_executable, wininst=False):
ext, launcher = '-script.py', 'cli.exe'
old = ['.py','.pyc','.pyo']
new_header = re.sub('(?i)pythonw.exe','python.exe',header)
+ if platform.machine().lower()=='arm':
+ launcher = launcher.replace(".", "-arm.")
if is_64bit():
launcher = launcher.replace(".", "-64.")
else:
@@ -1846,11 +1854,26 @@ def get_script_args(dist, executable=sys_executable, wininst=False):
name+'.exe', resource_string('setuptools', launcher),
'b' # write in binary mode
)
+ if not is_64bit():
+ # install a manifest for the launcher to prevent Windows
+ # from detecting it as an installer (which it will for
+ # launchers like easy_install.exe). Consider only
+ # adding a manifest for launchers detected as installers.
+ # See Distribute #143 for details.
+ m_name = name + '.exe.manifest'
+ yield (m_name, load_launcher_manifest(name), 't')
else:
# On other platforms, we assume the right thing to do is to
# just write the stub with no extension.
yield (name, header+script_text)
+def load_launcher_manifest(name):
+ manifest = pkg_resources.resource_string(__name__, 'launcher manifest.xml')
+ if sys.version_info[0] < 3:
+ return manifest % vars()
+ else:
+ return manifest.decode('utf-8') % vars()
+
def rmtree(path, ignore_errors=False, onerror=auto_chmod):
"""Recursively delete a directory tree.
diff --git a/setuptools/command/launcher manifest.xml b/setuptools/command/launcher manifest.xml
new file mode 100644
index 00000000..844d2264
--- /dev/null
+++ b/setuptools/command/launcher manifest.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity version="1.0.0.0"
+ processorArchitecture="X86"
+ name="%(name)s"
+ type="win32"/>
+ <!-- Identify the application security requirements. -->
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
diff --git a/setuptools/gui-32.exe b/setuptools/gui-32.exe
index 3f64af7d..f8d35096 100644
--- a/setuptools/gui-32.exe
+++ b/setuptools/gui-32.exe
Binary files differ
diff --git a/setuptools/gui-64.exe b/setuptools/gui-64.exe
index 3ab4378e..330c51a5 100644
--- a/setuptools/gui-64.exe
+++ b/setuptools/gui-64.exe
Binary files differ
diff --git a/setuptools/gui-arm-32.exe b/setuptools/gui-arm-32.exe
new file mode 100644
index 00000000..537aff37
--- /dev/null
+++ b/setuptools/gui-arm-32.exe
Binary files differ
diff --git a/setuptools/gui.exe b/setuptools/gui.exe
deleted file mode 100644
index 3f64af7d..00000000
--- a/setuptools/gui.exe
+++ /dev/null
Binary files differ
diff --git a/setuptools/tests/win_script_wrapper.txt b/setuptools/tests/win_script_wrapper.txt
index 9f7c81d6..9ccc96f0 100644
--- a/setuptools/tests/win_script_wrapper.txt
+++ b/setuptools/tests/win_script_wrapper.txt
@@ -38,7 +38,7 @@ We'll also copy cli.exe to the sample-directory with the name foo.exe:
>>> import pkg_resources
>>> f = open(os.path.join(sample_directory, 'foo.exe'), 'wb')
>>> f.write(
- ... pkg_resources.resource_string('setuptools', 'cli.exe')
+ ... pkg_resources.resource_string('setuptools', 'cli-32.exe')
... )
>>> f.close()
@@ -83,7 +83,7 @@ enter the interpreter after running the script, you could use -Oi:
>>> f = open(os.path.join(sample_directory, 'foo-script.py'), 'w')
>>> f.write(
- ... """#!%(python_exe)s -Oi
+ ... """#!%(python_exe)s -Oi
... import sys
... input = repr(sys.stdin.read())
... print sys.argv[0][-14:]
@@ -126,7 +126,7 @@ We'll also copy gui.exe to the sample-directory with the name bar.exe:
>>> import pkg_resources
>>> f = open(os.path.join(sample_directory, 'bar.exe'), 'wb')
>>> f.write(
- ... pkg_resources.resource_string('setuptools', 'gui.exe')
+ ... pkg_resources.resource_string('setuptools', 'gui-32.exe')
... )
>>> f.close()