From df5339ec5e8ba6b5d7ff0d48233502cbb6f22ffe Mon Sep 17 00:00:00 2001 From: BjoernAtBosch Date: Tue, 9 Apr 2024 15:10:54 +0200 Subject: [PATCH] Remove K3D and Dapr (#10) * Remove K3D and Dapr * Normalize package name to velocitas-lib --- .devcontainer/Dockerfile | 2 +- .github/workflows/check-licenses.yml | 4 ++-- .github/workflows/ci.yml | 20 ++++++++++++-------- .gitignore | 1 - NOTICE-3RD-PARTY-CONTENT.md | 10 +++++----- docs/index.md | 2 +- docs/velocitas_lib.middleware.md | 2 +- docs/velocitas_lib.services.md | 14 +++++++------- pyproject.toml | 4 ++-- tests/requirements.txt | 2 +- velocitas_lib/middleware.py | 1 - velocitas_lib/services.py | 10 ---------- 12 files changed, 32 insertions(+), 40 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 263fd6f..3acefbb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -12,7 +12,7 @@ # # SPDX-License-Identifier: Apache-2.0 -FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.2 +FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 COPY scripts/*.sh /tmp/scripts/ RUN find /tmp/scripts/ -type f -iname "*.sh" -exec chmod +x {} \; diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index 14c57f6..1107a7b 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -51,7 +51,7 @@ jobs: generate-dash: true - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: 17 @@ -64,7 +64,7 @@ jobs: java -jar dash.jar clearlydefined.input -summary DEPENDENCIES - name: Upload dash input/output as artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: "dash-artifacts" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75a4453..89518b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: unit-test: name: "Run unit tests" runs-on: ubuntu-22.04 - container: ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.1 + container: ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 steps: - name: Checkout repository @@ -75,13 +75,17 @@ jobs: update_check: true annotate_only: true - - uses: 5monkeys/cobertura-action@v13 + - uses: irongut/CodeCoverageSummary@v1.3.0 with: - path: results/CodeCoverage/cobertura-coverage.xml - minimum_coverage: 80 - show_line: true - show_branch: true - fail_below_threshold: false + filename: results/CodeCoverage/cobertura-coverage.xml + badge: true + format: markdown + hide_complexity: true + indicators: true + output: both + + - run: | + cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY ensure-docs-up2date: name: Ensure docs are up2date @@ -91,7 +95,7 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' diff --git a/.gitignore b/.gitignore index c006743..0c8881d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ dist build logs results -helm .pytest_cache mkdocs.yml diff --git a/NOTICE-3RD-PARTY-CONTENT.md b/NOTICE-3RD-PARTY-CONTENT.md index 79ffab6..4ae21f5 100644 --- a/NOTICE-3RD-PARTY-CONTENT.md +++ b/NOTICE-3RD-PARTY-CONTENT.md @@ -3,15 +3,15 @@ ## Python | Dependency | Version | License | |:-----------|:-------:|--------:| -|types-requests|2.31.0.20240403|Apache 2.0| +|types-requests|2.31.0.20240406|Apache 2.0| |urllib3|2.2.1|MIT| ## Workflows | Dependency | Version | License | |:-----------|:-------:|--------:| -|5monkeys/cobertura-action|v13|MIT License| |actions/checkout|v4|MIT License| -|actions/setup-java|v3|MIT License| -|actions/setup-python|v4|MIT License| -|actions/upload-artifact|v3|MIT License| +|actions/setup-java|v4|MIT License| +|actions/setup-python|v5|MIT License| +|actions/upload-artifact|v4|MIT License| +|irongut/CodeCoverageSummary|v1.3.0|MIT License| |mikepenz/action-junit-report|v4|Apache License 2.0| |pre-commit/action|v3.0.0|MIT License| diff --git a/docs/index.md b/docs/index.md index 3edb46a..a974af2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -15,7 +15,7 @@ - [`middleware.MiddlewareType`](./velocitas_lib.middleware.md#class-middlewaretype): Enumeration containing all possible middleware types. - [`services.Service`](./velocitas_lib.services.md#class-service): Service(id, config) -- [`services.ServiceSpecConfig`](./velocitas_lib.services.md#class-servicespecconfig): ServiceSpecConfig(image, is_enabled, env_vars, use_dapr, args, ports, port_forwards, mounts, startup_log_patterns) +- [`services.ServiceSpecConfig`](./velocitas_lib.services.md#class-servicespecconfig): ServiceSpecConfig(image, is_enabled, env_vars, args, ports, port_forwards, mounts, startup_log_patterns) - [`variables.ProjectVariables`](./velocitas_lib.variables.md#class-projectvariables) ## Functions diff --git a/docs/velocitas_lib.middleware.md b/docs/velocitas_lib.middleware.md index c4f40b5..35ed667 100644 --- a/docs/velocitas_lib.middleware.md +++ b/docs/velocitas_lib.middleware.md @@ -10,7 +10,7 @@ --- - + ## function `get_middleware_type` diff --git a/docs/velocitas_lib.services.md b/docs/velocitas_lib.services.md index a7cec1e..510f098 100644 --- a/docs/velocitas_lib.services.md +++ b/docs/velocitas_lib.services.md @@ -10,7 +10,7 @@ --- - + ## function `resolve_functions` @@ -25,7 +25,7 @@ resolve_functions(input_str: str) → str --- - + ## function `parse_service_config` @@ -48,7 +48,7 @@ Parse service spec configuration and return it as an named tuple. --- - + ## function `get_services` @@ -61,7 +61,7 @@ Return all specified services as Python object. --- - + ## function `get_specific_service` @@ -80,7 +80,7 @@ Return the specified service as Python object. --- - + ## function `get_service_port` @@ -102,7 +102,7 @@ Return the service port as string for the specified service. ## class `ServiceSpecConfig` -ServiceSpecConfig(image, is_enabled, env_vars, use_dapr, args, ports, port_forwards, mounts, startup_log_patterns) +ServiceSpecConfig(image, is_enabled, env_vars, args, ports, port_forwards, mounts, startup_log_patterns) @@ -110,7 +110,7 @@ ServiceSpecConfig(image, is_enabled, env_vars, use_dapr, args, ports, port_forwa --- - + ## class `Service` Service(id, config) diff --git a/pyproject.toml b/pyproject.toml index 0f52a23..9c117f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "velocitas_lib" -version = "0.0.3" +name = "velocitas-lib" +version = "0.1.0" dependencies = [ "requests >= 2.31.0", "types-requests" diff --git a/tests/requirements.txt b/tests/requirements.txt index 770f6a4..bfe3395 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -4,4 +4,4 @@ pytest-asyncio==0.20.3 pytest-cov==4.0.0 types-mock==4.0.15.2 pyfakefs==5.2.2 -velocitas_lib +velocitas-lib diff --git a/velocitas_lib/middleware.py b/velocitas_lib/middleware.py index 968e943..11978b9 100644 --- a/velocitas_lib/middleware.py +++ b/velocitas_lib/middleware.py @@ -19,7 +19,6 @@ class MiddlewareType(Enum): """Enumeration containing all possible middleware types.""" NATIVE = 0 - DAPR = 1 def get_middleware_type() -> MiddlewareType: diff --git a/velocitas_lib/services.py b/velocitas_lib/services.py index c7d9ff6..bcbaf3c 100644 --- a/velocitas_lib/services.py +++ b/velocitas_lib/services.py @@ -26,7 +26,6 @@ class ServiceSpecConfig(NamedTuple): image: str is_enabled: bool = True env_vars: Dict[str, Optional[str]] = dict() - use_dapr: bool = True args: List[str] = list() ports: List[str] = list() port_forwards: List[str] = list() @@ -84,7 +83,6 @@ def parse_service_config( """ is_enabled = True - use_dapr = True container_image = None env_vars = dict[str, Optional[str]]() ports = [] @@ -113,13 +111,6 @@ def parse_service_config( env_vars[inner_key] = None if len(pair) > 1: env_vars[inner_key] = pair[1].strip() - elif key == "no-dapr": - if isinstance(value, str): - use_dapr = not value == "true" - elif isinstance(value, bool): - use_dapr = not value - else: - raise ValueError("Unsupported value type!") elif key == "arg": args.append(value) elif key == "port": @@ -138,7 +129,6 @@ def parse_service_config( image=container_image, is_enabled=is_enabled, env_vars=env_vars, - use_dapr=use_dapr, args=args, ports=ports, port_forwards=port_forwards,