Hackfut Security File Manager
Current Path:
/opt/alt/python27/lib/python2.7/site-packages/setuptools/command
opt
/
alt
/
python27
/
lib
/
python2.7
/
site-packages
/
setuptools
/
command
/
📁
..
📄
__init__.py
(564 B)
📄
__init__.pyc
(858 B)
📄
__init__.pyo
(858 B)
📄
alias.py
(2.37 KB)
📄
alias.pyc
(3.11 KB)
📄
alias.pyo
(3.11 KB)
📄
bdist_egg.py
(16.78 KB)
📄
bdist_egg.pyc
(17.45 KB)
📄
bdist_egg.pyo
(17.45 KB)
📄
bdist_rpm.py
(1.47 KB)
📄
bdist_rpm.pyc
(1.92 KB)
📄
bdist_rpm.pyo
(1.92 KB)
📄
bdist_wininst.py
(637 B)
📄
bdist_wininst.pyc
(1.21 KB)
📄
bdist_wininst.pyo
(1.21 KB)
📄
build_ext.py
(11.68 KB)
📄
build_ext.pyc
(11.13 KB)
📄
build_ext.pyo
(11.09 KB)
📄
build_py.py
(7.8 KB)
📄
build_py.pyc
(9.07 KB)
📄
build_py.pyo
(9.07 KB)
📄
develop.py
(7.21 KB)
📄
develop.pyc
(7.27 KB)
📄
develop.pyo
(7.27 KB)
📄
easy_install.py
(84.06 KB)
📄
easy_install.pyc
(79.02 KB)
📄
easy_install.pyo
(79.02 KB)
📄
egg_info.py
(16.49 KB)
📄
egg_info.pyc
(20.35 KB)
📄
egg_info.pyo
(20.35 KB)
📄
install.py
(4.58 KB)
📄
install.pyc
(4.96 KB)
📄
install.pyo
(4.96 KB)
📄
install_egg_info.py
(3.94 KB)
📄
install_egg_info.pyc
(5.5 KB)
📄
install_egg_info.pyo
(5.5 KB)
📄
install_lib.py
(3.75 KB)
📄
install_lib.pyc
(4.91 KB)
📄
install_lib.pyo
(4.86 KB)
📄
install_scripts.py
(2.18 KB)
📄
install_scripts.pyc
(2.83 KB)
📄
install_scripts.pyo
(2.83 KB)
📄
register.py
(270 B)
📄
register.pyc
(749 B)
📄
register.pyo
(749 B)
📄
rotate.py
(1.99 KB)
📄
rotate.pyc
(2.94 KB)
📄
rotate.pyo
(2.94 KB)
📄
saveopts.py
(658 B)
📄
saveopts.pyc
(1.14 KB)
📄
saveopts.pyo
(1.14 KB)
📄
sdist.py
(6.88 KB)
📄
sdist.pyc
(6.77 KB)
📄
sdist.pyo
(6.77 KB)
📄
setopt.py
(4.97 KB)
📄
setopt.pyc
(6.04 KB)
📄
setopt.pyo
(6.04 KB)
📄
test.py
(6.73 KB)
📄
test.pyc
(7.74 KB)
📄
test.pyo
(7.74 KB)
📄
upload.py
(649 B)
📄
upload.pyc
(1.24 KB)
📄
upload.pyo
(1.24 KB)
📄
upload_docs.py
(6.66 KB)
📄
upload_docs.pyc
(6.96 KB)
📄
upload_docs.pyo
(6.94 KB)
Editing: test.py
from distutils.errors import DistutilsOptionError from unittest import TestLoader import sys from setuptools.extern import six from setuptools.extern.six.moves import map from pkg_resources import (resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, add_activation_listener, require, EntryPoint) from setuptools import Command from setuptools.py31compat import unittest_main class ScanningLoader(TestLoader): def loadTestsFromModule(self, module, pattern=None): """Return a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. """ tests = [] tests.append(TestLoader.loadTestsFromModule(self, module)) if hasattr(module, "additional_tests"): tests.append(module.additional_tests()) if hasattr(module, '__path__'): for file in resource_listdir(module.__name__, ''): if file.endswith('.py') and file != '__init__.py': submodule = module.__name__ + '.' + file[:-3] else: if resource_exists(module.__name__, file + '/__init__.py'): submodule = module.__name__ + '.' + file else: continue tests.append(self.loadTestsFromName(submodule)) if len(tests) != 1: return self.suiteClass(tests) else: return tests[0] # don't create a nested suite for only one return # adapted from jaraco.classes.properties:NonDataProperty class NonDataProperty(object): def __init__(self, fget): self.fget = fget def __get__(self, obj, objtype=None): if obj is None: return self return self.fget(obj) class test(Command): """Command to run unit tests after in-place build""" description = "run unit tests after in-place build" user_options = [ ('test-module=', 'm', "Run 'test_suite' in specified module"), ('test-suite=', 's', "Test suite to run (e.g. 'some_module.test_suite')"), ('test-runner=', 'r', "Test runner to use"), ] def initialize_options(self): self.test_suite = None self.test_module = None self.test_loader = None self.test_runner = None def finalize_options(self): if self.test_suite and self.test_module: msg = "You may specify a module or a suite, but not both" raise DistutilsOptionError(msg) if self.test_suite is None: if self.test_module is None: self.test_suite = self.distribution.test_suite else: self.test_suite = self.test_module + ".test_suite" if self.test_loader is None: self.test_loader = getattr(self.distribution, 'test_loader', None) if self.test_loader is None: self.test_loader = "setuptools.command.test:ScanningLoader" if self.test_runner is None: self.test_runner = getattr(self.distribution, 'test_runner', None) @NonDataProperty def test_args(self): return list(self._test_args()) def _test_args(self): if self.verbose: yield '--verbose' if self.test_suite: yield self.test_suite def with_project_on_sys_path(self, func): with_2to3 = six.PY3 and getattr(self.distribution, 'use_2to3', False) if with_2to3: # If we run 2to3 we can not do this inplace: # Ensure metadata is up-to-date self.reinitialize_command('build_py', inplace=0) self.run_command('build_py') bpy_cmd = self.get_finalized_command("build_py") build_path = normalize_path(bpy_cmd.build_lib) # Build extensions self.reinitialize_command('egg_info', egg_base=build_path) self.run_command('egg_info') self.reinitialize_command('build_ext', inplace=0) self.run_command('build_ext') else: # Without 2to3 inplace works fine: self.run_command('egg_info') # Build extensions in-place self.reinitialize_command('build_ext', inplace=1) self.run_command('build_ext') ei_cmd = self.get_finalized_command("egg_info") old_path = sys.path[:] old_modules = sys.modules.copy() try: sys.path.insert(0, normalize_path(ei_cmd.egg_base)) working_set.__init__() add_activation_listener(lambda dist: dist.activate()) require('%s==%s' % (ei_cmd.egg_name, ei_cmd.egg_version)) func() finally: sys.path[:] = old_path sys.modules.clear() sys.modules.update(old_modules) working_set.__init__() def run(self): if self.distribution.install_requires: self.distribution.fetch_build_eggs( self.distribution.install_requires) if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) cmd = ' '.join(self._argv) if self.dry_run: self.announce('skipping "%s" (dry run)' % cmd) else: self.announce('running "%s"' % cmd) self.with_project_on_sys_path(self.run_tests) def run_tests(self): # Purge modules under test from sys.modules. The test loader will # re-import them from the build location. Required when 2to3 is used # with namespace packages. if six.PY3 and getattr(self.distribution, 'use_2to3', False): module = self.test_suite.split('.')[0] if module in _namespace_packages: del_modules = [] if module in sys.modules: del_modules.append(module) module += '.' for name in sys.modules: if name.startswith(module): del_modules.append(name) list(map(sys.modules.__delitem__, del_modules)) unittest_main( None, None, self._argv, testLoader=self._resolve_as_ep(self.test_loader), testRunner=self._resolve_as_ep(self.test_runner), ) @property def _argv(self): return ['unittest'] + self.test_args @staticmethod def _resolve_as_ep(val): """ Load the indicated attribute value, called, as a as if it were specified as an entry point. """ if val is None: return parsed = EntryPoint.parse("x=" + val) return parsed.resolve()()
Upload File
Create Folder