forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal poetry packages: declare poe tasks and airbyte-ci sections i…
…n pyproject.toml (airbytehq#34735)
- Loading branch information
1 parent
e5315fb
commit 82a5c00
Showing
11 changed files
with
552 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/test/models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
|
||
import os | ||
from typing import Dict, Set | ||
|
||
from pydantic import BaseModel, Field, validator | ||
|
||
|
||
class AirbyteCiPackageConfiguration(BaseModel): | ||
poe_tasks: Set[str] = Field(..., description="List of unique poe tasks to run") | ||
required_environment_variables: Set[str] = Field( | ||
set(), description="List of unique required environment variables to pass to the container running the poe task" | ||
) | ||
extra_poetry_groups: Set[str] = Field(set(), description="List of unique extra poetry groups to install") | ||
side_car_docker_engine: bool = Field( | ||
False, description="Flag indicating the use of a sidecar Docker engine during the poe task executions" | ||
) | ||
mount_docker_socket: bool = Field( | ||
False, | ||
description="Flag indicating the mount of the host docker socket to the container running the poe task, useful when the package under test is using dagger", | ||
) | ||
|
||
@validator("required_environment_variables") | ||
def check_required_environment_variables_are_set(cls, value: Set) -> Set: | ||
for required_env_var in value: | ||
if required_env_var not in os.environ: | ||
raise ValueError(f"Environment variable {required_env_var} is not set.") | ||
return value | ||
|
||
|
||
def deserialize_airbyte_ci_config(pyproject_toml: Dict) -> AirbyteCiPackageConfiguration: | ||
try: | ||
airbyte_ci_config = pyproject_toml["tool"]["airbyte_ci"] | ||
except KeyError: | ||
raise ValueError("Missing tool.airbyte_ci configuration in pyproject.toml") | ||
return AirbyteCiPackageConfiguration.parse_obj(airbyte_ci_config) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters