airbyte-cdk 6.48.14.post2.dev15055659065__py3-none-any.whl → 6.48.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,6 +39,7 @@ poetry run airbyte-cdk connector --help
39
39
  """
40
40
 
41
41
  import os
42
+ import sys
42
43
  from pathlib import Path
43
44
  from types import ModuleType
44
45
 
@@ -166,10 +167,11 @@ def test(
166
167
  click.echo(f"Collect only: {collect_only}")
167
168
  click.echo(f"Pytest args: {pytest_args}")
168
169
  click.echo("Invoking Pytest...")
169
- pytest.main(
170
+ exit_code = pytest.main(
170
171
  pytest_args,
171
172
  plugins=[],
172
173
  )
174
+ sys.exit(exit_code)
173
175
 
174
176
 
175
177
  __all__ = [
@@ -49,7 +49,12 @@ from airbyte_cdk.utils.connector_paths import (
49
49
  resolve_connector_name_and_directory,
50
50
  )
51
51
 
52
- AIRBYTE_INTERNAL_GCP_PROJECT = "dataline-integration-testing"
52
+ GCP_PROJECT_ID: str = os.environ.get("GCP_PROJECT_ID", "") or "dataline-integration-testing"
53
+ # We put the `or` outside the `get()` because we want the `GCP_PROJECT_ID`
54
+ # env var to be ignored if it contains an empty string, such as in CI where the
55
+ # workflow might set it to a value that is itself actually missing or unset.
56
+ """The GCP project ID to use for fetching integration test secrets."""
57
+
53
58
  CONNECTOR_LABEL = "connector"
54
59
  GLOBAL_MASK_KEYS_URL = "https://connectors.airbyte.com/files/registries/v0/specs_secrets_mask.yaml"
55
60
 
@@ -83,8 +88,11 @@ def secrets_cli_group() -> None:
83
88
  @click.option(
84
89
  "--gcp-project-id",
85
90
  type=str,
86
- default=AIRBYTE_INTERNAL_GCP_PROJECT,
87
- help=f"GCP project ID. Defaults to '{AIRBYTE_INTERNAL_GCP_PROJECT}'.",
91
+ default=GCP_PROJECT_ID,
92
+ help=(
93
+ "GCP project ID for retrieving integration tests credentials. "
94
+ "Defaults to the value of the `GCP_PROJECT_ID` environment variable, if set."
95
+ ),
88
96
  )
89
97
  @click.option(
90
98
  "--print-ci-secrets-masks",
@@ -95,7 +103,7 @@ def secrets_cli_group() -> None:
95
103
  )
96
104
  def fetch(
97
105
  connector: str | Path | None = None,
98
- gcp_project_id: str = AIRBYTE_INTERNAL_GCP_PROJECT,
106
+ gcp_project_id: str = GCP_PROJECT_ID,
99
107
  print_ci_secrets_masks: bool = False,
100
108
  ) -> None:
101
109
  """Fetch secrets for a connector from Google Secret Manager.
@@ -192,41 +200,41 @@ def fetch(
192
200
 
193
201
 
194
202
  @secrets_cli_group.command("list")
195
- @click.option(
196
- "--connector-name",
203
+ @click.argument(
204
+ "connector",
205
+ required=False,
197
206
  type=str,
198
- help="Name of the connector to fetch secrets for. Ignored if --connector-directory is provided.",
199
- )
200
- @click.option(
201
- "--connector-directory",
202
- type=click.Path(exists=True, file_okay=False, path_type=Path),
203
- help="Path to the connector directory.",
207
+ metavar="[CONNECTOR]",
204
208
  )
205
209
  @click.option(
206
210
  "--gcp-project-id",
207
211
  type=str,
208
- default=AIRBYTE_INTERNAL_GCP_PROJECT,
209
- help=f"GCP project ID. Defaults to '{AIRBYTE_INTERNAL_GCP_PROJECT}'.",
212
+ default=GCP_PROJECT_ID,
213
+ help=(
214
+ "GCP project ID for retrieving integration tests credentials. "
215
+ "Defaults to the value of the `GCP_PROJECT_ID` environment variable, if set."
216
+ ),
210
217
  )
211
218
  def list_(
212
- connector_name: str | None = None,
213
- connector_directory: Path | None = None,
214
- gcp_project_id: str = AIRBYTE_INTERNAL_GCP_PROJECT,
219
+ connector: str | Path | None = None,
220
+ *,
221
+ gcp_project_id: str = GCP_PROJECT_ID,
215
222
  ) -> None:
216
223
  """List secrets for a connector from Google Secret Manager.
217
224
 
218
225
  This command fetches secrets for a connector from Google Secret Manager and prints
219
226
  them as a table.
220
227
 
228
+ [CONNECTOR] can be a connector name (e.g. 'source-pokeapi'), a path to a connector directory, or omitted to use the current working directory.
229
+ If a string containing '/' is provided, it is treated as a path. Otherwise, it is treated as a connector name.
230
+
221
231
  If no connector name or directory is provided, we will look within the current working
222
232
  directory. If the current working directory is not a connector directory (e.g. starting
223
233
  with 'source-') and no connector name or path is provided, the process will fail.
224
234
  """
225
235
  click.echo("Scanning secrets...", err=True)
226
236
 
227
- connector_name = connector_name or resolve_connector_name(
228
- connector_directory=connector_directory or Path().resolve().absolute(),
229
- )
237
+ connector_name, _ = resolve_connector_name_and_directory(connector)
230
238
  secrets: list[Secret] = _fetch_secret_handles( # type: ignore
231
239
  connector_name=connector_name,
232
240
  gcp_project_id=gcp_project_id,
@@ -303,7 +311,7 @@ def _get_secret_url(secret_name: str, gcp_project_id: str) -> str:
303
311
 
304
312
  def _fetch_secret_handles(
305
313
  connector_name: str,
306
- gcp_project_id: str = AIRBYTE_INTERNAL_GCP_PROJECT,
314
+ gcp_project_id: str = GCP_PROJECT_ID,
307
315
  ) -> list["Secret"]: # type: ignore
308
316
  """Fetch secrets from Google Secret Manager."""
309
317
  if not secretmanager:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.48.14.post2.dev15055659065
3
+ Version: 6.48.16
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -1,10 +1,10 @@
1
1
  airbyte_cdk/__init__.py,sha256=52uncJvDQNHvwKxaqzXgnMYTptIl65LDJr2fvlk8-DU,11707
2
2
  airbyte_cdk/cli/__init__.py,sha256=CXsai3MYMLZ_sqi2vPAIVcKDun8VRqlv0cKffBI0iSY,346
3
3
  airbyte_cdk/cli/airbyte_cdk/__init__.py,sha256=8IoEcbdYr7CMAh97Xut5__uHH9vV4LKUtSBNTk3qEWY,2031
4
- airbyte_cdk/cli/airbyte_cdk/_connector.py,sha256=drKb_EXJOFX-cSeLwJB8WXE-lesOL0dx2ziWSmW3Jkg,5187
4
+ airbyte_cdk/cli/airbyte_cdk/_connector.py,sha256=PA1beSvhcvm-6watFCrjNat9GC4RpYolC53z2r1V3dc,5234
5
5
  airbyte_cdk/cli/airbyte_cdk/_image.py,sha256=AkBEZrRYXEwvhW7hPOPRWeYEZutzi2PIzjpl7_yaE8I,2890
6
6
  airbyte_cdk/cli/airbyte_cdk/_manifest.py,sha256=aFdeeWgek7oXR3YfZPxk7kBZ64Blmsr0dAXN6BVGiIA,482
7
- airbyte_cdk/cli/airbyte_cdk/_secrets.py,sha256=1IqVz-csoMJoKajSX4DzoWrngswuNHBPkzzchQggAeE,17010
7
+ airbyte_cdk/cli/airbyte_cdk/_secrets.py,sha256=jLtpkhFJHavABN3UuqddeDRGS8v1iEj0e_f6WTeYoQA,17409
8
8
  airbyte_cdk/cli/airbyte_cdk/_version.py,sha256=ohZNIktLFk91sdzqFW5idaNrZAPX2dIRnz---_fcKOE,352
9
9
  airbyte_cdk/cli/airbyte_cdk/exceptions.py,sha256=bsGmlWN6cXL2jCD1WYAZMqFmK1OLg2xLrcC_60KHSeA,803
10
10
  airbyte_cdk/cli/source_declarative_manifest/__init__.py,sha256=-0ST722Nj65bgRokzpzPkD1NBBW5CytEHFUe38cB86Q,91
@@ -419,9 +419,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
419
419
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
420
420
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
421
421
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
422
- airbyte_cdk-6.48.14.post2.dev15055659065.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
423
- airbyte_cdk-6.48.14.post2.dev15055659065.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
424
- airbyte_cdk-6.48.14.post2.dev15055659065.dist-info/METADATA,sha256=AjuFoAUTmKt5Q4DrweJspBD5SE8pT4j-hXVanX4lwbw,6365
425
- airbyte_cdk-6.48.14.post2.dev15055659065.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
426
- airbyte_cdk-6.48.14.post2.dev15055659065.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
427
- airbyte_cdk-6.48.14.post2.dev15055659065.dist-info/RECORD,,
422
+ airbyte_cdk-6.48.16.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
423
+ airbyte_cdk-6.48.16.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
424
+ airbyte_cdk-6.48.16.dist-info/METADATA,sha256=IfVXYSA9oSF6gUmrAro4nKKSm9U92aEGUfXAyVjAxNM,6344
425
+ airbyte_cdk-6.48.16.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
426
+ airbyte_cdk-6.48.16.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
427
+ airbyte_cdk-6.48.16.dist-info/RECORD,,