Skip to content

Commit

Permalink
Merge pull request #34 from macarthur-lab/fix_pip_install_calls
Browse files Browse the repository at this point in the history
replace pip.main(..) with os.system('pip install ..') calls
  • Loading branch information
bw2 authored Apr 2, 2018
2 parents 979952a + 0813eaf commit 6996f06
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 33 deletions.
7 changes: 2 additions & 5 deletions create_snapshot.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import pip
import os
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10

from utils.elasticsearch_client import ElasticsearchClient

pip.main(['install', 'elasticsearch'])

import argparse
import elasticsearch
import logging
import os
from pprint import pprint
import time

Expand Down
8 changes: 5 additions & 3 deletions entire_vds_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env python

import pip
for dependency in ['six==1.10.0', 'elasticsearch==5.4.0', 'requests==2.13.0']:
pip.main(['install', dependency])
#for dependency in ['six==1.10.0', 'elasticsearch', 'requests']:
# pip.main(['install', dependency])
# make sure elasticsearch is installed
#import os
#os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10

import argparse
import json
Expand Down
5 changes: 2 additions & 3 deletions list_repositories.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pip

pip.main(['install', 'elasticsearch'])
import os
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10

import argparse
import elasticsearch
Expand Down
6 changes: 3 additions & 3 deletions print_elasticsearch_stats.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
import pip
pip.main(['install', 'elasticsearch'])
import os
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10

import argparse
from utils.elasticsearch_client import ElasticsearchClient

p = argparse.ArgumentParser()
Expand Down
5 changes: 2 additions & 3 deletions print_snapshot_status.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pip

pip.main(['install', 'elasticsearch'])
import os
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10

import argparse
import elasticsearch
Expand Down
5 changes: 2 additions & 3 deletions register_snapshot_repository.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pip

pip.main(['install', 'elasticsearch'])
import os
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10

import argparse
import elasticsearch
Expand Down
5 changes: 2 additions & 3 deletions restore_snapshot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pip

pip.main(['install', 'elasticsearch'])
import os
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10

import argparse
import elasticsearch
Expand Down
9 changes: 4 additions & 5 deletions utils/elasticsearch_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# make sure elasticsearch is installed
import os
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10

import logging

from utils.elasticsearch_utils import DEFAULT_GENOTYPE_FIELDS_TO_EXPORT, \
Expand All @@ -6,11 +10,6 @@
ELASTICSEARCH_CREATE, ELASTICSEARCH_UPDATE, ELASTICSEARCH_UPSERT

handlers = set(logging.root.handlers)

# make sure elasticsearch is installed
import pip
pip.main(['install', 'elasticsearch'])

logging.root.handlers = list(handlers)

import elasticsearch
Expand Down
9 changes: 4 additions & 5 deletions utils/elasticsearch_utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# make sure elasticsearch is installed
import os
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10

import logging

handlers = set(logging.root.handlers)

# make sure elasticsearch is installed
import pip
pip.main(['install', 'elasticsearch'])

logging.root.handlers = list(handlers)

import collections
Expand Down

0 comments on commit 6996f06

Please sign in to comment.