Skip to content

Commit

Permalink
fixing linting and type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Mar 27, 2024
1 parent 147b80b commit 144c0a9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
Empty file added doc/conf.py
Empty file.
Empty file added doc/index.rst
Empty file.
Original file line number Diff line number Diff line change
@@ -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__)

Expand Down Expand Up @@ -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:
Expand All @@ -66,7 +66,7 @@ def get_websocket_sslopt(use_ssl_cert_validation: bool = True,


class LanguageActivationLevel(Enum):
f"""
"""
Language activation level, i.e.
ALTER <LanguageActivationLevel> SET SCRIPT_LANGUAGES=...
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()

0 comments on commit 144c0a9

Please sign in to comment.