dcor-shared 0.11.2__tar.gz → 0.11.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.
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/.github/workflows/check.yml +2 -2
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/.github/workflows/deploy_pypi.yml +2 -2
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/CHANGELOG +7 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/PKG-INFO +1 -1
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/_version.py +2 -2
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/data.py +5 -12
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/s3.py +1 -2
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared.egg-info/PKG-INFO +1 -1
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/.gitignore +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/LICENSE +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/MANIFEST.in +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/README.rst +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/Vagrantfile +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/__init__.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/ckan.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/dcinst.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/mime.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/parse.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/paths.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/s3cc.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared/testing.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared.egg-info/SOURCES.txt +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared.egg-info/dependency_links.txt +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared.egg-info/requires.txt +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/dcor_shared.egg-info/top_level.txt +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/pyproject.toml +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/setup.cfg +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/tests/data/calibration_beads_47.rtdc +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/tests/requirements.txt +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/tests/test_basic.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/tests/test_ckan.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/tests/test_data.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/tests/test_s3.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/tests/test_s3cc.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/tests/test_testing.py +0 -0
- {dcor_shared-0.11.2 → dcor_shared-0.11.4}/vagrant-run-tests.sh +0 -0
|
@@ -11,9 +11,9 @@ jobs:
|
|
|
11
11
|
checks:
|
|
12
12
|
runs-on: macos-12
|
|
13
13
|
steps:
|
|
14
|
-
- uses: actions/checkout@
|
|
14
|
+
- uses: actions/checkout@main
|
|
15
15
|
- name: Set up Python 3.8
|
|
16
|
-
uses: actions/setup-python@
|
|
16
|
+
uses: actions/setup-python@main
|
|
17
17
|
with:
|
|
18
18
|
python-version: "3.8"
|
|
19
19
|
- name: Install flake8 dependencies
|
|
@@ -11,9 +11,9 @@ jobs:
|
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
|
|
13
13
|
steps:
|
|
14
|
-
- uses: actions/checkout@
|
|
14
|
+
- uses: actions/checkout@main
|
|
15
15
|
- name: Set up Python
|
|
16
|
-
uses: actions/setup-python@
|
|
16
|
+
uses: actions/setup-python@main
|
|
17
17
|
with:
|
|
18
18
|
python-version: "3.9"
|
|
19
19
|
- name: Install dependencies
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
0.11.4
|
|
2
|
+
- ref: wait longer in wait_for_resource
|
|
3
|
+
0.11.3
|
|
4
|
+
- ref: wait longer in `wait_for_resource` loop
|
|
5
|
+
- ref: turn deprecation in `wait_for_resource` into ValueError
|
|
6
|
+
0.11.3
|
|
7
|
+
- fix: did not extract `dcor_object_store.ssl_verify` from config
|
|
1
8
|
0.11.2
|
|
2
9
|
- build: cleanup
|
|
3
10
|
0.11.1
|
|
@@ -2,7 +2,6 @@ import functools
|
|
|
2
2
|
import hashlib
|
|
3
3
|
import pathlib
|
|
4
4
|
import time
|
|
5
|
-
import warnings
|
|
6
5
|
|
|
7
6
|
from .ckan import get_resource_path
|
|
8
7
|
|
|
@@ -47,13 +46,7 @@ def wait_for_resource(resource_id: str,
|
|
|
47
46
|
from ckan import logic
|
|
48
47
|
|
|
49
48
|
if len(resource_id) != 36:
|
|
50
|
-
|
|
51
|
-
"instead of a string or a path. This will raise an "
|
|
52
|
-
"exception in the future.",
|
|
53
|
-
DeprecationWarning)
|
|
54
|
-
# The user passed a local path on the block storage. These look like
|
|
55
|
-
# this: /data/dcor-instance/resources/RE/SO/URCE-ID
|
|
56
|
-
resource_id = "".join(resource_id.split("/")[-3])
|
|
49
|
+
raise ValueError(f"Invalid resource id: {resource_id}")
|
|
57
50
|
|
|
58
51
|
resource_show = logic.get_action("resource_show")
|
|
59
52
|
path = pathlib.Path(get_resource_path(resource_id))
|
|
@@ -71,7 +64,7 @@ def wait_for_resource(resource_id: str,
|
|
|
71
64
|
except logic.NotFound:
|
|
72
65
|
# Other processes are still working on getting the resource
|
|
73
66
|
# online. We have to wait.
|
|
74
|
-
time.sleep(
|
|
67
|
+
time.sleep(5)
|
|
75
68
|
continue
|
|
76
69
|
|
|
77
70
|
s3_ok = res_dict.get("s3_available", None)
|
|
@@ -82,17 +75,17 @@ def wait_for_resource(resource_id: str,
|
|
|
82
75
|
# If the dataset is on S3, it is considered to be available.
|
|
83
76
|
break
|
|
84
77
|
elif not path.exists():
|
|
85
|
-
time.sleep(
|
|
78
|
+
time.sleep(5)
|
|
86
79
|
continue
|
|
87
80
|
elif dcor_depot_available and not path.is_symlink():
|
|
88
81
|
# Resource is only available when it is symlinked by
|
|
89
82
|
# the ckanext.dcor_depot `symlink_user_dataset` job
|
|
90
83
|
# (or by the ckanext.dcor_depot importers).
|
|
91
|
-
time.sleep(
|
|
84
|
+
time.sleep(5)
|
|
92
85
|
continue
|
|
93
86
|
elif path.stat().st_size == ld and path.read_bytes() == DUMMY_BYTES:
|
|
94
87
|
# wait a bit
|
|
95
|
-
time.sleep(
|
|
88
|
+
time.sleep(5)
|
|
96
89
|
continue
|
|
97
90
|
else:
|
|
98
91
|
# not a dummy file
|
|
@@ -289,7 +289,6 @@ def create_time():
|
|
|
289
289
|
@functools.lru_cache()
|
|
290
290
|
def get_s3():
|
|
291
291
|
"""Return the current S3 client as defined by ckan.ini"""
|
|
292
|
-
from ckan import common as ckan_common
|
|
293
292
|
# Create a new session (do not use the default session)
|
|
294
293
|
s3_session = boto3.Session(
|
|
295
294
|
aws_access_key_id=get_ckan_config_option(
|
|
@@ -297,7 +296,7 @@ def get_s3():
|
|
|
297
296
|
aws_secret_access_key=get_ckan_config_option(
|
|
298
297
|
"dcor_object_store.secret_access_key"),
|
|
299
298
|
)
|
|
300
|
-
ssl_verify =
|
|
299
|
+
ssl_verify = get_ckan_config_option("dcor_object_store.ssl_verify")
|
|
301
300
|
if isinstance(ssl_verify, str):
|
|
302
301
|
# additional check (in case CKAN did not convert to bool)
|
|
303
302
|
ssl_verify = ssl_verify.lower() == "true"
|
|
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
|