diff --git a/ciscripts/bootstrap.py b/ciscripts/bootstrap.py index 9ac8e99..ca6a337 100755 --- a/ciscripts/bootstrap.py +++ b/ciscripts/bootstrap.py @@ -677,7 +677,7 @@ def fetch_script(self, script_path, domain="raw.githubusercontent.com", urlpath=_GITHUB_URLPATH): - """Wrapper for _fetch_script, returns a FetchedModule.""" + """Return a FetchedModule after fetching a script.""" info = self.script_path(script_path) _fetch_script(info, script_path, domain, urlpath) return info diff --git a/ciscripts/check/python/check.py b/ciscripts/check/python/check.py index feb509e..98e977f 100644 --- a/ciscripts/check/python/check.py +++ b/ciscripts/check/python/check.py @@ -13,7 +13,7 @@ def style_guide_exclusions(lint_exclude): - """A tuple of (suppressions, exclusions). + """Return a tuple of (suppressions, exclusions). suppressions refers to patterns in source code that shouldn't trigger any warnings from polysquare-generic-file-linter. diff --git a/ciscripts/parse_setup.py b/ciscripts/parse_setup.py index 64cd152..4b3174a 100644 --- a/ciscripts/parse_setup.py +++ b/ciscripts/parse_setup.py @@ -27,7 +27,7 @@ def patched_setuptools(): import setuptools def setup_hook(*args, **kwargs): - """Hook the setup function and log its arguments.""" + """Override the setup function and log its arguments.""" del args setuptools_arguments.update(kwargs) diff --git a/ciscripts/setup/project/configure_ruby.py b/ciscripts/setup/project/configure_ruby.py index 5e720f9..b8bd889 100644 --- a/ciscripts/setup/project/configure_ruby.py +++ b/ciscripts/setup/project/configure_ruby.py @@ -184,7 +184,7 @@ def ruby_build_strategy(container, def is_running_ubuntu_wily(): - """True if running on Ubuntu 15.04.""" + """Return true if running on Ubuntu 15.04.""" if os.path.exists("/etc/lsb-release"): with open("/etc/lsb-release") as release_file: release_keys = {l.split("=")[0]: l.split("=")[1].strip() diff --git a/ciscripts/setup/python/setup.py b/ciscripts/setup/python/setup.py index 6718a1a..c25d8b6 100644 --- a/ciscripts/setup/python/setup.py +++ b/ciscripts/setup/python/setup.py @@ -57,6 +57,11 @@ def run(cont, util, shell, argv=None): py_util.pip_install(cont, util, "polysquare-setuptools-lint>=0.0.50") + py_util.pip_install(cont, + util, + "git+git://github.com/smspillaz/prospector" + "@support-pydocstyle-2.0.0-windows-support" + "#egg=prospector") with util.Task("""Installing python test runners"""): _install_test_dependencies(cont, diff --git a/ciscripts/util.py b/ciscripts/util.py index 9818748..9cc2a8a 100644 --- a/ciscripts/util.py +++ b/ciscripts/util.py @@ -60,9 +60,9 @@ def language_version(language): return _PREFERRED_VERSIONS[language] -def override_preferred_version(language, platform, version): +def override_preferred_version(language, platform_name, version): """Override the preferred language version for the given platform.""" - _PREFERRED_VERSIONS[language][platform] = version + _PREFERRED_VERSIONS[language][platform_name] = version PRINT_MESSAGES_TO = None @@ -405,8 +405,7 @@ def reader(handle, input_queue): def long_running_suppressed_output(dot_timeout=10): """Print dots in a separate thread until our process is done.""" - def strategy(process, outputs): - """Partially applied strategy to be passed to execute.""" + def _strategy(process, outputs): status = _maybe_use_running_output(process, outputs) if status is not None: return status @@ -434,7 +433,7 @@ def print_dots(status_queue): return status - return strategy + return _strategy @contextmanager @@ -544,7 +543,7 @@ def force_remove_tree(directory): def execute(container, output_strategy, *args, **kwargs): - """A thin wrapper around subprocess.Popen. + """Execute a command, buffering its output in the configured manner. This class encapsulates a single command. The first argument to the constructor specifies how this command's output should be handled @@ -604,7 +603,7 @@ def execute(container, output_strategy, *args, **kwargs): def which(executable): """Full path to executable.""" def is_executable(path): - """True if path exists and is executable.""" + """Return true if path exists and is executable.""" return (os.path.exists(path) and not os.path.isdir(path) and os.access(path, os.F_OK | os.X_OK)) diff --git a/requirements.txt b/requirements.txt index 772e0ec..6810fe3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ setuptools-green<=0.1.0 six==1.10.0 testtools==1.7.1 polysquare-setuptools-lint<=0.1.0 +git+git://github.com/smspillaz/prospector@support-pydocstyle-2.0.0-windows-support#egg=prospector \ No newline at end of file diff --git a/test/test_bootstrap.py b/test/test_bootstrap.py index b24648a..1adf452 100644 --- a/test/test_bootstrap.py +++ b/test/test_bootstrap.py @@ -86,7 +86,7 @@ def write_bootstrap_script_into_container(directory_name): @contextmanager def removable_container_dir(directory_name): - """A contextmanager which deletes a container when the test is complete.""" + """Delete a container when the test is complete.""" current_cwd = os.getcwd() printer = bootstrap.escaped_printer_with_character("\\") shell = bootstrap.BashParentEnvironment(printer) diff --git a/test/testutil.py b/test/testutil.py index 0018709..ecb7b2a 100644 --- a/test/testutil.py +++ b/test/testutil.py @@ -390,7 +390,7 @@ def _copytree_ignore_notfound(src, dst): def copy_scripts_to_directory(target): - """Utility method to copy CI script to current directory. + """Copy CI script to current directory. They will be located at /ciscripts/. """ @@ -467,7 +467,7 @@ def in_parent_context(self, command): @classmethod def setup_script(cls): - """Setup script for this acceptance test fixture.""" + """Fetch setup script for this acceptance test fixture.""" return "setup/cmake/setup.py" @classmethod