dcicutils 8.8.4.1b3__tar.gz → 8.8.4.1b4__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/PKG-INFO +4 -4
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/file_utils.py +10 -4
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/http_utils.py +5 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/misc_utils.py +16 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/zip_utils.py +5 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/pyproject.toml +6 -6
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/LICENSE.txt +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/README.rst +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/__init__.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/base.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/beanstalk_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/bundle_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/captured_output.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/cloudformation_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/codebuild_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/command_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/common.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/contribution_scripts.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/contribution_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/creds_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/data_readers.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/data_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/datetime_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/deployment_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/diff_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/docker_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/ecr_scripts.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/ecr_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/ecs_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/env_base.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/env_manager.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/env_scripts.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/env_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/env_utils_legacy.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/es_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/exceptions.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/ff_mocks.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/ff_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/function_cache_decorator.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/glacier_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/jh_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/kibana/dashboards.json +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/kibana/readme.md +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/lang_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/c4-infrastructure.jsonc +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/c4-python-infrastructure.jsonc +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/park-lab-common-server.jsonc +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/park-lab-common.jsonc +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/park-lab-gpl-pipeline.jsonc +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/park-lab-pipeline.jsonc +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/log_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/obfuscation_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/opensearch_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/portal_object_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/portal_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/progress_bar.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/project_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/qa_checkers.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/qa_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/redis_tools.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/redis_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/s3_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/schema_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/scripts/publish_to_pypi.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/scripts/run_license_checker.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/scripts/view_portal_object.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/secrets_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/sheet_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/snapshot_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/ssl_certificate_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/structured_data.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/submitr/progress_constants.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/submitr/ref_lookup_strategy.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/task_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/tmpfile_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/trace_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/validation_utils.py +0 -0
- {dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/variant_utils.py +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: dcicutils
|
3
|
-
Version: 8.8.4.
|
3
|
+
Version: 8.8.4.1b4
|
4
4
|
Summary: Utility package for interacting with the 4DN Data Portal and other 4DN resources
|
5
5
|
Home-page: https://github.com/4dn-dcic/utils
|
6
6
|
License: MIT
|
7
7
|
Author: 4DN-DCIC Team
|
8
8
|
Author-email: support@4dnucleome.org
|
9
|
-
Requires-Python: >=3.8,<3.
|
9
|
+
Requires-Python: >=3.8,<3.13
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
11
11
|
Classifier: Intended Audience :: Developers
|
12
12
|
Classifier: Intended Audience :: Science/Research
|
@@ -26,8 +26,8 @@ Requires-Dist: PyJWT (>=2.6.0,<3.0.0)
|
|
26
26
|
Requires-Dist: PyYAML (>=6.0.1,<7.0.0)
|
27
27
|
Requires-Dist: appdirs (>=1.4.4,<2.0.0)
|
28
28
|
Requires-Dist: aws-requests-auth (>=0.4.2,<1)
|
29
|
-
Requires-Dist: boto3 (>=1.
|
30
|
-
Requires-Dist: botocore (>=1.
|
29
|
+
Requires-Dist: boto3 (>=1.34.90,<2.0.0)
|
30
|
+
Requires-Dist: botocore (>=1.34.90,<2.0.0)
|
31
31
|
Requires-Dist: chardet (>=5.2.0,<6.0.0)
|
32
32
|
Requires-Dist: docker (>=4.4.4,<5.0.0)
|
33
33
|
Requires-Dist: elasticsearch (==7.13.4)
|
@@ -58,15 +58,21 @@ def search_for_file(file: str,
|
|
58
58
|
return None if single else []
|
59
59
|
|
60
60
|
|
61
|
-
def normalize_file_path(path: str,
|
61
|
+
def normalize_file_path(path: str, home_directory: bool = True) -> str:
|
62
|
+
"""
|
63
|
+
Normalizes the given file path name and returns. Does things like remove multiple
|
64
|
+
consecutive slashes and redundant/unnecessary parent paths; if the home_directory
|
65
|
+
argument is True (the default) then also handles the special tilde home directory
|
66
|
+
component/convention and uses this in the result if applicable.
|
67
|
+
"""
|
62
68
|
if not isinstance(path, str) or not path:
|
63
69
|
path = os.getcwd()
|
64
70
|
path = os.path.normpath(path)
|
65
|
-
home_directory = os.path.expanduser("~")
|
66
|
-
if path.startswith("~"):
|
71
|
+
home_directory = os.path.expanduser("~") if home_directory is True else None
|
72
|
+
if home_directory and path.startswith("~"):
|
67
73
|
path = os.path.join(home_directory, path[2 if path.startswith("~/") else 1:])
|
68
74
|
path = os.path.abspath(path)
|
69
|
-
if
|
75
|
+
if home_directory and (os.name == "posix"):
|
70
76
|
if path.startswith(home_directory) and path != home_directory:
|
71
77
|
path = "~/" + pathlib.Path(path).relative_to(home_directory).as_posix()
|
72
78
|
return path
|
@@ -6,6 +6,11 @@ from dcicutils.tmpfile_utils import temporary_file
|
|
6
6
|
|
7
7
|
@contextmanager
|
8
8
|
def download(url: str, suffix: Optional[str] = None, binary: bool = True) -> Optional[str]:
|
9
|
+
"""
|
10
|
+
Context manager to ownload the given URL into a temporary file and yields the file
|
11
|
+
path to it. An optional file suffix may be specified. Defaults to binary file mode;
|
12
|
+
if this is not desired then pass False as the binary argument.
|
13
|
+
"""
|
9
14
|
with temporary_file(suffix=suffix) as file:
|
10
15
|
response = requests.get(url, stream=True)
|
11
16
|
with open(file, "wb" if binary is True else "w") as f:
|
@@ -14,6 +14,7 @@ import json
|
|
14
14
|
import logging
|
15
15
|
import math
|
16
16
|
import os
|
17
|
+
import platform
|
17
18
|
import pytz
|
18
19
|
import re
|
19
20
|
import rfc3986.validators
|
@@ -2682,3 +2683,18 @@ def get_app_specific_directory() -> str:
|
|
2682
2683
|
N.B. This is has been tested on MacOS and Linux but not on Windows.
|
2683
2684
|
"""
|
2684
2685
|
return appdirs.user_data_dir()
|
2686
|
+
|
2687
|
+
|
2688
|
+
def get_os_name() -> str:
|
2689
|
+
if os_name := platform.system():
|
2690
|
+
if os_name == "Darwin": return "osx" # noqa
|
2691
|
+
elif os_name == "Linux": return "linux" # noqa
|
2692
|
+
elif os_name == "Windows": return "windows" # noqa
|
2693
|
+
return ""
|
2694
|
+
|
2695
|
+
|
2696
|
+
def get_cpu_architecture_name() -> str:
|
2697
|
+
if os_architecture_name := platform.machine():
|
2698
|
+
if os_architecture_name == "x86_64": return "amd64" # noqa
|
2699
|
+
return os_architecture_name
|
2700
|
+
return ""
|
@@ -51,6 +51,11 @@ def unpack_gz_file_to_temporary_file(file: str, suffix: Optional[str] = None) ->
|
|
51
51
|
|
52
52
|
def extract_file_from_zip(zip_file: str, file_to_extract: str,
|
53
53
|
destination_file: str, raise_exception: bool = True) -> bool:
|
54
|
+
"""
|
55
|
+
Extracts from the given zip file, the given file to extract, writing it to the
|
56
|
+
given destination file. Returns True if all is well, otherwise False, or if the
|
57
|
+
raise_exception argument is True (the default), then raises and exception on error.
|
58
|
+
"""
|
54
59
|
try:
|
55
60
|
if not (destination_directory := os.path.dirname(destination_file)):
|
56
61
|
destination_directory = os.getcwd()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "dcicutils"
|
3
|
-
version = "8.8.4.
|
3
|
+
version = "8.8.4.1b4" # TODO: To become 8.8.5
|
4
4
|
description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources"
|
5
5
|
authors = ["4DN-DCIC Team <support@4dnucleome.org>"]
|
6
6
|
license = "MIT"
|
@@ -37,9 +37,9 @@ classifiers = [
|
|
37
37
|
|
38
38
|
|
39
39
|
[tool.poetry.dependencies]
|
40
|
-
python = ">=3.8,<3.
|
41
|
-
boto3 = "^1.
|
42
|
-
botocore = "^1.
|
40
|
+
python = ">=3.8,<3.13"
|
41
|
+
boto3 = "^1.34.90"
|
42
|
+
botocore = "^1.34.90"
|
43
43
|
# The DCIC portals (cgap-portal and fourfront) are very particular about which ElasticSearch version.
|
44
44
|
# This value is intentionally pinned and must not be changed casually.
|
45
45
|
elasticsearch = "7.13.4"
|
@@ -70,8 +70,8 @@ webtest = "^2.0.34"
|
|
70
70
|
|
71
71
|
|
72
72
|
[tool.poetry.dev-dependencies]
|
73
|
-
boto3-stubs = "^1.
|
74
|
-
botocore-stubs = "^1.
|
73
|
+
boto3-stubs = "^1.34.90"
|
74
|
+
botocore-stubs = "^1.34.90"
|
75
75
|
coverage = ">=7.2.3"
|
76
76
|
# Loaded manually in GA workflow for coverage because a dependency on 2to3
|
77
77
|
# in its docopts dependency makes a problem for laoding it here in poetry. -kmp 7-Apr-2023
|
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
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/c4-infrastructure.jsonc
RENAMED
File without changes
|
File without changes
|
{dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/park-lab-common-server.jsonc
RENAMED
File without changes
|
{dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/park-lab-common.jsonc
RENAMED
File without changes
|
{dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/park-lab-gpl-pipeline.jsonc
RENAMED
File without changes
|
{dcicutils-8.8.4.1b3 → dcicutils-8.8.4.1b4}/dcicutils/license_policies/park-lab-pipeline.jsonc
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|