mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Move the installer thing
This commit is contained in:
parent
95d9e29996
commit
8b0247e17f
4 changed files with 7 additions and 4 deletions
|
|
@ -3,8 +3,8 @@ import contextlib
|
||||||
from plumbum import local
|
from plumbum import local
|
||||||
from pre_commit import git
|
from pre_commit import git
|
||||||
|
|
||||||
class RepoInstaller(object):
|
|
||||||
|
|
||||||
|
class RepoInstaller(object):
|
||||||
def __init__(self, git_repo_path, sha):
|
def __init__(self, git_repo_path, sha):
|
||||||
self.git_repo_path = git_repo_path
|
self.git_repo_path = git_repo_path
|
||||||
self.sha = sha
|
self.sha = sha
|
||||||
|
|
@ -28,6 +28,8 @@ class RepoInstaller(object):
|
||||||
local['git']['checkout', self.sha]()
|
local['git']['checkout', self.sha]()
|
||||||
|
|
||||||
def install(self):
|
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():
|
with self.in_checkout():
|
||||||
if local.path('setup.py').exists():
|
if local.path('setup.py').exists():
|
||||||
local['virtualenv']['py_env']()
|
local['virtualenv']['py_env']()
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
|
import os
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import pytest
|
import pytest
|
||||||
import os
|
|
||||||
from plumbum import local
|
from plumbum import local
|
||||||
|
|
||||||
import pre_commit.constants as C
|
import pre_commit.constants as C
|
||||||
from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA
|
from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA
|
||||||
from pre_commit.installer.repo_installer import create_repo_in_env
|
from pre_commit.repo_installer import create_repo_in_env
|
||||||
from pre_commit.installer.repo_installer import install_pre_commit
|
from pre_commit.repo_installer import install_pre_commit
|
||||||
|
|
||||||
|
|
||||||
def get_sha(git_repo):
|
def get_sha(git_repo):
|
||||||
Loading…
Add table
Add a link
Reference in a new issue