/
usr
/
lib
/
python2.7
/
site-packages
/
setuptools
/
command
/
/usr/lib/python2.7/site-packages/setuptools/command
mkdir
upload
Name
Size
Mode
Actions
alias.py
2426
0644
edit
dl
rm
alias.pyc
3098
0644
edit
dl
rm
alias.pyo
3098
0644
edit
dl
rm
bdist_egg.py
18185
0644
edit
dl
rm
bdist_egg.pyc
18388
0644
edit
dl
rm
bdist_egg.pyo
18388
0644
edit
dl
rm
bdist_rpm.py
1508
0644
edit
dl
rm
bdist_rpm.pyc
1914
0644
edit
dl
rm
bdist_rpm.pyo
1914
0644
edit
dl
rm
bdist_wininst.py
637
0644
edit
dl
rm
bdist_wininst.pyc
1191
0644
edit
dl
rm
bdist_wininst.pyo
1191
0644
edit
dl
rm
build_clib.py
4484
0644
edit
dl
rm
build_clib.pyc
2844
0644
edit
dl
rm
build_clib.pyo
2844
0644
edit
dl
rm
build_ext.py
13173
0644
edit
dl
rm
build_ext.pyc
12571
0644
edit
dl
rm
build_ext.pyo
12527
0644
edit
dl
rm
build_py.py
9596
0644
edit
dl
rm
build_py.pyc
10667
0644
edit
dl
rm
build_py.pyo
10667
0644
edit
dl
rm
develop.py
8046
0644
edit
dl
rm
develop.pyc
7900
0644
edit
dl
rm
develop.pyo
7900
0644
edit
dl
rm
dist_info.py
960
0644
edit
dl
rm
dist_info.pyc
1799
0644
edit
dl
rm
dist_info.pyo
1799
0644
edit
dl
rm
easy_install.py
87032
0644
edit
dl
rm
easy_install.pyc
80382
0644
edit
dl
rm
easy_install.pyo
80325
0644
edit
dl
rm
egg_info.py
24800
0644
edit
dl
rm
egg_info.pyc
25896
0644
edit
dl
rm
egg_info.pyo
25896
0644
edit
dl
rm
install.py
4683
0644
edit
dl
rm
install.pyc
4953
0644
edit
dl
rm
install.pyo
4953
0644
edit
dl
rm
install_egg_info.py
2203
0644
edit
dl
rm
install_egg_info.pyc
3185
0644
edit
dl
rm
install_egg_info.pyo
3185
0644
edit
dl
rm
install_lib.py
3840
0644
edit
dl
rm
install_lib.pyc
4870
0644
edit
dl
rm
install_lib.pyo
4824
0644
edit
dl
rm
install_scripts.py
2439
0644
edit
dl
rm
install_scripts.pyc
2891
0644
edit
dl
rm
install_scripts.pyo
2891
0644
edit
dl
rm
launcher manifest.xml
628
0644
edit
dl
rm
py36compat.py
4986
0644
edit
dl
rm
py36compat.pyc
5550
0644
edit
dl
rm
py36compat.pyo
5550
0644
edit
dl
rm
register.py
270
0644
edit
dl
rm
register.pyc
710
0644
edit
dl
rm
register.pyo
710
0644
edit
dl
rm
rotate.py
2164
0644
edit
dl
rm
rotate.pyc
3036
0644
edit
dl
rm
rotate.pyo
3036
0644
edit
dl
rm
saveopts.py
658
0644
edit
dl
rm
saveopts.pyc
1129
0644
edit
dl
rm
saveopts.pyo
1129
0644
edit
dl
rm
sdist.py
6711
0644
edit
dl
rm
sdist.pyc
7823
0644
edit
dl
rm
sdist.pyo
7823
0644
edit
dl
rm
setopt.py
5085
0644
edit
dl
rm
setopt.pyc
6050
0644
edit
dl
rm
setopt.pyo
6050
0644
edit
dl
rm
test.py
9214
0644
edit
dl
rm
test.pyc
10468
0644
edit
dl
rm
test.pyo
10468
0644
edit
dl
rm
upload.py
1172
0644
edit
dl
rm
upload.pyc
1636
0644
edit
dl
rm
upload.pyo
1636
0644
edit
dl
rm
upload_docs.py
7311
0644
edit
dl
rm
upload_docs.pyc
7842
0644
edit
dl
rm
upload_docs.pyo
7813
0644
edit
dl
rm
__init__.py
594
0644
edit
dl
rm
__init__.pyc
882
0644
edit
dl
rm
__init__.pyo
882
0644
edit
dl
rm
Edit:
/usr/lib/python2.7/site-packages/setuptools/command/install_lib.py
(3840B)
import os import imp from itertools import product, starmap import distutils.command.install_lib as orig class install_lib(orig.install_lib): """Don't add compiled flags to filenames of non-Python files""" def run(self): self.build() outfiles = self.install() if outfiles is not None: # always compile, in case we have any extension stubs to deal with self.byte_compile(outfiles) def get_exclusions(self): """ Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. """ all_packages = ( pkg for ns_pkg in self._get_SVEM_NSPs() for pkg in self._all_packages(ns_pkg) ) excl_specs = product(all_packages, self._gen_exclusion_paths()) return set(starmap(self._exclude_pkg_path, excl_specs)) def _exclude_pkg_path(self, pkg, exclusion_path): """ Given a package name and exclusion path within that package, compute the full exclusion path. """ parts = pkg.split('.') + [exclusion_path] return os.path.join(self.install_dir, *parts) @staticmethod def _all_packages(pkg_name): """ >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] """ while pkg_name: yield pkg_name pkg_name, sep, child = pkg_name.rpartition('.') def _get_SVEM_NSPs(self): """ Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. """ # TODO: is it necessary to short-circuit here? i.e. what's the cost # if get_finalized_command is called even when namespace_packages is # False? if not self.distribution.namespace_packages: return [] install_cmd = self.get_finalized_command('install') svem = install_cmd.single_version_externally_managed return self.distribution.namespace_packages if svem else [] @staticmethod def _gen_exclusion_paths(): """ Generate file paths to be excluded for namespace packages (bytecode cache files). """ # always exclude the package module itself yield '__init__.py' yield '__init__.pyc' yield '__init__.pyo' if not hasattr(imp, 'get_tag'): return base = os.path.join('__pycache__', '__init__.' + imp.get_tag()) yield base + '.pyc' yield base + '.pyo' yield base + '.opt-1.pyc' yield base + '.opt-2.pyc' def copy_tree( self, infile, outfile, preserve_mode=1, preserve_times=1, preserve_symlinks=0, level=1 ): assert preserve_mode and preserve_times and not preserve_symlinks exclude = self.get_exclusions() if not exclude: return orig.install_lib.copy_tree(self, infile, outfile) # Exclude namespace package __init__.py* files from the output from setuptools.archive_util import unpack_directory from distutils import log outfiles = [] def pf(src, dst): if dst in exclude: log.warn("Skipping installation of %s (namespace package)", dst) return False log.info("copying %s -> %s", src, os.path.dirname(dst)) outfiles.append(dst) return dst unpack_directory(infile, outfile, pf) return outfiles def get_outputs(self): outputs = orig.install_lib.get_outputs(self) exclude = self.get_exclusions() if exclude: return [f for f in outputs if f not in exclude] return outputs
Save
cmd:
run