[med-svn] [Git][med-team/toil][upstream] New upstream version 5.9.2
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sun Feb 5 07:36:59 GMT 2023
Andreas Tille pushed to branch upstream at Debian Med / toil
Commits:
7a1ee16d by Andreas Tille at 2023-02-05T08:16:44+01:00
New upstream version 5.9.2
- - - - -
8 changed files:
- requirements-dev.txt
- src/toil/common.py
- src/toil/jobStores/aws/jobStore.py
- src/toil/lib/aws/__init__.py
- src/toil/lib/aws/utils.py
- src/toil/test/lib/aws/test_utils.py
- src/toil/utils/toilLaunchCluster.py
- version_template.py
Changes:
=====================================
requirements-dev.txt
=====================================
@@ -12,7 +12,7 @@ types-setuptools
types-boto
types-pytz
flake8>=3.8.4,<7
-flake8-bugbear>=20.11.1,<21
+flake8-bugbear>=20.11.1,<24
black
isort
pydocstyle
=====================================
src/toil/common.py
=====================================
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+import json
import logging
import os
import pickle
@@ -36,6 +37,7 @@ from typing import (IO,
ContextManager,
Dict,
List,
+ MutableMapping,
Optional,
Set,
Tuple,
@@ -67,7 +69,7 @@ from toil.bus import (ClusterDesiredSizeMessage,
QueueSizeMessage,
gen_message_bus_path)
from toil.fileStores import FileID
-from toil.lib.aws import zone_to_region
+from toil.lib.aws import zone_to_region, build_tag_dict_from_env
from toil.lib.compatibility import deprecated
from toil.lib.conversions import bytes2human, human2bytes
from toil.lib.io import try_path
=====================================
src/toil/jobStores/aws/jobStore.py
=====================================
@@ -35,6 +35,7 @@ from boto.exception import SDBResponseError
from botocore.exceptions import ClientError
import toil.lib.encryption as encryption
+from toil.lib.aws import build_tag_dict_from_env
from toil.fileStores import FileID
from toil.jobStores.abstractJobStore import (AbstractJobStore,
ConcurrentFileModificationException,
@@ -56,8 +57,7 @@ from toil.jobStores.utils import (ReadablePipe,
ReadableTransformingPipe,
WritablePipe)
from toil.lib.aws.session import establish_boto3_session
-from toil.lib.aws.utils import (build_tag_dict_from_env,
- create_s3_bucket,
+from toil.lib.aws.utils import (create_s3_bucket,
flatten_tags,
get_bucket_region,
get_object_for_url,
=====================================
src/toil/lib/aws/__init__.py
=====================================
@@ -25,6 +25,7 @@ from typing import (Any,
Dict,
Iterable,
List,
+ MutableMapping,
Optional,
TypeVar,
Union)
@@ -172,3 +173,23 @@ def running_on_ecs() -> bool:
"""
# We only care about relatively current ECS
return 'ECS_CONTAINER_METADATA_URI_V4' in os.environ
+
+def build_tag_dict_from_env(environment: MutableMapping[str, str] = os.environ) -> Dict[str, str]:
+ tags = dict()
+ owner_tag = environment.get('TOIL_OWNER_TAG')
+ if owner_tag:
+ tags.update({'Owner': owner_tag})
+
+ user_tags = environment.get('TOIL_AWS_TAGS')
+ if user_tags:
+ try:
+ json_user_tags = json.loads(user_tags)
+ if isinstance(json_user_tags, dict):
+ tags.update(json.loads(user_tags))
+ else:
+ logger.error('TOIL_AWS_TAGS must be in JSON format: {"key" : "value", ...}')
+ exit(1)
+ except json.decoder.JSONDecodeError:
+ logger.error('TOIL_AWS_TAGS must be in JSON format: {"key" : "value", ...}')
+ exit(1)
+ return tags
=====================================
src/toil/lib/aws/utils.py
=====================================
@@ -28,7 +28,8 @@ from typing import (Any,
Optional,
Set,
Union,
- cast)
+ cast,
+ MutableMapping)
from urllib.parse import ParseResult
from toil.lib.aws import session
@@ -41,10 +42,8 @@ from toil.lib.retry import (DEFAULT_DELAYS,
retry)
if sys.version_info >= (3, 8):
- from typing import Literal, MutableMapping
+ from typing import Literal
else:
- from typing import MutableMapping
-
from typing_extensions import Literal
try:
@@ -403,28 +402,6 @@ def list_objects_for_url(url: ParseResult) -> List[str]:
logger.debug('Found in %s items: %s', url, listing)
return listing
-
-def build_tag_dict_from_env(environment: MutableMapping[str, str] = os.environ) -> Dict[str, str]:
- tags = dict()
- owner_tag = environment.get('TOIL_OWNER_TAG')
- if owner_tag:
- tags.update({'Owner': owner_tag})
-
- user_tags = environment.get('TOIL_AWS_TAGS')
- if user_tags:
- try:
- json_user_tags = json.loads(user_tags)
- if isinstance(json_user_tags, dict):
- tags.update(json.loads(user_tags))
- else:
- logger.error('TOIL_AWS_TAGS must be in JSON format: {"key" : "value", ...}')
- exit(1)
- except json.decoder.JSONDecodeError:
- logger.error('TOIL_AWS_TAGS must be in JSON format: {"key" : "value", ...}')
- exit(1)
- return tags
-
-
def flatten_tags(tags: Dict[str, str]) -> List[Dict[str, str]]:
"""
Convert tags from a key to value dict into a list of 'Key': xxx, 'Value': xxx dicts.
=====================================
src/toil/test/lib/aws/test_utils.py
=====================================
@@ -18,7 +18,7 @@ from typing import Optional
import pytest
-from toil.lib.aws.utils import build_tag_dict_from_env
+from toil.lib.aws import build_tag_dict_from_env
from toil.test import ToilTest
logger = logging.getLogger(__name__)
=====================================
src/toil/utils/toilLaunchCluster.py
=====================================
@@ -19,7 +19,7 @@ from typing import Dict, List, Tuple, Union
from toil import applianceSelf
from toil.common import parser_with_common_options
-from toil.lib.aws.utils import build_tag_dict_from_env
+from toil.lib.aws import build_tag_dict_from_env
from toil.provisioners import (check_valid_node_types,
cluster_factory,
parse_node_types)
=====================================
version_template.py
=====================================
@@ -28,7 +28,7 @@ import the expand_ function and invoke it directly with either no or exactly one
# - don't import even standard modules at global scope without renaming them
# to have leading/trailing underscores
-baseVersion = '5.9.0'
+baseVersion = '5.9.2'
cgcloudVersion = '1.6.0a1.dev393'
View it on GitLab: https://salsa.debian.org/med-team/toil/-/commit/7a1ee16d69f45156825209b7593bcf4957920772
--
View it on GitLab: https://salsa.debian.org/med-team/toil/-/commit/7a1ee16d69f45156825209b7593bcf4957920772
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230205/490f30db/attachment-0001.htm>
More information about the debian-med-commit
mailing list