airbyte-cdk 6.48.7.dev2__py3-none-any.whl → 6.48.8__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.
- airbyte_cdk/cli/airbyte_cdk/_connector.py +18 -20
- airbyte_cdk/cli/airbyte_cdk/_image.py +16 -18
- airbyte_cdk/cli/airbyte_cdk/_secrets.py +14 -33
- airbyte_cdk/destinations/destination.py +50 -78
- airbyte_cdk/models/__init__.py +0 -4
- airbyte_cdk/models/airbyte_protocol_serializers.py +3 -2
- airbyte_cdk/sources/declarative/models/base_model_with_deprecations.py +6 -1
- airbyte_cdk/sources/declarative/schema/dynamic_schema_loader.py +12 -49
- airbyte_cdk/test/catalog_builder.py +1 -9
- airbyte_cdk/test/entrypoint_wrapper.py +4 -0
- airbyte_cdk/test/mock_http/request.py +1 -5
- airbyte_cdk/test/standard_tests/_job_runner.py +9 -6
- airbyte_cdk/test/standard_tests/connector_base.py +22 -15
- airbyte_cdk/test/standard_tests/declarative_sources.py +8 -4
- airbyte_cdk/test/standard_tests/models/scenario.py +14 -3
- airbyte_cdk/test/standard_tests/source_base.py +24 -0
- airbyte_cdk/test/standard_tests/util.py +1 -1
- airbyte_cdk/utils/connector_paths.py +223 -0
- airbyte_cdk/utils/docker.py +116 -29
- {airbyte_cdk-6.48.7.dev2.dist-info → airbyte_cdk-6.48.8.dist-info}/METADATA +2 -2
- {airbyte_cdk-6.48.7.dev2.dist-info → airbyte_cdk-6.48.8.dist-info}/RECORD +25 -27
- airbyte_cdk/cli/airbyte_cdk/_util.py +0 -69
- airbyte_cdk/test/standard_tests/test_resources.py +0 -69
- airbyte_cdk/utils/docker_image_templates.py +0 -136
- {airbyte_cdk-6.48.7.dev2.dist-info → airbyte_cdk-6.48.8.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.48.7.dev2.dist-info → airbyte_cdk-6.48.8.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.48.7.dev2.dist-info → airbyte_cdk-6.48.8.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.48.7.dev2.dist-info → airbyte_cdk-6.48.8.dist-info}/entry_points.txt +0 -0
@@ -1,11 +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=
|
5
|
-
airbyte_cdk/cli/airbyte_cdk/_image.py,sha256=
|
4
|
+
airbyte_cdk/cli/airbyte_cdk/_connector.py,sha256=drKb_EXJOFX-cSeLwJB8WXE-lesOL0dx2ziWSmW3Jkg,5187
|
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=
|
8
|
-
airbyte_cdk/cli/airbyte_cdk/_util.py,sha256=bnzBIAIvuukbOwYwHXay33yAkyyOVJw24xNjNXsPG74,2732
|
7
|
+
airbyte_cdk/cli/airbyte_cdk/_secrets.py,sha256=u8-G44SoVg19FCWjcNDT0brFUZa6g_-He58Nd-VuZHI,13991
|
9
8
|
airbyte_cdk/cli/airbyte_cdk/_version.py,sha256=ohZNIktLFk91sdzqFW5idaNrZAPX2dIRnz---_fcKOE,352
|
10
9
|
airbyte_cdk/cli/source_declarative_manifest/__init__.py,sha256=-0ST722Nj65bgRokzpzPkD1NBBW5CytEHFUe38cB86Q,91
|
11
10
|
airbyte_cdk/cli/source_declarative_manifest/_run.py,sha256=9qtbjt-I_stGWzWX6yVUKO_eE-Ga7g-uTuibML9qLBs,8330
|
@@ -23,7 +22,7 @@ airbyte_cdk/connector_builder/test_reader/message_grouper.py,sha256=84BAEPIBHMq3
|
|
23
22
|
airbyte_cdk/connector_builder/test_reader/reader.py,sha256=mP1yHK5vG38KxoKoT2QQ7ZNbkdLA1rMAU3EKpucjHls,21098
|
24
23
|
airbyte_cdk/connector_builder/test_reader/types.py,sha256=hPZG3jO03kBaPyW94NI3JHRS1jxXGSNBcN1HFzOxo5Y,2528
|
25
24
|
airbyte_cdk/destinations/__init__.py,sha256=FyDp28PT_YceJD5HDFhA-mrGfX9AONIyMQ4d68CHNxQ,213
|
26
|
-
airbyte_cdk/destinations/destination.py,sha256=
|
25
|
+
airbyte_cdk/destinations/destination.py,sha256=CIq-yb8C_0QvcKCtmStaHfiqn53GEfRAIGGCkJhKP1Q,5880
|
27
26
|
airbyte_cdk/destinations/vector_db_based/README.md,sha256=QAe8c_1Afme4r2TCE10cTSaxUE3zgCBuArSuRQqK8tA,2115
|
28
27
|
airbyte_cdk/destinations/vector_db_based/__init__.py,sha256=eAkzwTjBbXBhJ5GfPO5I53Zgpv5xQFLRQS8n4nuyPt0,1006
|
29
28
|
airbyte_cdk/destinations/vector_db_based/config.py,sha256=1u87eibIWLZ_wuaCvE3yp5ayguM9dGhGXbT8agmkUBg,12468
|
@@ -47,9 +46,9 @@ airbyte_cdk/manifest_migrations/migrations/http_requester_request_body_json_data
|
|
47
46
|
airbyte_cdk/manifest_migrations/migrations/http_requester_url_base_to_url.py,sha256=EX1MVYVpoWypA28qoH48wA0SYZjGdlR8bcSixTDzfgo,1346
|
48
47
|
airbyte_cdk/manifest_migrations/migrations/registry.yaml,sha256=K5KBQ2C1T_dWExEJFuEAe1VO_QqOijOCh90rnUOCEyc,960
|
49
48
|
airbyte_cdk/manifest_migrations/migrations_registry.py,sha256=zly2fwaOxDukqC7eowzrDlvhA2v71FjW74kDzvRXhSY,2619
|
50
|
-
airbyte_cdk/models/__init__.py,sha256=
|
49
|
+
airbyte_cdk/models/__init__.py,sha256=Et9wJWs5VOWynGbb-3aJRhsdAHAiLkNNLxdwqJAuqkw,2114
|
51
50
|
airbyte_cdk/models/airbyte_protocol.py,sha256=oZdKsZ7yPjUt9hvxdWNpxCtgjSV2RWhf4R9Np03sqyY,3613
|
52
|
-
airbyte_cdk/models/airbyte_protocol_serializers.py,sha256=
|
51
|
+
airbyte_cdk/models/airbyte_protocol_serializers.py,sha256=s6SaFB2CMrG_7jTQGn_fhFbQ1FUxhCxf5kq2RWGHMVI,1749
|
53
52
|
airbyte_cdk/models/connector_metadata.py,sha256=Lwb0JKiWvnqHduXjHHgBBBhTsGoLiNjxbG93W_OjcKQ,2875
|
54
53
|
airbyte_cdk/models/well_known_types.py,sha256=EquepbisGPuCSrs_D7YVVnMR9-ShhUr21wnFz3COiJs,156
|
55
54
|
airbyte_cdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -132,7 +131,7 @@ airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW
|
|
132
131
|
airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=iemy3fKLczcU0-Aor7tx5jcT6DRedKMqyK7kCOp01hg,3924
|
133
132
|
airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
|
134
133
|
airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
|
135
|
-
airbyte_cdk/sources/declarative/models/base_model_with_deprecations.py,sha256=
|
134
|
+
airbyte_cdk/sources/declarative/models/base_model_with_deprecations.py,sha256=Imnj3yef0aqRdLfaUxkIYISUb8YkiPrRH_wBd-x8HjM,5999
|
136
135
|
airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=P0l-NiKm873uBZ0x6vRJK2u4P-XPTGeTWMnhafKryRw,117940
|
137
136
|
airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
|
138
137
|
airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=nlVvHC511NUyDEEIRBkoeDTAvLqKNp-hRy8D19z8tdk,5941
|
@@ -210,7 +209,7 @@ airbyte_cdk/sources/declarative/retrievers/retriever.py,sha256=XPLs593Xv8c5cKMc3
|
|
210
209
|
airbyte_cdk/sources/declarative/retrievers/simple_retriever.py,sha256=O7qpM71L1_ATIbEKa8y658jdiSJSPw0KmuGKgnaruQU,31008
|
211
210
|
airbyte_cdk/sources/declarative/schema/__init__.py,sha256=xU45UvM5O4c1PSM13UHpCdh5hpW3HXy9vRRGEiAC1rg,795
|
212
211
|
airbyte_cdk/sources/declarative/schema/default_schema_loader.py,sha256=UnbzlExmwoQiVV8zDg4lhAEaqA_0pRfwbMRe8yqOuWk,1834
|
213
|
-
airbyte_cdk/sources/declarative/schema/dynamic_schema_loader.py,sha256=
|
212
|
+
airbyte_cdk/sources/declarative/schema/dynamic_schema_loader.py,sha256=J8Q_iJYhcSQLWyt0bTZCbDAGpxt9G8FCc6Q9jtGsNzw,10703
|
214
213
|
airbyte_cdk/sources/declarative/schema/inline_schema_loader.py,sha256=bVETE10hRsatRJq3R3BeyRR0wIoK3gcP1gcpVRQ_P5U,464
|
215
214
|
airbyte_cdk/sources/declarative/schema/json_file_schema_loader.py,sha256=5Wl-fqW-pVf_dxJ4yGHMAFfC4JjKHYJhqFJT1xA57F4,4177
|
216
215
|
airbyte_cdk/sources/declarative/schema/schema_loader.py,sha256=kjt8v0N5wWKA5zyLnrDLxf1PJKdUqvQq2RVnAOAzNSY,379
|
@@ -364,25 +363,24 @@ airbyte_cdk/sql/shared/catalog_providers.py,sha256=qiahORhtN6qBUGHhSKmzE00uC4i6W
|
|
364
363
|
airbyte_cdk/sql/shared/sql_processor.py,sha256=1CwfC3fp9dWnHBpKtly7vGduf9ho_MahiwxGFcULG3Y,27687
|
365
364
|
airbyte_cdk/sql/types.py,sha256=XEIhRAo_ASd0kVLBkdLf5bHiRhNple-IJrC9TibcDdY,5880
|
366
365
|
airbyte_cdk/test/__init__.py,sha256=f_XdkOg4_63QT2k3BbKY34209lppwgw-svzfZstQEq4,199
|
367
|
-
airbyte_cdk/test/catalog_builder.py,sha256
|
368
|
-
airbyte_cdk/test/entrypoint_wrapper.py,sha256=
|
366
|
+
airbyte_cdk/test/catalog_builder.py,sha256=-y05Cz1x0Dlk6oE9LSKhCozssV2gYBNtMdV5YYOPOtk,3015
|
367
|
+
airbyte_cdk/test/entrypoint_wrapper.py,sha256=UsuvbgXDki00-hgpQgTeoSTr_Sxv6UXYfymHM0jhGwg,10074
|
369
368
|
airbyte_cdk/test/mock_http/__init__.py,sha256=jE5kC6CQ0OXkTqKhciDnNVZHesBFVIA2YvkdFGwva7k,322
|
370
369
|
airbyte_cdk/test/mock_http/matcher.py,sha256=4Qj8UnJKZIs-eodshryce3SN1Ayc8GZpBETmP6hTEyc,1446
|
371
370
|
airbyte_cdk/test/mock_http/mocker.py,sha256=XgsjMtVoeMpRELPyALgrkHFauH9H5irxrz1Kcxh2yFY,8013
|
372
|
-
airbyte_cdk/test/mock_http/request.py,sha256=
|
371
|
+
airbyte_cdk/test/mock_http/request.py,sha256=tdB8cqk2vLgCDTOKffBKsM06llYs4ZecgtH6DKyx6yY,4112
|
373
372
|
airbyte_cdk/test/mock_http/response.py,sha256=s4-cQQqTtmeej0pQDWqmG0vUWpHS-93lIWMpW3zSVyU,662
|
374
373
|
airbyte_cdk/test/mock_http/response_builder.py,sha256=F-v7ebftqGj7YVIMLKdodmU9U8Dq8aIyllWGo2NGwHc,8331
|
375
374
|
airbyte_cdk/test/standard_tests/__init__.py,sha256=YS2bghoGmQ-4GNIbe6RuEmvV-V1kpM1OyxTpebrs0Ig,1338
|
376
|
-
airbyte_cdk/test/standard_tests/_job_runner.py,sha256=
|
377
|
-
airbyte_cdk/test/standard_tests/connector_base.py,sha256=
|
378
|
-
airbyte_cdk/test/standard_tests/declarative_sources.py,sha256=
|
375
|
+
airbyte_cdk/test/standard_tests/_job_runner.py,sha256=k-gwwXtIJbh0BwH71uTST9LLx246RrnZMchACz-vIS8,6014
|
376
|
+
airbyte_cdk/test/standard_tests/connector_base.py,sha256=NMA0x8CA1tQYRhSv1x9lBxkveGfqaRHHt7ggxKAXgfA,6970
|
377
|
+
airbyte_cdk/test/standard_tests/declarative_sources.py,sha256=vzpW507HUPtYgP5VEK1MAR_mt1Gq2nk40sjNhKie5yM,3402
|
379
378
|
airbyte_cdk/test/standard_tests/destination_base.py,sha256=MARZip2mdo_PzGvzf2VBTAfrP4tbjrJYgeJUApnAArA,731
|
380
379
|
airbyte_cdk/test/standard_tests/models/__init__.py,sha256=bS25WlzQwPNxpU5DHtUDZo1DuXd0LkEv9qesNhY1jkY,135
|
381
|
-
airbyte_cdk/test/standard_tests/models/scenario.py,sha256=
|
380
|
+
airbyte_cdk/test/standard_tests/models/scenario.py,sha256=kvuc5oIH-TA3TS7xtiz1RQ8tcY_WC0aI6-TsDQAqhUA,2710
|
382
381
|
airbyte_cdk/test/standard_tests/pytest_hooks.py,sha256=4OMy2jNQThS8y7Tyj8MiMy2-SWjoefD4lGo-zQmCUfU,1886
|
383
|
-
airbyte_cdk/test/standard_tests/source_base.py,sha256=
|
384
|
-
airbyte_cdk/test/standard_tests/
|
385
|
-
airbyte_cdk/test/standard_tests/util.py,sha256=eeRP_WFEaIs4x-JnpQ7wWIA938zdDyDhvOeeAf0AnOs,2933
|
382
|
+
airbyte_cdk/test/standard_tests/source_base.py,sha256=cprlvFIRy0xqsLwAC38I9zWlxC2-PJapdje9kRGjTek,6047
|
383
|
+
airbyte_cdk/test/standard_tests/util.py,sha256=JrTXxLpcMvRJhnJDVzY8Y-TmcWhW7GGfNOnbS3v0pR4,2920
|
386
384
|
airbyte_cdk/test/state_builder.py,sha256=kLPql9lNzUJaBg5YYRLJlY_Hy5JLHJDVyKPMZMoYM44,946
|
387
385
|
airbyte_cdk/test/utils/__init__.py,sha256=Hu-1XT2KDoYjDF7-_ziDwv5bY3PueGjANOCbzeOegDg,57
|
388
386
|
airbyte_cdk/test/utils/data.py,sha256=CkCR1_-rujWNmPXFR1IXTMwx1rAl06wAyIKWpDcN02w,820
|
@@ -392,11 +390,11 @@ airbyte_cdk/test/utils/reading.py,sha256=SOTDYlps6Te9KumfTJ3vVDSm9EUXhvKtE8aD7gv
|
|
392
390
|
airbyte_cdk/utils/__init__.py,sha256=qhnC02DbS35OY8oB_tkYHwZzHed2FZeBM__G8IOgckY,347
|
393
391
|
airbyte_cdk/utils/airbyte_secrets_utils.py,sha256=wEtRnl5KRhN6eLJwrDrC4FJjyqt_4vkA1F65mdl8c24,3142
|
394
392
|
airbyte_cdk/utils/analytics_message.py,sha256=bi3uugQ2NjecnwTnz63iD5D1M8ZR8mXPbdtt6w5cC4s,653
|
393
|
+
airbyte_cdk/utils/connector_paths.py,sha256=3yIa3855Cf3EQiiQ6ILMovsjf8UcPsdAuQGfryOhYgE,8675
|
395
394
|
airbyte_cdk/utils/constants.py,sha256=QzCi7j5SqpI5I06uRvQ8FC73JVJi7rXaRnR3E_gro5c,108
|
396
395
|
airbyte_cdk/utils/datetime_format_inferrer.py,sha256=Ne2cpk7Tx3eZDEW2Q3O7jnNOY9g-w-AUMt3Ltvwg1tY,3989
|
397
396
|
airbyte_cdk/utils/datetime_helpers.py,sha256=8mqzZ67Or2PBp7tLtrhh6XFv4wFzYsjCL_DOQJRaftI,17751
|
398
|
-
airbyte_cdk/utils/docker.py,sha256=
|
399
|
-
airbyte_cdk/utils/docker_image_templates.py,sha256=X8f_aRgt_x8yIbrTfsSWw_oIERu65a8hNttcgXA7hlw,3417
|
397
|
+
airbyte_cdk/utils/docker.py,sha256=NS35XgIc6FbFg9IxzDazHrxqmzmi9fjA46qdDfTQ4e0,14585
|
400
398
|
airbyte_cdk/utils/event_timing.py,sha256=aiuFmPU80buLlNdKq4fDTEqqhEIelHPF6AalFGwY8as,2557
|
401
399
|
airbyte_cdk/utils/is_cloud_environment.py,sha256=DayV32Irh-SdnJ0MnjvstwCJ66_l5oEsd8l85rZtHoc,574
|
402
400
|
airbyte_cdk/utils/mapping_helpers.py,sha256=nWjOpnz_5QE9tY9-GtSWMPvYQL95kDD6k8KwwjUmrh0,6526
|
@@ -408,9 +406,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
|
|
408
406
|
airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
|
409
407
|
airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
|
410
408
|
airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
|
411
|
-
airbyte_cdk-6.48.
|
412
|
-
airbyte_cdk-6.48.
|
413
|
-
airbyte_cdk-6.48.
|
414
|
-
airbyte_cdk-6.48.
|
415
|
-
airbyte_cdk-6.48.
|
416
|
-
airbyte_cdk-6.48.
|
409
|
+
airbyte_cdk-6.48.8.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
|
410
|
+
airbyte_cdk-6.48.8.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
|
411
|
+
airbyte_cdk-6.48.8.dist-info/METADATA,sha256=gQiRbc6HRb4QPQI11ZgGUycoAiYz1PCR0eJM_WQTTw8,6343
|
412
|
+
airbyte_cdk-6.48.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
413
|
+
airbyte_cdk-6.48.8.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
|
414
|
+
airbyte_cdk-6.48.8.dist-info/RECORD,,
|
@@ -1,69 +0,0 @@
|
|
1
|
-
"""Common utilities for Airbyte CDK CLI."""
|
2
|
-
|
3
|
-
from pathlib import Path
|
4
|
-
|
5
|
-
from airbyte_cdk.test.standard_tests.test_resources import find_connector_root_from_name
|
6
|
-
|
7
|
-
|
8
|
-
def resolve_connector_name_and_directory(
|
9
|
-
connector_name: str | None = None,
|
10
|
-
connector_directory: Path | None = None,
|
11
|
-
) -> tuple[str, Path]:
|
12
|
-
"""Resolve the connector name and directory.
|
13
|
-
|
14
|
-
This function will resolve the connector name and directory based on the provided
|
15
|
-
arguments. If no connector name or directory is provided, it will look within the
|
16
|
-
current working directory. If the current working directory is not a connector
|
17
|
-
directory (e.g. starting with 'source-') and no connector name or path is provided,
|
18
|
-
the process will fail.
|
19
|
-
"""
|
20
|
-
if not connector_directory:
|
21
|
-
if connector_name:
|
22
|
-
connector_directory = find_connector_root_from_name(connector_name)
|
23
|
-
else:
|
24
|
-
cwd = Path().resolve().absolute()
|
25
|
-
if cwd.name.startswith("source-") or cwd.name.startswith("destination-"):
|
26
|
-
connector_directory = cwd
|
27
|
-
else:
|
28
|
-
raise ValueError(
|
29
|
-
"Either connector_name or connector_directory must be provided if not "
|
30
|
-
"running from a connector directory."
|
31
|
-
)
|
32
|
-
|
33
|
-
if not connector_name:
|
34
|
-
connector_name = connector_directory.name
|
35
|
-
|
36
|
-
if connector_directory:
|
37
|
-
connector_directory = connector_directory.resolve().absolute()
|
38
|
-
elif connector_name:
|
39
|
-
connector_directory = find_connector_root_from_name(connector_name)
|
40
|
-
else:
|
41
|
-
raise ValueError("Either connector_name or connector_directory must be provided.")
|
42
|
-
|
43
|
-
return connector_name, connector_directory
|
44
|
-
|
45
|
-
|
46
|
-
def resolve_connector_name(
|
47
|
-
connector_directory: Path,
|
48
|
-
) -> str:
|
49
|
-
"""Resolve the connector name.
|
50
|
-
|
51
|
-
This function will resolve the connector name based on the provided connector directory.
|
52
|
-
If the current working directory is not a connector directory
|
53
|
-
(e.g. starting with 'source-'), the process will fail.
|
54
|
-
|
55
|
-
Raises:
|
56
|
-
FileNotFoundError: If the connector directory does not exist or cannot be found.
|
57
|
-
"""
|
58
|
-
if not connector_directory:
|
59
|
-
raise FileNotFoundError(
|
60
|
-
"Connector directory does not exist or cannot be found. Please provide a valid "
|
61
|
-
"connector directory."
|
62
|
-
)
|
63
|
-
connector_name = connector_directory.absolute().name
|
64
|
-
if not connector_name.startswith("source-") and not connector_name.startswith("destination-"):
|
65
|
-
raise ValueError(
|
66
|
-
f"Connector directory '{connector_name}' does not look like a valid connector directory. "
|
67
|
-
f"Full path: {connector_directory.absolute()}"
|
68
|
-
)
|
69
|
-
return connector_name
|
@@ -1,69 +0,0 @@
|
|
1
|
-
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
|
2
|
-
"""Resources for Airbyte CDK tests."""
|
3
|
-
|
4
|
-
from contextlib import suppress
|
5
|
-
from pathlib import Path
|
6
|
-
|
7
|
-
ACCEPTANCE_TEST_CONFIG = "acceptance-test-config.yml"
|
8
|
-
MANIFEST_YAML = "manifest.yaml"
|
9
|
-
METADATA_YAML = "metadata.yaml"
|
10
|
-
|
11
|
-
|
12
|
-
def find_connector_root(from_paths: list[Path]) -> Path:
|
13
|
-
"""Find the root directory of the connector."""
|
14
|
-
for path in from_paths:
|
15
|
-
# If we reach here, we didn't find the manifest file in any parent directory
|
16
|
-
# Check if the manifest file exists in the current directory
|
17
|
-
for parent in [path, *path.parents]:
|
18
|
-
if (parent / METADATA_YAML).exists():
|
19
|
-
return parent
|
20
|
-
if (parent / MANIFEST_YAML).exists():
|
21
|
-
return parent
|
22
|
-
if (parent / ACCEPTANCE_TEST_CONFIG).exists():
|
23
|
-
return parent
|
24
|
-
if parent.name == "airbyte_cdk":
|
25
|
-
break
|
26
|
-
|
27
|
-
raise FileNotFoundError(
|
28
|
-
"Could not find connector root directory relative to the provided directories: "
|
29
|
-
f"'{str(from_paths)}'."
|
30
|
-
)
|
31
|
-
|
32
|
-
|
33
|
-
def find_connector_root_from_name(connector_name: str) -> Path:
|
34
|
-
"""Find the root directory of the connector from its name."""
|
35
|
-
with suppress(FileNotFoundError):
|
36
|
-
return find_connector_root([Path(connector_name)])
|
37
|
-
|
38
|
-
# If the connector name is not found, check if we are in the airbyte monorepo
|
39
|
-
# and try to find the connector root from the current directory.
|
40
|
-
|
41
|
-
cwd: Path = Path().absolute()
|
42
|
-
|
43
|
-
if "airbyte" not in cwd.parts:
|
44
|
-
raise FileNotFoundError(
|
45
|
-
"Could not find connector root directory relative and we are not in the airbyte repo. "
|
46
|
-
f"Current directory: {cwd} "
|
47
|
-
)
|
48
|
-
|
49
|
-
# Find the connector root from the current directory
|
50
|
-
|
51
|
-
airbyte_repo_root: Path
|
52
|
-
for parent in [cwd, *cwd.parents]:
|
53
|
-
if parent.name == "airbyte":
|
54
|
-
airbyte_repo_root = parent
|
55
|
-
break
|
56
|
-
else:
|
57
|
-
raise FileNotFoundError(
|
58
|
-
"Could not find connector root directory relative and we are not in the airbyte repo."
|
59
|
-
)
|
60
|
-
|
61
|
-
expected_connector_dir: Path = (
|
62
|
-
airbyte_repo_root / "airbyte-integrations" / "connectors" / connector_name
|
63
|
-
)
|
64
|
-
if not expected_connector_dir.exists():
|
65
|
-
raise FileNotFoundError(
|
66
|
-
f"Could not find connector directory '{expected_connector_dir}' relative to the airbyte repo."
|
67
|
-
)
|
68
|
-
|
69
|
-
return expected_connector_dir
|
@@ -1,136 +0,0 @@
|
|
1
|
-
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
|
2
|
-
"""A collection of Dockerfile templates for building Airbyte connectors.
|
3
|
-
|
4
|
-
The templates are designed to be used with the Airbyte CDK and can be customized
|
5
|
-
for different connectors and architectures.
|
6
|
-
|
7
|
-
These templates are used to generate connector images.
|
8
|
-
"""
|
9
|
-
|
10
|
-
##############################
|
11
|
-
## GLOBAL DOCKERIGNORE FILE ##
|
12
|
-
##############################
|
13
|
-
|
14
|
-
DOCKERIGNORE_TEMPLATE: str = "\n".join(
|
15
|
-
[
|
16
|
-
"# This file is auto-generated. Do not edit.",
|
17
|
-
"*," # Ignore everything not explicitly allowed below
|
18
|
-
"build/",
|
19
|
-
"!build/distributions/*.tar",
|
20
|
-
".venv/",
|
21
|
-
"secrets/",
|
22
|
-
"!setup.py",
|
23
|
-
"!pyproject.toml",
|
24
|
-
"!poetry.lock",
|
25
|
-
"!poetry.toml",
|
26
|
-
"!components.py",
|
27
|
-
"!requirements.txt",
|
28
|
-
"!README.md",
|
29
|
-
"!metadata.yaml",
|
30
|
-
"!build_customization.py",
|
31
|
-
"!source_*",
|
32
|
-
"!destination_*",
|
33
|
-
]
|
34
|
-
)
|
35
|
-
|
36
|
-
###########################
|
37
|
-
# PYTHON CONNECTOR IMAGE ##
|
38
|
-
###########################
|
39
|
-
|
40
|
-
PYTHON_CONNECTOR_DOCKERFILE_TEMPLATE = r"""
|
41
|
-
# syntax=docker/dockerfile:1
|
42
|
-
# check=skip=all
|
43
|
-
ARG BASE_IMAGE
|
44
|
-
|
45
|
-
FROM ${BASE_IMAGE} AS builder
|
46
|
-
ARG BASE_IMAGE
|
47
|
-
ARG CONNECTOR_SNAKE_NAME
|
48
|
-
ARG CONNECTOR_KEBAB_NAME
|
49
|
-
ARG EXTRA_PREREQS_SCRIPT=""
|
50
|
-
|
51
|
-
WORKDIR /airbyte/integration_code
|
52
|
-
|
53
|
-
COPY . ./
|
54
|
-
|
55
|
-
# Conditionally copy and execute the extra build script if provided
|
56
|
-
RUN if [ -n "${EXTRA_PREREQS_SCRIPT}" ]; then \
|
57
|
-
cp ${EXTRA_PREREQS_SCRIPT} ./extra_prereqs_script && \
|
58
|
-
./extra_prereqs_script; \
|
59
|
-
fi
|
60
|
-
|
61
|
-
# TODO: Pre-install uv on the base image to speed up the build.
|
62
|
-
# (uv is still faster even with the extra step.)
|
63
|
-
RUN pip install --no-cache-dir uv
|
64
|
-
RUN python -m uv pip install --no-cache-dir .
|
65
|
-
|
66
|
-
FROM ${BASE_IMAGE}
|
67
|
-
ARG CONNECTOR_SNAKE_NAME
|
68
|
-
ARG CONNECTOR_KEBAB_NAME
|
69
|
-
ARG BASE_IMAGE
|
70
|
-
|
71
|
-
WORKDIR /airbyte/integration_code
|
72
|
-
|
73
|
-
COPY --from=builder /usr/local /usr/local
|
74
|
-
COPY --chmod=755 <<EOT /entrypoint.sh
|
75
|
-
#!/usr/bin/env bash
|
76
|
-
set -e
|
77
|
-
|
78
|
-
${CONNECTOR_KEBAB_NAME} "\$\@"
|
79
|
-
EOT
|
80
|
-
|
81
|
-
ENV AIRBYTE_ENTRYPOINT="/entrypoint.sh"
|
82
|
-
ENTRYPOINT ["/entrypoint.sh"]
|
83
|
-
"""
|
84
|
-
|
85
|
-
##################################
|
86
|
-
# MANIFEST-ONLY CONNECTOR IMAGE ##
|
87
|
-
##################################
|
88
|
-
|
89
|
-
MANIFEST_ONLY_DOCKERFILE_TEMPLATE = """
|
90
|
-
ARG BASE_IMAGE
|
91
|
-
ARG CONNECTOR_SNAKE_NAME
|
92
|
-
ARG CONNECTOR_KEBAB_NAME
|
93
|
-
|
94
|
-
FROM ${BASE_IMAGE}
|
95
|
-
|
96
|
-
WORKDIR /airbyte/integration_code
|
97
|
-
|
98
|
-
COPY . ./
|
99
|
-
|
100
|
-
ENV AIRBYTE_ENTRYPOINT="python ./main.py"
|
101
|
-
ENTRYPOINT ["python", "./main.py"]
|
102
|
-
"""
|
103
|
-
|
104
|
-
#########################
|
105
|
-
# JAVA CONNECTOR IMAGE ##
|
106
|
-
#########################
|
107
|
-
|
108
|
-
JAVA_CONNECTOR_DOCKERFILE_TEMPLATE = """
|
109
|
-
# Java connector Dockerfile for Airbyte
|
110
|
-
|
111
|
-
# Build arguments
|
112
|
-
ARG BASE_IMAGE
|
113
|
-
|
114
|
-
# Base image - using Amazon Corretto (Amazon's distribution of OpenJDK)
|
115
|
-
FROM ${BASE_IMAGE}
|
116
|
-
ARG CONNECTOR_KEBAB_NAME
|
117
|
-
|
118
|
-
# Set permissions for downloaded files
|
119
|
-
RUN chmod +x /airbyte/base.sh /airbyte/javabase.sh && \
|
120
|
-
chown airbyte:airbyte /airbyte/base.sh /airbyte/javabase.sh /airbyte/dd-java-agent.jar
|
121
|
-
|
122
|
-
ENV AIRBYTE_ENTRYPOINT="/airbyte/base.sh"
|
123
|
-
ENV APPLICATION="${CONNECTOR_KEBAB_NAME}"
|
124
|
-
|
125
|
-
# Add the connector TAR file and extract it
|
126
|
-
COPY ./build/distributions/${CONNECTOR_KEBAB_NAME}.tar /tmp/${CONNECTOR_KEBAB_NAME}.tar
|
127
|
-
RUN tar xf /tmp/${CONNECTOR_KEBAB_NAME}.tar --strip-components=1 -C /airbyte && \
|
128
|
-
rm -rf /tmp/${CONNECTOR_KEBAB_NAME}.tar && \
|
129
|
-
chown -R airbyte:airbyte /airbyte
|
130
|
-
|
131
|
-
# Set the non-root user
|
132
|
-
USER airbyte
|
133
|
-
|
134
|
-
# Set entrypoint
|
135
|
-
ENTRYPOINT ["/airbyte/base.sh"]
|
136
|
-
"""
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|