From 46ba0065ce4138b5d9d79d0b30edbe389437efae Mon Sep 17 00:00:00 2001 From: galaxybot Date: Sat, 22 Jul 2023 03:25:26 +0000 Subject: [PATCH 1/2] Update Python dependencies --- lib/galaxy/dependencies/dev-requirements.txt | 12 ++++++------ .../dependencies/pinned-lint-requirements.txt | 2 +- .../dependencies/pinned-requirements.txt | 16 ++++++++-------- .../pinned-typecheck-requirements.txt | 18 +++++++++--------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/galaxy/dependencies/dev-requirements.txt b/lib/galaxy/dependencies/dev-requirements.txt index 08149e289b87..2970c1707cfd 100644 --- a/lib/galaxy/dependencies/dev-requirements.txt +++ b/lib/galaxy/dependencies/dev-requirements.txt @@ -1,4 +1,4 @@ -aiohttp==3.8.4 ; python_version >= "3.7" and python_version < "3.12" +aiohttp==3.8.5 ; python_version >= "3.7" and python_version < "3.12" aiosignal==1.3.1 ; python_version >= "3.7" and python_version < "3.12" alabaster==0.7.13 ; python_version >= "3.7" and python_version < "3.12" amqp==5.1.1 ; python_version >= "3.7" and python_version < "3.12" @@ -22,7 +22,7 @@ charset-normalizer==3.2.0 ; python_version >= "3.7" and python_version < "3.12" click-didyoumean==0.3.0 ; python_version >= "3.7" and python_version < "3.12" click-plugins==1.1.1 ; python_version >= "3.7" and python_version < "3.12" click-repl==0.3.0 ; python_version >= "3.7" and python_version < "3.12" -click==8.1.5 ; python_version >= "3.7" and python_version < "3.12" +click==8.1.6 ; python_version >= "3.7" and python_version < "3.12" codespell==2.2.5 ; python_version >= "3.7" and python_version < "3.12" colorama==0.4.6 ; python_version >= "3.7" and python_version < "3.12" and (sys_platform == "win32" or platform_system == "Windows" or os_name == "nt") coverage[toml]==7.2.7 ; python_version >= "3.7" and python_version < "3.12" @@ -81,7 +81,7 @@ pathspec==0.11.1 ; python_version >= "3.7" and python_version < "3.12" pillow==9.5.0 ; python_version >= "3.7" and python_version < "3.12" pkce==1.0.3 ; python_version >= "3.7" and python_version < "3.12" pkginfo==1.9.6 ; python_version >= "3.7" and python_version < "3.12" -platformdirs==3.8.1 ; python_version >= "3.7" and python_version < "3.12" +platformdirs==3.9.1 ; python_version >= "3.7" and python_version < "3.12" pluggy==1.2.0 ; python_version >= "3.7" and python_version < "3.12" port-for==0.7.1 ; python_version >= "3.7" and python_version < "3.12" prettytable==3.7.0 ; python_version >= "3.7" and python_version < "3.12" @@ -91,7 +91,7 @@ py==1.11.0 ; python_version >= "3.7" and python_version < "3.12" pycparser==2.21 ; python_version >= "3.7" and python_version < "3.12" pygithub==1.59.0 ; python_version >= "3.7" and python_version < "3.12" pygments==2.15.1 ; python_version >= "3.7" and python_version < "3.12" -pyjwt[crypto]==2.7.0 ; python_version >= "3.7" and python_version < "3.12" +pyjwt[crypto]==2.8.0 ; python_version >= "3.7" and python_version < "3.12" pynacl==1.5.0 ; python_version >= "3.7" and python_version < "3.12" pyparsing==3.0.9 ; python_version >= "3.7" and python_version < "3.12" pyproject-hooks==1.0.0 ; python_version >= "3.7" and python_version < "3.12" @@ -111,7 +111,7 @@ python-dateutil==2.8.2 ; python_version >= "3.7" and python_version < "3.12" python-irodsclient==1.1.8 ; python_version >= "3.7" and python_version < "3.12" pytz==2023.3 ; python_version >= "3.7" and python_version < "3.12" pywin32-ctypes==0.2.2 ; python_version >= "3.7" and python_version < "3.12" and sys_platform == "win32" -pyyaml==6.0 ; python_version >= "3.7" and python_version < "3.12" +pyyaml==6.0.1 ; python_version >= "3.7" and python_version < "3.12" rdflib==6.2.0 ; python_version >= "3.7" and python_version < "3.12" readme-renderer==37.3 ; python_version >= "3.7" and python_version < "3.12" requests-toolbelt==1.0.0 ; python_version >= "3.7" and python_version < "3.12" @@ -153,7 +153,7 @@ tuspy==1.0.1 ; python_version >= "3.7" and python_version < "3.12" twill==3.1 ; python_version >= "3.7" and python_version < "3.12" twine==4.0.2 ; python_version >= "3.7" and python_version < "3.12" typed-ast==1.5.5 ; python_version < "3.8" and implementation_name == "cpython" and python_version >= "3.7" -types-pyyaml==6.0.12.10 ; python_version >= "3.7" and python_version < "3.12" +types-pyyaml==6.0.12.11 ; python_version >= "3.7" and python_version < "3.12" typing-extensions==4.7.1 ; python_version >= "3.7" and python_version < "3.12" urllib3==1.26.16 ; python_version >= "3.7" and python_version < "3.12" urllib3[socks]==1.26.16 ; python_version >= "3.7" and python_version < "3.12" diff --git a/lib/galaxy/dependencies/pinned-lint-requirements.txt b/lib/galaxy/dependencies/pinned-lint-requirements.txt index a155a560b399..5ae02c863bd1 100644 --- a/lib/galaxy/dependencies/pinned-lint-requirements.txt +++ b/lib/galaxy/dependencies/pinned-lint-requirements.txt @@ -5,6 +5,6 @@ importlib-metadata==4.2.0 mccabe==0.7.0 pycodestyle==2.9.1 pyflakes==2.5.0 -ruff==0.0.278 +ruff==0.0.279 typing_extensions==4.7.1 zipp==3.15.0 diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt index 4e8b4b4f67dd..5401c06ed4ae 100644 --- a/lib/galaxy/dependencies/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pinned-requirements.txt @@ -4,7 +4,7 @@ a2wsgi==1.7.0 ; python_version >= "3.7" and python_version < "3.12" adal==1.2.7 ; python_version >= "3.7" and python_version < "3.12" aiobotocore==2.4.2 ; python_version >= "3.7" and python_version < "3.12" aiofiles==23.1.0 ; python_version >= "3.7" and python_version < "3.12" -aiohttp==3.8.4 ; python_version >= "3.7" and python_version < "3.12" +aiohttp==3.8.5 ; python_version >= "3.7" and python_version < "3.12" aioitertools==0.11.0 ; python_version >= "3.7" and python_version < "3.12" aiosignal==1.3.1 ; python_version >= "3.7" and python_version < "3.12" alembic==1.11.1 ; python_version >= "3.7" and python_version < "3.12" @@ -42,7 +42,7 @@ circus==0.18.0 ; python_version >= "3.7" and python_version < "3.12" click-didyoumean==0.3.0 ; python_version >= "3.7" and python_version < "3.12" click-plugins==1.1.1 ; python_version >= "3.7" and python_version < "3.12" click-repl==0.3.0 ; python_version >= "3.7" and python_version < "3.12" -click==8.1.5 ; python_version >= "3.7" and python_version < "3.12" +click==8.1.6 ; python_version >= "3.7" and python_version < "3.12" cloudauthz==0.6.0 ; python_version >= "3.7" and python_version < "3.12" cloudbridge==3.1.0 ; python_version >= "3.7" and python_version < "3.12" colorama==0.4.6 ; python_version >= "3.7" and python_version < "3.12" and platform_system == "Windows" @@ -52,7 +52,7 @@ cryptography==41.0.2 ; python_version >= "3.7" and python_version < "3.12" cwl-upgrader==1.2.8 ; python_version >= "3.7" and python_version < "3.12" cwl-utils==0.28 ; python_version >= "3.7" and python_version < "3.12" cwltool==3.1.20221109155812 ; python_version >= "3.7" and python_version < "3.12" -cython==0.29.36 ; python_version >= "3.7" and python_version < "3.12" +cython==3.0.0 ; python_version >= "3.7" and python_version < "3.12" decorator==5.1.1 ; python_version >= "3.7" and python_version < "3.12" defusedxml==0.7.1 ; python_version >= "3.7" and python_version < "3.12" deprecation==2.1.0 ; python_version >= "3.7" and python_version < "3.12" @@ -75,7 +75,7 @@ galaxy-sequence-utils==1.1.5 ; python_version >= "3.7" and python_version < "3.1 galaxy2cwl==0.1.4 ; python_version >= "3.7" and python_version < "3.12" gravity==1.0.3 ; python_version >= "3.7" and python_version < "3.12" greenlet==2.0.2 ; python_version >= "3.7" and (platform_machine == "win32" or platform_machine == "WIN32" or platform_machine == "AMD64" or platform_machine == "amd64" or platform_machine == "x86_64" or platform_machine == "ppc64le" or platform_machine == "aarch64") and python_version < "3.12" -gunicorn==20.1.0 ; python_version >= "3.7" and python_version < "3.12" +gunicorn==21.2.0 ; python_version >= "3.7" and python_version < "3.12" gxformat2==0.18.0 ; python_version >= "3.7" and python_version < "3.12" h11==0.14.0 ; python_version >= "3.7" and python_version < "3.12" h5grove==1.3.0 ; python_version >= "3.7" and python_version < "3.12" @@ -123,7 +123,7 @@ pkgutil-resolve-name==1.3.10 ; python_version >= "3.7" and python_version < "3.9 prompt-toolkit==3.0.39 ; python_version >= "3.7" and python_version < "3.12" prov==1.5.1 ; python_version >= "3.7" and python_version < "3.12" psutil==5.9.5 ; python_version >= "3.7" and python_version < "3.12" -pulsar-galaxy-lib==0.15.2 ; python_version >= "3.7" and python_version < "3.12" +pulsar-galaxy-lib==0.15.3 ; python_version >= "3.7" and python_version < "3.12" pyasn1==0.5.0 ; python_version >= "3.7" and python_version < "3.12" pycparser==2.21 ; python_version >= "3.7" and python_version < "3.12" pycryptodome==3.18.0 ; python_version >= "3.7" and python_version < "3.12" @@ -134,8 +134,8 @@ pydot==1.4.2 ; python_version >= "3.7" and python_version < "3.12" pyeventsystem==0.1.0 ; python_version >= "3.7" and python_version < "3.12" pyfaidx==0.7.2.1 ; python_version >= "3.7" and python_version < "3.12" pygments==2.15.1 ; python_version >= "3.7" and python_version < "3.12" -pyjwt==2.7.0 ; python_version >= "3.7" and python_version < "3.12" -pyjwt[crypto]==2.7.0 ; python_version >= "3.7" and python_version < "3.12" +pyjwt==2.8.0 ; python_version >= "3.7" and python_version < "3.12" +pyjwt[crypto]==2.8.0 ; python_version >= "3.7" and python_version < "3.12" pykwalify==1.8.0 ; python_version >= "3.7" and python_version < "3.12" pylibmagic==0.4.0 ; python_version >= "3.7" and python_version < "3.12" pynacl==1.5.0 ; python_version >= "3.7" and python_version < "3.12" @@ -150,7 +150,7 @@ python-magic==0.4.27 ; python_version >= "3.7" and python_version < "3.12" python-multipart==0.0.6 ; python_version >= "3.7" and python_version < "3.12" python3-openid==3.2.0 ; python_version >= "3.7" and python_version < "3.12" pytz==2023.3 ; python_version >= "3.7" and python_version < "3.12" -pyyaml==6.0 ; python_version >= "3.7" and python_version < "3.12" +pyyaml==6.0.1 ; python_version >= "3.7" and python_version < "3.12" pyzmq==25.1.0 ; python_version >= "3.7" and python_version < "3.12" rdflib==6.2.0 ; python_version >= "3.7" and python_version < "3.12" refgenconf==0.12.2 ; python_version >= "3.7" and python_version < "3.12" diff --git a/lib/galaxy/dependencies/pinned-typecheck-requirements.txt b/lib/galaxy/dependencies/pinned-typecheck-requirements.txt index efeaa6e36878..922ebdae78fe 100644 --- a/lib/galaxy/dependencies/pinned-typecheck-requirements.txt +++ b/lib/galaxy/dependencies/pinned-typecheck-requirements.txt @@ -6,17 +6,17 @@ pycparser==2.21 pydantic==1.10.11 tomli==2.0.1 typed-ast==1.5.5 -types-bleach==6.0.0.3 -types-boto==2.49.18.8 +types-bleach==6.0.0.4 +types-boto==2.49.18.9 types-contextvars==2.4.7.3 types-dataclasses==0.6.6 types-docutils==0.20.0.1 -types-Markdown==3.4.2.9 -types-paramiko==3.2.0.0 +types-Markdown==3.4.2.10 +types-paramiko==3.2.0.1 types-pkg-resources==0.1.3 -types-python-dateutil==2.8.19.13 -types-PyYAML==6.0.12.10 -types-requests==2.31.0.1 -types-six==1.16.21.8 -types-urllib3==1.26.25.13 +types-python-dateutil==2.8.19.14 +types-PyYAML==6.0.12.11 +types-requests==2.31.0.2 +types-six==1.16.21.9 +types-urllib3==1.26.25.14 typing_extensions==4.7.1 From c7a38d06d520bfd6477e224b81dd8b07269f3421 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Sun, 23 Jul 2023 16:25:27 +0100 Subject: [PATCH 2/2] Fix new errors from ruff 0.0.279 --- lib/galaxy/model/__init__.py | 14 ++++++-------- lib/galaxy/model/store/__init__.py | 2 +- .../tool_shed/galaxy_install/tools/data_manager.py | 2 +- lib/galaxy/tool_util/deps/__init__.py | 2 +- lib/galaxy/tool_util/deps/containers.py | 4 ++-- lib/galaxy/tools/actions/__init__.py | 2 +- lib/galaxy/tools/parameters/grouping.py | 2 +- lib/galaxy/tools/wrappers.py | 2 +- .../webapps/galaxy/services/dataset_collections.py | 4 ++-- .../test_page_revision_json_encoding.py | 8 +++----- test/unit/app/tools/test_wrappers.py | 6 ++---- 11 files changed, 21 insertions(+), 27 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 160f7db47cda..2ad0ac59b707 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -616,15 +616,13 @@ def calculate_user_disk_usage_statements(user_id, quota_source_map, for_sqlite=F label_usage=label_usage ) else: - statement = """ + statement = f""" INSERT INTO user_quota_source_usage(user_id, quota_source_label, disk_usage) VALUES(:id, :label, ({label_usage})) ON CONFLICT ON constraint uqsu_unique_label_per_user DO UPDATE SET disk_usage = excluded.disk_usage -""".format( - label_usage=label_usage - ) +""" statements.append( (statement, {"id": user_id, "label": quota_source_label, "include_object_store_ids": object_store_ids}) ) @@ -1399,12 +1397,12 @@ def finished(self): ] def io_dicts(self, exclude_implicit_outputs=False) -> IoDicts: - inp_data: Dict[str, Optional["DatasetInstance"]] = {da.name: da.dataset for da in self.input_datasets} - out_data: Dict[str, "DatasetInstance"] = {da.name: da.dataset for da in self.output_datasets} + inp_data: Dict[str, Optional[DatasetInstance]] = {da.name: da.dataset for da in self.input_datasets} + out_data: Dict[str, DatasetInstance] = {da.name: da.dataset for da in self.output_datasets} inp_data.update([(da.name, da.dataset) for da in self.input_library_datasets]) out_data.update([(da.name, da.dataset) for da in self.output_library_datasets]) - out_collections: Dict[str, Union["DatasetCollectionInstance", "DatasetCollection"]] + out_collections: Dict[str, Union[DatasetCollectionInstance, DatasetCollection]] if not exclude_implicit_outputs: out_collections = { obj.name: obj.dataset_collection_instance for obj in self.output_dataset_collection_instances @@ -8660,7 +8658,7 @@ def preferred_object_stores(self) -> WorkflowInvocationStepObjectStores: preferred_object_store_id = None preferred_outputs_object_store_id = None preferred_intermediate_object_store_id = None - step_effective_outputs: Optional[List["EffectiveOutput"]] = None + step_effective_outputs: Optional[List[EffectiveOutput]] = None workflow_invocation = self.workflow_invocation for input_parameter in workflow_invocation.input_parameters: diff --git a/lib/galaxy/model/store/__init__.py b/lib/galaxy/model/store/__init__.py index 7363e4154479..be285bbce3d5 100644 --- a/lib/galaxy/model/store/__init__.py +++ b/lib/galaxy/model/store/__init__.py @@ -1337,7 +1337,7 @@ def __init__(self) -> None: self.hdca_copied_from_sinks = {} self.jobs_by_key = {} self.invocations_by_key: Dict[str, model.WorkflowInvocation] = {} - self.implicit_collection_jobs_by_key: Dict[str, "ImplicitCollectionJobs"] = {} + self.implicit_collection_jobs_by_key: Dict[str, ImplicitCollectionJobs] = {} self.workflows_by_key: Dict[str, model.Workflow] = {} self.requires_hid = [] diff --git a/lib/galaxy/tool_shed/galaxy_install/tools/data_manager.py b/lib/galaxy/tool_shed/galaxy_install/tools/data_manager.py index 866faebfb555..163822c290a7 100644 --- a/lib/galaxy/tool_shed/galaxy_install/tools/data_manager.py +++ b/lib/galaxy/tool_shed/galaxy_install/tools/data_manager.py @@ -74,7 +74,7 @@ def install_data_managers( repository, repository_tools_tups, ) -> List["DataManager"]: - rval: List["DataManager"] = [] + rval: List[DataManager] = [] if "data_manager" in metadata_dict: tpm = tool_panel_manager.ToolPanelManager(self.app) repository_tools_by_guid = {} diff --git a/lib/galaxy/tool_util/deps/__init__.py b/lib/galaxy/tool_util/deps/__init__.py index 6fd76e246220..24a24d058f16 100644 --- a/lib/galaxy/tool_util/deps/__init__.py +++ b/lib/galaxy/tool_util/deps/__init__.py @@ -145,7 +145,7 @@ def __init__( plugin_source = self.__build_dependency_resolvers_plugin_source(conf_file) self.dependency_resolvers = self.__parse_resolver_conf_plugins(plugin_source) self._enabled_container_types: List[str] = [] - self._destination_for_container_type: Dict[str, Dict[str, "JobDestination"]] = {} + self._destination_for_container_type: Dict[str, Dict[str, JobDestination]] = {} def set_enabled_container_types(self, container_types_to_destinations): """Set the union of all enabled container types.""" diff --git a/lib/galaxy/tool_util/deps/containers.py b/lib/galaxy/tool_util/deps/containers.py index 42446b2cc64a..f51948169190 100644 --- a/lib/galaxy/tool_util/deps/containers.py +++ b/lib/galaxy/tool_util/deps/containers.py @@ -66,7 +66,7 @@ def __init__(self, app_info: "AppInfo", mulled_resolution_cache: Optional["Cache self.app_info = app_info self.mulled_resolution_cache = mulled_resolution_cache self.default_container_registry = ContainerRegistry(app_info, mulled_resolution_cache=mulled_resolution_cache) - self.destination_container_registeries: Dict[str, "ContainerRegistry"] = {} + self.destination_container_registeries: Dict[str, ContainerRegistry] = {} def _enabled_container_types(self, destination_info: Dict[str, Any]) -> List[str]: return [t for t in ALL_CONTAINER_TYPES if self.__container_type_enabled(t, destination_info)] @@ -317,7 +317,7 @@ def _parse_resolver_conf(self, plugin_source: "PluginConfigSource") -> List["Con return plugin_config.load_plugins(self.resolver_classes, plugin_source, extra_kwds) def __default_container_resolvers(self) -> List["ContainerResolver"]: - default_resolvers: List["ContainerResolver"] = [ + default_resolvers: List[ContainerResolver] = [ ExplicitContainerResolver(self.app_info), ExplicitSingularityContainerResolver(self.app_info), ] diff --git a/lib/galaxy/tools/actions/__init__.py b/lib/galaxy/tools/actions/__init__.py index 404f623edf76..04079adf958d 100644 --- a/lib/galaxy/tools/actions/__init__.py +++ b/lib/galaxy/tools/actions/__init__.py @@ -457,7 +457,7 @@ def execute( # wrapped params are used by change_format action and by output.label; only perform this wrapping once, as needed wrapped_params = self._wrapped_params(trans, tool, incoming, inp_data) - out_data: Dict[str, "DatasetInstance"] = {} + out_data: Dict[str, DatasetInstance] = {} input_collections = LegacyUnprefixedDict({k: v[0][0] for k, v in inp_dataset_collections.items()}) input_collections._legacy_mapping = inp_dataset_collections._legacy_mapping output_collections = OutputCollections( diff --git a/lib/galaxy/tools/parameters/grouping.py b/lib/galaxy/tools/parameters/grouping.py index 14383ae2fd06..8eed2a68e7b5 100644 --- a/lib/galaxy/tools/parameters/grouping.py +++ b/lib/galaxy/tools/parameters/grouping.py @@ -723,7 +723,7 @@ class Conditional(Group): def __init__(self): Group.__init__(self) - self.test_param: Optional["ToolParameter"] = None + self.test_param: Optional[ToolParameter] = None self.cases = [] self.value_ref = None self.value_ref_in_group = True # When our test_param is not part of the conditional Group, this is False diff --git a/lib/galaxy/tools/wrappers.py b/lib/galaxy/tools/wrappers.py index 04343c4d2af6..13fb33d227e0 100644 --- a/lib/galaxy/tools/wrappers.py +++ b/lib/galaxy/tools/wrappers.py @@ -301,7 +301,7 @@ def __init__( compute_environment: Optional["ComputeEnvironment"] = None, ) -> None: self.dataset = dataset - self.metadata: "MetadataCollection" = dataset.metadata + self.metadata: MetadataCollection = dataset.metadata self.compute_environment = compute_environment def __getattr__(self, name: str) -> Any: diff --git a/lib/galaxy/webapps/galaxy/services/dataset_collections.py b/lib/galaxy/webapps/galaxy/services/dataset_collections.py index d13e2066b3f4..5c59d260b092 100644 --- a/lib/galaxy/webapps/galaxy/services/dataset_collections.py +++ b/lib/galaxy/webapps/galaxy/services/dataset_collections.py @@ -190,7 +190,7 @@ def show( """ Returns information about a particular dataset collection. """ - dataset_collection_instance: Union["HistoryDatasetCollectionAssociation", "LibraryDatasetCollectionAssociation"] + dataset_collection_instance: Union[HistoryDatasetCollectionAssociation, LibraryDatasetCollectionAssociation] if instance_type == "history": dataset_collection_instance = self.collection_manager.get_dataset_collection_instance(trans, "history", id) parent = dataset_collection_instance.history @@ -249,7 +249,7 @@ def contents( raise exceptions.RequestParameterInvalidException( "Parameter instance_type not being 'history' is not yet implemented." ) - hdca: "HistoryDatasetCollectionAssociation" = self.collection_manager.get_dataset_collection_instance( + hdca: HistoryDatasetCollectionAssociation = self.collection_manager.get_dataset_collection_instance( trans, "history", hdca_id, check_ownership=True ) diff --git a/test/integration/test_page_revision_json_encoding.py b/test/integration/test_page_revision_json_encoding.py index 1b7e7a9da2f4..1e197b30d883 100644 --- a/test/integration/test_page_revision_json_encoding.py +++ b/test/integration/test_page_revision_json_encoding.py @@ -76,10 +76,8 @@ def test_page_encoding_markdown(self, history_id: str): not in content ), content assert ( - """```galaxy -history_dataset_display(history_dataset_id={}) -```""".format( - dataset_id - ) + f"""```galaxy +history_dataset_display(history_dataset_id={dataset_id}) +```""" in content ), content diff --git a/test/unit/app/tools/test_wrappers.py b/test/unit/app/tools/test_wrappers.py index 11f9cf8950d3..3b17bafece19 100644 --- a/test/unit/app/tools/test_wrappers.py +++ b/test/unit/app/tools/test_wrappers.py @@ -42,13 +42,11 @@ def selectwrapper(tool, value, multiple=False, optional=False): optional = 'optional="true"' if optional else "" multiple = 'multiple="true"' if multiple else "" xml = XML( - """ + f""" - """.format( - multiple, optional - ) + """ ) parameter = SelectToolParameter(tool, xml) return SelectToolParameterWrapper(parameter, value)