From 8b0247e17f050023de24b7102da5b5318ab30e65 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 13 Mar 2014 19:01:15 -0700 Subject: [PATCH] Move the installer thing --- pre_commit/installer/__init__.py | 0 pre_commit/{installer => }/repo_installer.py | 4 +++- tests/installer/__init__.py | 0 tests/{installer => }/repo_installer_test.py | 7 ++++--- 4 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 pre_commit/installer/__init__.py rename pre_commit/{installer => }/repo_installer.py (89%) delete mode 100644 tests/installer/__init__.py rename tests/{installer => }/repo_installer_test.py (92%) diff --git a/pre_commit/installer/__init__.py b/pre_commit/installer/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/pre_commit/installer/repo_installer.py b/pre_commit/repo_installer.py similarity index 89% rename from pre_commit/installer/repo_installer.py rename to pre_commit/repo_installer.py index c8695b1a..322950a0 100644 --- a/pre_commit/installer/repo_installer.py +++ b/pre_commit/repo_installer.py @@ -3,8 +3,8 @@ import contextlib from plumbum import local from pre_commit import git -class RepoInstaller(object): +class RepoInstaller(object): def __init__(self, git_repo_path, sha): self.git_repo_path = git_repo_path self.sha = sha @@ -28,6 +28,8 @@ class RepoInstaller(object): local['git']['checkout', self.sha]() def install(self): + # TODO: need to take in the config here and determine if we actually + # need to run any installers (and what languages to install) with self.in_checkout(): if local.path('setup.py').exists(): local['virtualenv']['py_env']() diff --git a/tests/installer/__init__.py b/tests/installer/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/installer/repo_installer_test.py b/tests/repo_installer_test.py similarity index 92% rename from tests/installer/repo_installer_test.py rename to tests/repo_installer_test.py index e323b084..00ad5b81 100644 --- a/tests/installer/repo_installer_test.py +++ b/tests/repo_installer_test.py @@ -1,12 +1,13 @@ +import os + import jsonschema import pytest -import os from plumbum import local import pre_commit.constants as C from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA -from pre_commit.installer.repo_installer import create_repo_in_env -from pre_commit.installer.repo_installer import install_pre_commit +from pre_commit.repo_installer import create_repo_in_env +from pre_commit.repo_installer import install_pre_commit def get_sha(git_repo):