Skip to content

Commit 4107355

Browse files
authored
Remove calls to AAP as it is not supported anymore (#249)
* Remove calls to AAP as it is not supported anymore * fix test * Add to requirements.txt
1 parent 27a2d1c commit 4107355

File tree

6 files changed

+16
-33
lines changed

6 files changed

+16
-33
lines changed

bin/check_existing_sample_ownership.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
import argparse
1818
import csv
1919

20+
from ebi_eva_common_pyutils.biosamples_communicators import WebinHALCommunicator
2021
from ebi_eva_common_pyutils.config import cfg
2122
from ebi_eva_common_pyutils.logger import logging_config as log_cfg
2223

23-
from eva_submission.biosample_submission.biosamples_submitters import AAPHALCommunicator
2424
from eva_submission.submission_config import load_config
2525
from eva_submission.xlsx.xlsx_parser_eva import EvaXlsxReader
2626

@@ -41,9 +41,10 @@ def main():
4141
# Load the config_file from default location
4242
load_config()
4343
metadata_reader = EvaXlsxReader(args.metadata_file)
44-
communicator = AAPHALCommunicator(cfg.query('biosamples', 'aap_url'), cfg.query('biosamples', 'bsd_url'),
45-
cfg.query('biosamples', 'username'), cfg.query('biosamples', 'password'),
46-
cfg.query('biosamples', 'domain'))
44+
communicator = WebinHALCommunicator(
45+
cfg.query('biosamples', 'webin_url'), cfg.query('biosamples', 'bsd_url'),
46+
cfg.query('biosamples', 'webin_username'), cfg.query('biosamples', 'webin_password')
47+
)
4748
with open(args.output, 'w') as open_ouptut:
4849
sample_attrs = ['accession', 'name', 'domain', 'webinSubmissionAccountId', 'status']
4950
writer = csv.DictWriter(open_ouptut, fieldnames=sample_attrs + ['owner'])

eva_submission/biosample_submission/biosamples_submitters.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from datetime import datetime, date
1818
from functools import lru_cache
1919

20-
from ebi_eva_common_pyutils.biosamples_communicators import AAPHALCommunicator, WebinHALCommunicator
20+
from ebi_eva_common_pyutils.biosamples_communicators import WebinHALCommunicator
2121
from ebi_eva_common_pyutils.config import cfg
2222
from ebi_eva_common_pyutils.logger import AppLogger
2323

@@ -267,27 +267,11 @@ class SampleSubmitter(AppLogger):
267267

268268
def __init__(self, submit_type):
269269
communicators = []
270-
271-
if 'override' in submit_type:
272-
assert len(submit_type) == 1, f'override can only be used as a single action'
273-
communicators.append(AAPHALCommunicator(
274-
cfg.query('biosamples', 'aap_url'), cfg.query('biosamples', 'bsd_url'),
275-
cfg.query('biosamples', 'aap_super_user'), cfg.query('biosamples', 'aap_super_password'),
276-
cfg.query('biosamples', 'aap_super_domain')
277-
))
278270
# If the config has the credential for using webin with BioSamples use webin first
279-
if cfg.query('biosamples', 'webin_url') and cfg.query('biosamples', 'webin_username') and \
280-
cfg.query('biosamples', 'webin_password'):
281-
communicators.append(WebinHALCommunicator(
282-
cfg.query('biosamples', 'webin_url'), cfg.query('biosamples', 'bsd_url'),
283-
cfg.query('biosamples', 'webin_username'), cfg.query('biosamples', 'webin_password')
284-
))
285-
communicators.append(AAPHALCommunicator(
286-
cfg.query('biosamples', 'aap_url'), cfg.query('biosamples', 'bsd_url'),
287-
cfg.query('biosamples', 'username'), cfg.query('biosamples', 'password'),
288-
cfg.query('biosamples', 'domain')
271+
communicators.append(WebinHALCommunicator(
272+
cfg.query('biosamples', 'webin_url'), cfg.query('biosamples', 'bsd_url'),
273+
cfg.query('biosamples', 'webin_username'), cfg.query('biosamples', 'webin_password')
289274
))
290-
291275
self.submitter = BioSamplesSubmitter(communicators, submit_type)
292276
self.sample_data = None
293277

eva_submission/xlsx/xlsx_validation.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import yaml
66
from cerberus import Validator
77
from ebi_eva_common_pyutils.assembly_utils import retrieve_genbank_assembly_accessions_from_ncbi
8-
from ebi_eva_common_pyutils.biosamples_communicators import AAPHALCommunicator
8+
from ebi_eva_common_pyutils.biosamples_communicators import WebinHALCommunicator
99
from ebi_eva_common_pyutils.config import cfg
1010
from ebi_eva_common_pyutils.logger import AppLogger
1111
from ebi_eva_common_pyutils.reference import NCBIAssembly
@@ -32,10 +32,9 @@ def __init__(self, metadata_file):
3232
self.metadata[worksheet] = self.reader._get_all_rows(worksheet)
3333

3434
self.error_list = []
35-
self.communicator = AAPHALCommunicator(
36-
cfg.query('biosamples', 'aap_url'), cfg.query('biosamples', 'bsd_url'),
37-
cfg.query('biosamples', 'username'), cfg.query('biosamples', 'password'),
38-
cfg.query('biosamples', 'domain')
35+
self.communicator = WebinHALCommunicator(
36+
cfg.query('biosamples', 'webin_url'), cfg.query('biosamples', 'bsd_url'),
37+
cfg.query('biosamples', 'webin_username'), cfg.query('biosamples', 'webin_password')
3938
)
4039

4140

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cached-property
22
cerberus
3-
ebi-eva-common-pyutils[eva-internal]>=0.6.17, ==0.*
3+
ebi-eva-common-pyutils[eva-internal]>=0.7.0, ==0.*
44
eva-vcf-merge>=0.0.8
55
eva_sub_cli>=0.4.6
66
humanize

tests/test_biosamples_submission.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88
import yaml
99

10-
from ebi_eva_common_pyutils.biosamples_communicators import AAPHALCommunicator, HALCommunicator, WebinHALCommunicator
10+
from ebi_eva_common_pyutils.biosamples_communicators import HALCommunicator, WebinHALCommunicator
1111

1212
from eva_submission import ROOT_DIR
1313
from eva_submission.biosample_submission import biosamples_submitters
@@ -56,7 +56,6 @@ def tearDown(self):
5656
'release': '2020-07-06T19:09:29.090Z'}
5757
]
5858

59-
# BioSamples does not support AAP login so we have to use credentials from Webin.
6059
@pytest.mark.skip(reason='You need to set a config file with correct Webin credential to run these test')
6160
class TestBSDSubmitter(BSDTestCase):
6261
"""

tests/test_vep_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def test_get_species_and_assembly(self):
153153

154154
def test_get_releases(self):
155155
with get_ftp_connection(ensembl_ftp_url) as ftp:
156-
assert get_releases(ftp, 'pub', current_only=True) == {113: 'pub/release-113'}
156+
assert get_releases(ftp, 'pub', current_only=True) == {115: 'pub/release-115'}
157157

158158
with get_ftp_connection(ensembl_genome_ftp_url) as ftp:
159159
assert get_releases(ftp, ensembl_genome_dirs[0], current_only=True) == {60: 'ensemblgenomes/pub/plants/release-60'}

0 commit comments

Comments
 (0)