diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6d4f089..ec27e6c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -11,8 +11,8 @@ jobs: steps: - name: SCM Checkout uses: actions/checkout@v3 -# with: -# fetch-depth: 0 + with: + fetch-depth: 0 - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@0.8.0 diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 0000000..e69de29 diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 0000000..e69de29 diff --git a/exasol/python_extension_common/deployment/language_container_deployer.py b/exasol/python_extension_common/deployment/language_container_deployer.py index 5b4d2fd..a0bf705 100644 --- a/exasol/python_extension_common/deployment/language_container_deployer.py +++ b/exasol/python_extension_common/deployment/language_container_deployer.py @@ -1,15 +1,15 @@ from enum import Enum from textwrap import dedent -from typing import List, Optional +from typing import List, Optional, Dict from pathlib import Path, PurePosixPath import logging import tempfile -import requests +import requests # type: ignore import ssl -import pyexasol -from exasol_bucketfs_utils_python.bucketfs_location import BucketFSLocation -from exasol_bucketfs_utils_python.bucket_config import BucketConfig, BucketFSConfig -from exasol_bucketfs_utils_python.bucketfs_connection_config import BucketFSConnectionConfig +import pyexasol # type: ignore +from exasol_bucketfs_utils_python.bucketfs_location import BucketFSLocation # type: ignore +from exasol_bucketfs_utils_python.bucket_config import BucketConfig, BucketFSConfig # type: ignore +from exasol_bucketfs_utils_python.bucketfs_connection_config import BucketFSConnectionConfig # type: ignore logger = logging.getLogger(__name__) @@ -40,7 +40,7 @@ def get_websocket_sslopt(use_ssl_cert_validation: bool = True, """ # Is server certificate validation required? - sslopt: dict[str, object] = {"cert_reqs": ssl.CERT_REQUIRED if use_ssl_cert_validation else ssl.CERT_NONE} + sslopt: Dict[str, object] = {"cert_reqs": ssl.CERT_REQUIRED if use_ssl_cert_validation else ssl.CERT_NONE} # Is a bundle with trusted CAs provided? if ssl_trusted_ca: @@ -66,7 +66,7 @@ def get_websocket_sslopt(use_ssl_cert_validation: bool = True, class LanguageActivationLevel(Enum): - f""" + """ Language activation level, i.e. ALTER SET SCRIPT_LANGUAGES=... """ diff --git a/exasol/python_extension_common/deployment/language_container_deployer_cli.py b/exasol/python_extension_common/deployment/language_container_deployer_cli.py index 6d68992..f3208ef 100644 --- a/exasol/python_extension_common/deployment/language_container_deployer_cli.py +++ b/exasol/python_extension_common/deployment/language_container_deployer_cli.py @@ -6,8 +6,8 @@ from pathlib import Path from exasol.python_extension_common.deployment.language_container_deployer import LanguageContainerDeployer -DB_PASSWORD_ENVIRONMENT_VARIABLE = f"DB_PASSWORD" -BUCKETFS_PASSWORD_ENVIRONMENT_VARIABLE = f"BUCKETFS_PASSWORD" +DB_PASSWORD_ENVIRONMENT_VARIABLE = "DB_PASSWORD" +BUCKETFS_PASSWORD_ENVIRONMENT_VARIABLE = "BUCKETFS_PASSWORD" class CustomizableParameters(Enum): @@ -54,7 +54,7 @@ def update_parameter(parameter_name: str, formatter: str) -> None: # before and after applying the regex, assuming the current parameter is 'version'. # 'something-with-{version}/tailored-for-{user}' => 'something-with-{version}/tailored-for-{{user}}' # We were looking for all occurrences of a pattern '{some_name}', where some_name is not version. - pattern = r'\{(?!' + param.name + r'\})\w+\}' + pattern = r'\{(?!' + (param.name or '') + r'\})\w+\}' param_formatter = re.sub(pattern, lambda m: f'{{{m.group(0)}}}', param_formatter) kwargs = {param.name: value} ctx.params[parameter_name] = param_formatter.format(**kwargs) @@ -126,8 +126,8 @@ def language_container_deployer_main( upload_container: bool, alter_system: bool, allow_override: bool, - container_url: str = None, - container_name: str = None): + container_url: Optional[str] = None, + container_name: Optional[str] = None): deployer = LanguageContainerDeployer.create( bucketfs_name=bucketfs_name, @@ -158,13 +158,3 @@ def language_container_deployer_main( # The error message should mention the parameters which the callback is specified for being missed. raise ValueError("To upload a language container you should specify either its " "release version or a path of the already downloaded container file.") - - -if __name__ == '__main__': - import logging - - logging.basicConfig( - format='%(asctime)s - %(module)s - %(message)s', - level=logging.DEBUG) - - language_container_deployer_main()