ebi-eva-common-pyutils 0.7.3__tar.gz → 0.7.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/CHANGELOG.md +7 -0
  2. ebi_eva_common_pyutils-0.7.4/PKG-INFO +30 -0
  3. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/biosamples_communicators.py +13 -3
  4. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/config.py +2 -3
  5. ebi_eva_common_pyutils-0.7.4/ebi_eva_common_pyutils.egg-info/PKG-INFO +30 -0
  6. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils.egg-info/SOURCES.txt +3 -1
  7. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils.egg-info/requires.txt +1 -1
  8. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/setup.py +2 -2
  9. ebi_eva_common_pyutils-0.7.4/tests/test_common.py +22 -0
  10. ebi_eva_common_pyutils-0.7.3/PKG-INFO +0 -14
  11. ebi_eva_common_pyutils-0.7.3/ebi_eva_common_pyutils.egg-info/PKG-INFO +0 -14
  12. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/LICENSE +0 -0
  13. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/MANIFEST.in +0 -0
  14. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/README.md +0 -0
  15. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/__init__.py +0 -0
  16. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/assembly/__init__.py +0 -0
  17. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/assembly/assembly.py +0 -0
  18. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/assembly_utils.py +0 -0
  19. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/command_utils.py +0 -0
  20. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/common_utils.py +0 -0
  21. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/contig_alias/__init__.py +0 -0
  22. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/contig_alias/contig_alias.py +0 -0
  23. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/ena_utils.py +0 -0
  24. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/file_utils.py +0 -0
  25. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/logger.py +0 -0
  26. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/ncbi_utils.py +0 -0
  27. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/network_utils.py +0 -0
  28. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/reference/__init__.py +0 -0
  29. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/reference/assembly.py +0 -0
  30. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/reference/sequence.py +0 -0
  31. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/spreadsheet/__init__.py +0 -0
  32. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/spreadsheet/metadata_xlsx_utils.py +0 -0
  33. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/taxonomy/__init__.py +0 -0
  34. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/taxonomy/taxonomy.py +0 -0
  35. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/variation/__init__.py +0 -0
  36. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils/variation/contig_utils.py +0 -0
  37. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils.egg-info/dependency_links.txt +0 -0
  38. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_common_pyutils.egg-info/top_level.txt +0 -0
  39. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/__init__.py +0 -0
  40. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/archive_directory.py +0 -0
  41. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/config_utils.py +0 -0
  42. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/metadata_utils.py +0 -0
  43. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/mongo_utils.py +0 -0
  44. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/mongodb/__init__.py +0 -0
  45. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/mongodb/mongo_database.py +0 -0
  46. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/nextflow/__init__.py +0 -0
  47. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/nextflow/nextflow_pipeline.py +0 -0
  48. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/pg_utils.py +0 -0
  49. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/ebi_eva_internal_pyutils/spring_properties.py +0 -0
  50. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/requirements.txt +0 -0
  51. {ebi_eva_common_pyutils-0.7.3 → ebi_eva_common_pyutils-0.7.4}/setup.cfg +0 -0
@@ -2,6 +2,13 @@
2
2
  Changelog for ebi_eva_common_pyutils
3
3
  ===========================
4
4
 
5
+ ## 0.7.4 (2025-08-07)
6
+ ---------------------
7
+
8
+ - Prevent multiple configs from sharing the same content
9
+ - Update biosamples communicator to not retry 404s
10
+
11
+
5
12
  ## 0.7.3 (2025-06-19)
6
13
  ---------------------
7
14
 
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.2
2
+ Name: ebi_eva_common_pyutils
3
+ Version: 0.7.4
4
+ Summary: EBI EVA - Common Python Utilities
5
+ Home-page: https://github.com/EBIVariation/eva-common-pyutils
6
+ License: Apache
7
+ Keywords: EBI,EVA,PYTHON,UTILITIES
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Build Tools
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ License-File: LICENSE
14
+ Requires-Dist: requests==2.*
15
+ Requires-Dist: lxml==5.*
16
+ Requires-Dist: pyyaml==6.*
17
+ Requires-Dist: cached-property==1.5.*
18
+ Requires-Dist: retry==0.*,>0.9
19
+ Requires-Dist: openpyxl==3.*
20
+ Provides-Extra: eva-internal
21
+ Requires-Dist: psycopg2-binary; extra == "eva-internal"
22
+ Requires-Dist: pymongo<=3.12; extra == "eva-internal"
23
+ Requires-Dist: networkx<=2.5; extra == "eva-internal"
24
+ Dynamic: classifier
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: license
28
+ Dynamic: provides-extra
29
+ Dynamic: requires-dist
30
+ Dynamic: summary
@@ -25,11 +25,18 @@ class HALNotReadyError(Exception):
25
25
  pass
26
26
 
27
27
 
28
+ # Extends ValueError so clients can still expect ValueErrors to be raised on failed requests,
29
+ # but we have a more specific class internally to know when to retry.
30
+ class HttpErrorRetry(ValueError):
31
+ pass
32
+
33
+
28
34
  class HALCommunicator(AppLogger):
29
35
  """
30
36
  This class helps navigate through REST API that uses the HAL standard.
31
37
  """
32
38
  acceptable_code = [200, 201]
39
+ no_retry_code = [404]
33
40
 
34
41
  def __init__(self, auth_url, bsd_url, username, password):
35
42
  self.auth_url = auth_url
@@ -43,9 +50,12 @@ class HALCommunicator(AppLogger):
43
50
  self.error(response.request.method + ': ' + response.request.url + " with " + str(response.request.body))
44
51
  self.error("headers: {}".format(response.request.headers))
45
52
  self.error("<{}>: {}".format(response.status_code, response.text))
46
- raise ValueError('The HTTP status code ({}) is not one of the acceptable codes ({})'.format(
53
+ error_msg = 'The HTTP status code ({}) is not one of the acceptable codes ({})'.format(
47
54
  str(response.status_code), str(self.acceptable_code))
48
- )
55
+ if response.status_code in self.no_retry_code:
56
+ raise ValueError(error_msg)
57
+ else:
58
+ raise HttpErrorRetry(error_msg)
49
59
  return response
50
60
 
51
61
  @cached_property
@@ -55,7 +65,7 @@ class HALCommunicator(AppLogger):
55
65
  self._validate_response(response)
56
66
  return response.text
57
67
 
58
- @retry(exceptions=(ValueError, requests.RequestException), tries=3, delay=2, backoff=1.2, jitter=(1, 3))
68
+ @retry(exceptions=(HttpErrorRetry, requests.RequestException), tries=3, delay=2, backoff=1.2, jitter=(1, 3))
59
69
  def _req(self, method, url, **kwargs):
60
70
  """Private method that sends a request using the specified method. It adds the headers required by bsd"""
61
71
  headers = kwargs.pop('headers', {})
@@ -11,10 +11,9 @@ class Configuration:
11
11
  Configuration class that allow to load a yaml file either at construction or later in the execution.
12
12
  It can be used like a dict but should be used as readonly.
13
13
  """
14
- config_file = None
15
- content = {}
16
-
17
14
  def __init__(self, *search_path):
15
+ self.config_file = None
16
+ self.content = {}
18
17
  if search_path:
19
18
  self.load_config_file(*search_path)
20
19
 
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.2
2
+ Name: ebi_eva_common_pyutils
3
+ Version: 0.7.4
4
+ Summary: EBI EVA - Common Python Utilities
5
+ Home-page: https://github.com/EBIVariation/eva-common-pyutils
6
+ License: Apache
7
+ Keywords: EBI,EVA,PYTHON,UTILITIES
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Build Tools
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ License-File: LICENSE
14
+ Requires-Dist: requests==2.*
15
+ Requires-Dist: lxml==5.*
16
+ Requires-Dist: pyyaml==6.*
17
+ Requires-Dist: cached-property==1.5.*
18
+ Requires-Dist: retry==0.*,>0.9
19
+ Requires-Dist: openpyxl==3.*
20
+ Provides-Extra: eva-internal
21
+ Requires-Dist: psycopg2-binary; extra == "eva-internal"
22
+ Requires-Dist: pymongo<=3.12; extra == "eva-internal"
23
+ Requires-Dist: networkx<=2.5; extra == "eva-internal"
24
+ Dynamic: classifier
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: license
28
+ Dynamic: provides-extra
29
+ Dynamic: requires-dist
30
+ Dynamic: summary
@@ -5,6 +5,7 @@ README.md
5
5
  requirements.txt
6
6
  setup.cfg
7
7
  setup.py
8
+ /tmp/ebi_eva_common_pyutils-v0.7.4-_d3almln/gitclone/ebi_eva_internal_pyutils/archive_directory.py
8
9
  ebi_eva_common_pyutils/__init__.py
9
10
  ebi_eva_common_pyutils/assembly_utils.py
10
11
  ebi_eva_common_pyutils/biosamples_communicators.py
@@ -44,4 +45,5 @@ ebi_eva_internal_pyutils/spring_properties.py
44
45
  ebi_eva_internal_pyutils/mongodb/__init__.py
45
46
  ebi_eva_internal_pyutils/mongodb/mongo_database.py
46
47
  ebi_eva_internal_pyutils/nextflow/__init__.py
47
- ebi_eva_internal_pyutils/nextflow/nextflow_pipeline.py
48
+ ebi_eva_internal_pyutils/nextflow/nextflow_pipeline.py
49
+ tests/test_common.py
@@ -7,5 +7,5 @@ openpyxl==3.*
7
7
 
8
8
  [eva-internal]
9
9
  psycopg2-binary
10
- pymongo
10
+ pymongo<=3.12
11
11
  networkx<=2.5
@@ -11,13 +11,13 @@ setup(
11
11
  name='ebi_eva_common_pyutils',
12
12
  scripts=[os.path.join(os.path.dirname(__file__), 'ebi_eva_internal_pyutils', 'archive_directory.py')],
13
13
  packages=find_packages(),
14
- version='0.7.3',
14
+ version='0.7.4',
15
15
  license='Apache',
16
16
  description='EBI EVA - Common Python Utilities',
17
17
  url='https://github.com/EBIVariation/eva-common-pyutils',
18
18
  keywords=['EBI', 'EVA', 'PYTHON', 'UTILITIES'],
19
19
  install_requires=requirements,
20
- extras_require={'eva-internal': ['psycopg2-binary', 'pymongo', 'networkx<=2.5']},
20
+ extras_require={'eva-internal': ['psycopg2-binary', 'pymongo<=3.12', 'networkx<=2.5']},
21
21
  classifiers=[
22
22
  'Development Status :: 5 - Production/Stable',
23
23
  'Intended Audience :: Developers',
@@ -0,0 +1,22 @@
1
+ import os
2
+ from unittest import TestCase
3
+
4
+ from ebi_eva_common_pyutils.common_utils import merge_two_dicts, pretty_print
5
+
6
+
7
+ class TestCommon(TestCase):
8
+
9
+ resources_folder = os.path.join(os.path.dirname(__file__), 'resources')
10
+
11
+
12
+ class TestCommonUtils(TestCase):
13
+
14
+ def test_merge_two_dicts(self):
15
+ d1 = {'a': 1, 'b': 2, 'c': 3}
16
+ d2 = {'d': 4, 'a': 5, 'e': 6}
17
+ assert merge_two_dicts(d1, d2) == {'a': 5, 'b': 2, 'c': 3, 'd': 4, 'e': 6}
18
+ assert merge_two_dicts(d2, d1) == {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 6}
19
+
20
+ def test_pretty_print(self):
21
+ pretty_print(['Header 1', 'Long Header 2'],
22
+ [['row1 cell 1', 'row1 cell 2'], ['row2 cell 1', 'Super long row2 cell 2']])
@@ -1,14 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: ebi_eva_common_pyutils
3
- Version: 0.7.3
4
- Summary: EBI EVA - Common Python Utilities
5
- Home-page: https://github.com/EBIVariation/eva-common-pyutils
6
- License: Apache
7
- Keywords: EBI,EVA,PYTHON,UTILITIES
8
- Classifier: Development Status :: 5 - Production/Stable
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Topic :: Software Development :: Build Tools
11
- Classifier: License :: OSI Approved :: Apache Software License
12
- Classifier: Programming Language :: Python :: 3
13
- Provides-Extra: eva-internal
14
- License-File: LICENSE
@@ -1,14 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: ebi-eva-common-pyutils
3
- Version: 0.7.3
4
- Summary: EBI EVA - Common Python Utilities
5
- Home-page: https://github.com/EBIVariation/eva-common-pyutils
6
- License: Apache
7
- Keywords: EBI,EVA,PYTHON,UTILITIES
8
- Classifier: Development Status :: 5 - Production/Stable
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Topic :: Software Development :: Build Tools
11
- Classifier: License :: OSI Approved :: Apache Software License
12
- Classifier: Programming Language :: Python :: 3
13
- Provides-Extra: eva-internal
14
- License-File: LICENSE