Skip to content

Commit

Permalink
Move shared folder from devcontainer-setup (#12)
Browse files Browse the repository at this point in the history
* Move shared folder from devcontainer-setup
* Update docs
---------

Signed-off-by: Dennis Meister <dennis.meister@bosch.com>
Co-authored-by: Markus Petke <MP91@users.noreply.github.com>
  • Loading branch information
dennismeister93 and MP91 authored Jun 10, 2024
1 parent ae52495 commit 24ada01
Show file tree
Hide file tree
Showing 10 changed files with 723 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build
logs
results
.pytest_cache
.coverage

mkdocs.yml
.generated-files.txt
2 changes: 1 addition & 1 deletion NOTICE-3RD-PARTY-CONTENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Python
| Dependency | Version | License |
|:-----------|:-------:|--------:|
|types-requests|2.32.0.20240521|Apache 2.0|
|types-requests|2.32.0.20240602|Apache 2.0|
|urllib3|2.2.1|MIT|
## Workflows
| Dependency | Version | License |
Expand Down
12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@
## Modules

- [`velocitas_lib`](./velocitas_lib.md#module-velocitas_lib)
- [`velocitas_lib.conan_helper`](./velocitas_lib.conan_helper.md#module-velocitas_libconan_helper)
- [`velocitas_lib.docker`](./velocitas_lib.docker.md#module-velocitas_libdocker)
- [`velocitas_lib.functional_interface`](./velocitas_lib.functional_interface.md#module-velocitas_libfunctional_interface)
- [`velocitas_lib.middleware`](./velocitas_lib.middleware.md#module-velocitas_libmiddleware)
- [`velocitas_lib.services`](./velocitas_lib.services.md#module-velocitas_libservices)
- [`velocitas_lib.templates`](./velocitas_lib.templates.md#module-velocitas_libtemplates)
- [`velocitas_lib.variables`](./velocitas_lib.variables.md#module-velocitas_libvariables)

## Classes

- [`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, args, ports, port_forwards, mounts, startup_log_patterns)
- [`templates.CopySpec`](./velocitas_lib.templates.md#class-copyspec): Copy specification of a single file or directory.
- [`variables.ProjectVariables`](./velocitas_lib.variables.md#class-projectvariables)

## Functions

- [`velocitas_lib.capture_textfile_area`](./velocitas_lib.md#function-capture_textfile_area): Capture an area of a textfile between a matching start line (exclusive) and the first line matching end_line (exclusive).
- [`velocitas_lib.create_log_file`](./velocitas_lib.md#function-create_log_file): Create a log file for the given service and runtime.
- [`velocitas_lib.create_truncated_string`](./velocitas_lib.md#function-create_truncated_string): Create a truncated version of input if it is longer than length.
- [`velocitas_lib.download_file`](./velocitas_lib.md#function-download_file)
- [`velocitas_lib.get_app_manifest`](./velocitas_lib.md#function-get_app_manifest)
- [`velocitas_lib.get_cache_data`](./velocitas_lib.md#function-get_cache_data): Return the data of the cache as Python object.
Expand All @@ -29,8 +34,14 @@
- [`velocitas_lib.get_programming_language`](./velocitas_lib.md#function-get_programming_language): Return the programming language of the project.
- [`velocitas_lib.get_project_cache_dir`](./velocitas_lib.md#function-get_project_cache_dir): Return the project's cache directory.
- [`velocitas_lib.get_script_path`](./velocitas_lib.md#function-get_script_path): Return the absolute path to the directory the invoked Python script
- [`velocitas_lib.get_valid_arch`](./velocitas_lib.md#function-get_valid_arch): Return a known architecture for the given `arch`.
- [`velocitas_lib.get_workspace_dir`](./velocitas_lib.md#function-get_workspace_dir): Return the workspace directory.
- [`velocitas_lib.replace_in_file`](./velocitas_lib.md#function-replace_in_file): Replace all occurrences of text in a file with a replacement.
- [`velocitas_lib.require_env`](./velocitas_lib.md#function-require_env): Require and return an environment variable.
- [`velocitas_lib.to_camel_case`](./velocitas_lib.md#function-to_camel_case): Return a camel case version of a snake case string.
- [`conan_helper.add_dependency_to_conanfile`](./velocitas_lib.conan_helper.md#function-add_dependency_to_conanfile): Add the dependency name to the project's list of dependencies.
- [`conan_helper.export_conan_project`](./velocitas_lib.conan_helper.md#function-export_conan_project): Export a conan project to the local conan cache.
- [`conan_helper.get_required_sdk_version`](./velocitas_lib.conan_helper.md#function-get_required_sdk_version): Return the required version of the core SDK.
- [`docker.build_vehicleapp_image`](./velocitas_lib.docker.md#function-build_vehicleapp_image): Build VehicleApp docker image and display the progress using a spinner.
- [`docker.container_exists`](./velocitas_lib.docker.md#function-container_exists): Check if a container with a given name exists.
- [`docker.is_docker_image_build_locally`](./velocitas_lib.docker.md#function-is_docker_image_build_locally): Check if vehicle app docker image is locally available
Expand All @@ -42,6 +53,7 @@
- [`services.get_specific_service`](./velocitas_lib.services.md#function-get_specific_service): Return the specified service as Python object.
- [`services.parse_service_config`](./velocitas_lib.services.md#function-parse_service_config): Parse service spec configuration and return it as an named tuple.
- [`services.resolve_functions`](./velocitas_lib.services.md#function-resolve_functions)
- [`templates.copy_templates`](./velocitas_lib.templates.md#function-copy_templates): Copy templates from the template dir to the target dir.
- [`variables.json_obj_to_flat_map`](./velocitas_lib.variables.md#function-json_obj_to_flat_map): Flatten a JSON Object into a one dimensional dict by joining the keys


Expand Down
76 changes: 76 additions & 0 deletions docs/velocitas_lib.conan_helper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!-- markdownlint-disable -->

<a href="../velocitas_lib/conan_helper.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

# <kbd>module</kbd> `velocitas_lib.conan_helper`





---

<a href="../velocitas_lib/conan_helper.py#L22"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_required_sdk_version`

```python
get_required_sdk_version() → Optional[str]
```

Return the required version of the core SDK.



**Returns:**

- <b>`Optional[str]`</b>: The required version or None in case SDK is not a dependency.


---

<a href="../velocitas_lib/conan_helper.py#L39"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `export_conan_project`

```python
export_conan_project(conan_project_path: str) → None
```

Export a conan project to the local conan cache.



**Args:**

- <b>`conan_project_path`</b> (str): The path to directory containing the project.


---

<a href="../velocitas_lib/conan_helper.py#L98"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `add_dependency_to_conanfile`

```python
add_dependency_to_conanfile(
dependency_name: str,
dependency_version: str
) → None
```

Add the dependency name to the project's list of dependencies.



**Args:**

- <b>`dependency_name`</b> (str): The dependency to add e.g. grpc
- <b>`dependency_version`</b> (str): The version of the dependency to add e.g. 1.50.1




---

_This file was automatically generated via [lazydocs](https://github.com/ml-tooling/lazydocs)._
150 changes: 140 additions & 10 deletions docs/velocitas_lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,136 @@

<a href="../velocitas_lib/__init__.py#L24"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `to_camel_case`

```python
to_camel_case(snake_str: str) → str
```

Return a camel case version of a snake case string.



**Args:**

- <b>`snake_str`</b> (str): A snake case string.



**Returns:**

- <b>`str`</b>: A camel case version of a snake case string.


---

<a href="../velocitas_lib/__init__.py#L36"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `create_truncated_string`

```python
create_truncated_string(input: str, length: int) → str
```

Create a truncated version of input if it is longer than length. Will keep the rightmost characters and cut of the front if it is longer than allowed.



**Args:**

- <b>`input`</b> (str): The input string.
- <b>`length`</b> (int): The allowed overall length.



**Returns:**

- <b>`str`</b>: A truncated string which has len() of length.


---

<a href="../velocitas_lib/__init__.py#L54"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `replace_in_file`

```python
replace_in_file(file_path: str, text: str, replacement: str) → None
```

Replace all occurrences of text in a file with a replacement.



**Args:**

- <b>`file_path`</b> (str): The path to the file.
- <b>`text`</b> (str): The text to find.
- <b>`replacement`</b> (str): The replacement for text.


---

<a href="../velocitas_lib/__init__.py#L71"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_valid_arch`

```python
get_valid_arch(arch: str) → str
```

Return a known architecture for the given `arch`.



**Args:**

- <b>`arch`</b> (str): The architecture of the profile.



**Returns:**

- <b>`str`</b>: valid architecture.


---

<a href="../velocitas_lib/__init__.py#L88"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `capture_textfile_area`

```python
capture_textfile_area(
file: TextIOWrapper,
start_line: str,
end_line: str,
map_fn: Optional[Callable[[str], str]] = None
) → List[str]
```

Capture an area of a textfile between a matching start line (exclusive) and the first line matching end_line (exclusive).



**Args:**

- <b>`file`</b> (TextIOWrapper): The text file to read from.
- <b>`start_line`</b> (str): The line which triggers the capture (will not be part of the output)
- <b>`end_line`</b> (str): The line which terminates the capture (will not be bart of the output)
- <b>`map_fn`</b> (Optional[Callable[[str], str]], optional): An optional mapping function to transform captured lines. Defaults to None.



**Returns:**

- <b>`List[str]`</b>: A list of captured lines.


---

<a href="../velocitas_lib/__init__.py#L122"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `require_env`

```python
Expand Down Expand Up @@ -41,7 +171,7 @@ Require and return an environment variable.

---

<a href="../velocitas_lib/__init__.py#L42"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L140"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_workspace_dir`

Expand All @@ -54,7 +184,7 @@ Return the workspace directory.

---

<a href="../velocitas_lib/__init__.py#L47"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L145"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_app_manifest`

Expand All @@ -69,7 +199,7 @@ get_app_manifest() → Dict[str, Any]

---

<a href="../velocitas_lib/__init__.py#L57"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L155"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_script_path`

Expand All @@ -82,7 +212,7 @@ Return the absolute path to the directory the invoked Python script is located i

---

<a href="../velocitas_lib/__init__.py#L63"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L161"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_package_path`

Expand All @@ -95,7 +225,7 @@ Return the absolute path to the package directory the invoked Python script belo

---

<a href="../velocitas_lib/__init__.py#L69"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L167"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_project_cache_dir`

Expand All @@ -114,7 +244,7 @@ Return the project's cache directory.

---

<a href="../velocitas_lib/__init__.py#L78"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L176"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_cache_data`

Expand All @@ -127,7 +257,7 @@ Return the data of the cache as Python object.

---

<a href="../velocitas_lib/__init__.py#L88"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L186"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_log_file_name`

Expand All @@ -153,7 +283,7 @@ Build the log file name for the given service and runtime.

---

<a href="../velocitas_lib/__init__.py#L101"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L199"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_programming_language`

Expand All @@ -166,7 +296,7 @@ Return the programming language of the project.

---

<a href="../velocitas_lib/__init__.py#L106"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L204"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `create_log_file`

Expand All @@ -192,7 +322,7 @@ Create a log file for the given service and runtime.

---

<a href="../velocitas_lib/__init__.py#L121"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L219"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `download_file`

Expand Down
Loading

0 comments on commit 24ada01

Please sign in to comment.