ebi-eva-common-pyutils 0.6.3__tar.gz → 0.6.5__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.
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/CHANGELOG.md +11 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/PKG-INFO +10 -2
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/network_utils.py +8 -1
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils.egg-info/PKG-INFO +11 -3
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils.egg-info/SOURCES.txt +3 -1
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/mongodb/mongo_database.py +1 -3
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/setup.py +1 -1
- ebi_eva_common_pyutils-0.6.5/tests/test_common.py +22 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/LICENSE +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/MANIFEST.in +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/README.md +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/__init__.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/assembly/__init__.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/assembly/assembly.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/assembly_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/command_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/common_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/config.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/contig_alias/__init__.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/contig_alias/contig_alias.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/ena_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/file_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/logger.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/ncbi_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/reference/__init__.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/reference/assembly.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/reference/sequence.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/taxonomy/__init__.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/taxonomy/taxonomy.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/variation/__init__.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/variation/contig_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils.egg-info/dependency_links.txt +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils.egg-info/requires.txt +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils.egg-info/top_level.txt +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/__init__.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/archive_directory.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/config_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/metadata_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/mongo_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/mongodb/__init__.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/nextflow/__init__.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/nextflow/nextflow_pipeline.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/pg_utils.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/spring_properties.py +0 -0
- {ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/setup.cfg +0 -0
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
Changelog for ebi_eva_common_pyutils
|
|
3
3
|
===========================
|
|
4
4
|
|
|
5
|
+
## 0.6.5 (2024-04-02)
|
|
6
|
+
---------------------
|
|
7
|
+
|
|
8
|
+
- Ensure that the port forwarding command is running before returning the process.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## 0.6.4 (2024-03-21)
|
|
12
|
+
---------------------
|
|
13
|
+
|
|
14
|
+
- Update Mongodb client to use mongosh instead of the legacy mongo.
|
|
15
|
+
|
|
5
16
|
## 0.6.3 (2024-02-22)
|
|
6
17
|
---------------------
|
|
7
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ebi_eva_common_pyutils
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.5
|
|
4
4
|
Summary: EBI EVA - Common Python Utilities
|
|
5
5
|
Home-page: https://github.com/EBIVariation/eva-common-pyutils
|
|
6
6
|
License: Apache
|
|
@@ -10,5 +10,13 @@ Classifier: Intended Audience :: Developers
|
|
|
10
10
|
Classifier: Topic :: Software Development :: Build Tools
|
|
11
11
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Provides-Extra: eva-internal
|
|
14
13
|
License-File: LICENSE
|
|
14
|
+
Requires-Dist: requests
|
|
15
|
+
Requires-Dist: lxml
|
|
16
|
+
Requires-Dist: pyyaml
|
|
17
|
+
Requires-Dist: cached-property
|
|
18
|
+
Requires-Dist: retry
|
|
19
|
+
Provides-Extra: eva-internal
|
|
20
|
+
Requires-Dist: psycopg2-binary; extra == "eva-internal"
|
|
21
|
+
Requires-Dist: pymongo; extra == "eva-internal"
|
|
22
|
+
Requires-Dist: networkx<=2.5; extra == "eva-internal"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
|
|
14
|
+
import time
|
|
15
15
|
|
|
16
16
|
import requests
|
|
17
17
|
import subprocess
|
|
@@ -43,6 +43,13 @@ def forward_remote_port_to_local_port(remote_host: str, remote_port: int, local_
|
|
|
43
43
|
port_forward_command = 'ssh -N -L{0}:localhost:{1} {2}'.format(local_port, remote_port, remote_host)
|
|
44
44
|
logger.info("Forwarding port to local port using command: " + port_forward_command)
|
|
45
45
|
proc = subprocess.Popen(port_forward_command.split(" "))
|
|
46
|
+
time.sleep(5)
|
|
47
|
+
# Ensure that the process is still running
|
|
48
|
+
poll = proc.poll()
|
|
49
|
+
if poll is not None:
|
|
50
|
+
# The process already completed which mean it most likely crashed
|
|
51
|
+
logger.error(f'Port Forwarding {remote_host}:{remote_port} -> {local_port} failed!')
|
|
52
|
+
raise subprocess.CalledProcessError(proc.returncode, proc.args)
|
|
46
53
|
return proc.pid
|
|
47
54
|
|
|
48
55
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
|
-
Name:
|
|
3
|
-
Version: 0.6.
|
|
2
|
+
Name: ebi_eva_common_pyutils
|
|
3
|
+
Version: 0.6.5
|
|
4
4
|
Summary: EBI EVA - Common Python Utilities
|
|
5
5
|
Home-page: https://github.com/EBIVariation/eva-common-pyutils
|
|
6
6
|
License: Apache
|
|
@@ -10,5 +10,13 @@ Classifier: Intended Audience :: Developers
|
|
|
10
10
|
Classifier: Topic :: Software Development :: Build Tools
|
|
11
11
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Provides-Extra: eva-internal
|
|
14
13
|
License-File: LICENSE
|
|
14
|
+
Requires-Dist: requests
|
|
15
|
+
Requires-Dist: lxml
|
|
16
|
+
Requires-Dist: pyyaml
|
|
17
|
+
Requires-Dist: cached-property
|
|
18
|
+
Requires-Dist: retry
|
|
19
|
+
Provides-Extra: eva-internal
|
|
20
|
+
Requires-Dist: psycopg2-binary; extra == "eva-internal"
|
|
21
|
+
Requires-Dist: pymongo; extra == "eva-internal"
|
|
22
|
+
Requires-Dist: networkx<=2.5; extra == "eva-internal"
|
|
@@ -4,6 +4,7 @@ MANIFEST.in
|
|
|
4
4
|
README.md
|
|
5
5
|
setup.cfg
|
|
6
6
|
setup.py
|
|
7
|
+
/tmp/ebi_eva_common_pyutils-v0.6.5-999yjogj/gitclone/ebi_eva_internal_pyutils/archive_directory.py
|
|
7
8
|
ebi_eva_common_pyutils/__init__.py
|
|
8
9
|
ebi_eva_common_pyutils/assembly_utils.py
|
|
9
10
|
ebi_eva_common_pyutils/command_utils.py
|
|
@@ -40,4 +41,5 @@ ebi_eva_internal_pyutils/spring_properties.py
|
|
|
40
41
|
ebi_eva_internal_pyutils/mongodb/__init__.py
|
|
41
42
|
ebi_eva_internal_pyutils/mongodb/mongo_database.py
|
|
42
43
|
ebi_eva_internal_pyutils/nextflow/__init__.py
|
|
43
|
-
ebi_eva_internal_pyutils/nextflow/nextflow_pipeline.py
|
|
44
|
+
ebi_eva_internal_pyutils/nextflow/nextflow_pipeline.py
|
|
45
|
+
tests/test_common.py
|
|
@@ -111,9 +111,7 @@ class MongoDatabase(AppLogger):
|
|
|
111
111
|
shard_collection_command = f'sh.shardCollection(' \
|
|
112
112
|
f'"{self.db_name}.{collection_name}", ' \
|
|
113
113
|
f'{shard_key_repr}, {str(shard_key_uniqueness_flag).lower()})'
|
|
114
|
-
sharding_command = f"
|
|
115
|
-
f"--eval " \
|
|
116
|
-
f"'{shard_collection_command}' "
|
|
114
|
+
sharding_command = f"mongosh --eval '{shard_collection_command}' {self.uri} "
|
|
117
115
|
sharding_command += self._get_optional_secrets_file_stdin()
|
|
118
116
|
run_command_with_output(f"Sharding collection {collection_name} in the database {self.uri_with_db_name} "
|
|
119
117
|
f"with key {shard_key_repr}...", sharding_command,
|
|
@@ -7,7 +7,7 @@ setup(
|
|
|
7
7
|
name='ebi_eva_common_pyutils',
|
|
8
8
|
scripts=[os.path.join(os.path.dirname(__file__), 'ebi_eva_internal_pyutils', 'archive_directory.py')],
|
|
9
9
|
packages=find_packages(),
|
|
10
|
-
version='0.6.
|
|
10
|
+
version='0.6.5',
|
|
11
11
|
license='Apache',
|
|
12
12
|
description='EBI EVA - Common Python Utilities',
|
|
13
13
|
url='https://github.com/EBIVariation/eva-common-pyutils',
|
|
@@ -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']])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/common_utils.py
RENAMED
|
File without changes
|
{ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/ena_utils.py
RENAMED
|
File without changes
|
{ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/file_utils.py
RENAMED
|
File without changes
|
{ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/logger.py
RENAMED
|
File without changes
|
{ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_common_pyutils/ncbi_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ebi_eva_common_pyutils-0.6.3 → ebi_eva_common_pyutils-0.6.5}/ebi_eva_internal_pyutils/pg_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|