Skip to content

Commit 6996f06

Browse files
authored
Merge pull request #34 from macarthur-lab/fix_pip_install_calls
replace pip.main(..) with os.system('pip install ..') calls
2 parents 979952a + 0813eaf commit 6996f06

9 files changed

+26
-33
lines changed

create_snapshot.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import pip
1+
import os
2+
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10
23

34
from utils.elasticsearch_client import ElasticsearchClient
4-
5-
pip.main(['install', 'elasticsearch'])
6-
75
import argparse
86
import elasticsearch
97
import logging
10-
import os
118
from pprint import pprint
129
import time
1310

entire_vds_pipeline.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env python
22

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

79
import argparse
810
import json

list_repositories.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import pip
2-
3-
pip.main(['install', 'elasticsearch'])
1+
import os
2+
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10
43

54
import argparse
65
import elasticsearch

print_elasticsearch_stats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import argparse
2-
import pip
3-
pip.main(['install', 'elasticsearch'])
1+
import os
2+
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10
43

4+
import argparse
55
from utils.elasticsearch_client import ElasticsearchClient
66

77
p = argparse.ArgumentParser()

print_snapshot_status.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import pip
2-
3-
pip.main(['install', 'elasticsearch'])
1+
import os
2+
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10
43

54
import argparse
65
import elasticsearch

register_snapshot_repository.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import pip
2-
3-
pip.main(['install', 'elasticsearch'])
1+
import os
2+
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10
43

54
import argparse
65
import elasticsearch

restore_snapshot.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import pip
2-
3-
pip.main(['install', 'elasticsearch'])
1+
import os
2+
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10
43

54
import argparse
65
import elasticsearch

utils/elasticsearch_client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# make sure elasticsearch is installed
2+
import os
3+
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10
4+
15
import logging
26

37
from utils.elasticsearch_utils import DEFAULT_GENOTYPE_FIELDS_TO_EXPORT, \
@@ -6,11 +10,6 @@
610
ELASTICSEARCH_CREATE, ELASTICSEARCH_UPDATE, ELASTICSEARCH_UPSERT
711

812
handlers = set(logging.root.handlers)
9-
10-
# make sure elasticsearch is installed
11-
import pip
12-
pip.main(['install', 'elasticsearch'])
13-
1413
logging.root.handlers = list(handlers)
1514

1615
import elasticsearch

utils/elasticsearch_utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
# make sure elasticsearch is installed
2+
import os
3+
os.system("pip install elasticsearch") # this used to be `import pip; pip.main(['install', 'elasticsearch']);`, but pip.main is deprecated as of pip v10
4+
15
import logging
26

37
handlers = set(logging.root.handlers)
4-
5-
# make sure elasticsearch is installed
6-
import pip
7-
pip.main(['install', 'elasticsearch'])
8-
98
logging.root.handlers = list(handlers)
109

1110
import collections

0 commit comments

Comments
 (0)