1
0
mirror of synced 2025-12-19 18:14:56 -05:00

Source Faker: Add support for PyPi and AirbyteLib entrypoints (#34033)

This commit is contained in:
Aaron ("AJ") Steers
2024-01-11 00:16:04 -08:00
committed by GitHub
parent d29cb2d41e
commit 7d7f33c09f
8 changed files with 99 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the // For format details, see https://aka.ms/devcontainer.json. For config options, see the
{ {
"name": "Connector Development DevContainer (Generic)", "name": "Java Development DevContainer (Generic)",
"image": "mcr.microsoft.com/devcontainers/java:0-17", "image": "mcr.microsoft.com/devcontainers/java:0-17",
"features": { "features": {

View File

@@ -0,0 +1,65 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"name": "Python Development DevContainer (Generic)",
"image": "mcr.microsoft.com/devcontainers/python:0-3.10",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker": {},
"ghcr.io/devcontainers/features/python:1": {
"installGradle": true,
"version": "3.10",
"installTools": true
},
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
},
// Deterministic order reduces cache busting
"overrideFeatureInstallOrder": [
"ghcr.io/devcontainers/features/docker-in-docker",
"ghcr.io/devcontainers/features/python",
"ghcr.io/devcontainers-contrib/features/poetry"
],
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
// Python extensions:
"charliermarsh.ruff",
"matangover.mypy",
"ms-python.python",
"ms-python.vscode-pylance",
// Toml support
"tamasfe.even-better-toml",
// Yaml and JSON Schema support:
"redhat.vscode-yaml",
// Contributing:
"GitHub.vscode-pull-request-github"
],
"settings": {
"extensions.ignoreRecommendations": true,
"git.openRepositoryInParentFolders": "always"
}
}
},
// Mark the root directory as 'safe' for git.
"initializeCommand": "git config --add safe.directory /workspaces/airbyte",
// Setup airbyte-ci on the container:
"postCreateCommand": "make tools.airbyte-ci-dev.install",
"containerEnv": {
// Deterministic Poetry virtual env location: `./.venv`
"POETRY_VIRTUALENVS_IN_PROJECT": "true"
}
// Override to change the directory that the IDE opens by default:
// "workspaceFolder": "/workspaces/airbyte"
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

View File

@@ -34,5 +34,5 @@ COPY source_faker ./source_faker
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
LABEL io.airbyte.version=5.0.0 LABEL io.airbyte.version=5.0.1
LABEL io.airbyte.name=airbyte/source-faker LABEL io.airbyte.name=airbyte/source-faker

View File

@@ -3,11 +3,7 @@
# #
import sys from source_faker.run import run
from airbyte_cdk.entrypoint import launch
from source_faker import SourceFaker
if __name__ == "__main__": if __name__ == "__main__":
source = SourceFaker() run()
launch(source, sys.argv[1:])

View File

@@ -7,7 +7,7 @@ data:
connectorSubtype: api connectorSubtype: api
connectorType: source connectorType: source
definitionId: dfd88b22-b603-4c3d-aad7-3701784586b1 definitionId: dfd88b22-b603-4c3d-aad7-3701784586b1
dockerImageTag: 5.0.0 dockerImageTag: 5.0.1
dockerRepository: airbyte/source-faker dockerRepository: airbyte/source-faker
documentationUrl: https://docs.airbyte.com/integrations/sources/faker documentationUrl: https://docs.airbyte.com/integrations/sources/faker
githubIssueLabel: source-faker githubIssueLabel: source-faker
@@ -42,6 +42,10 @@ data:
- products - products
- purchases - purchases
supportLevel: community supportLevel: community
remoteRegistries:
pypi:
enabled: true
packageName: airbyte-source-faker
tags: tags:
- language:python - language:python
metadataSpecVersion: "1.0" metadataSpecVersion: "1.0"

View File

@@ -24,4 +24,10 @@ setup(
extras_require={ extras_require={
"tests": TEST_REQUIREMENTS, "tests": TEST_REQUIREMENTS,
}, },
# register console entry points
entry_points={
"console_scripts": [
"source-faker=source_faker.run:run",
],
},
) )

View File

@@ -0,0 +1,18 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import sys
from airbyte_cdk.entrypoint import launch
from source_faker import SourceFaker
def run():
source = SourceFaker()
launch(source, sys.argv[1:])
if __name__ == "__main__":
run()

View File

@@ -96,6 +96,7 @@ None!
| Version | Date | Pull Request | Subject | | Version | Date | Pull Request | Subject |
|:--------|:-----------|:----------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------| |:--------|:-----------|:----------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------|
| 5.0.1 | 2023-01-08 | [34033](https://github.com/airbytehq/airbyte/pull/34033) | Add standard entrypoints for usage with AirbyteLib |
| 5.0.0 | 2023-08-08 | [29213](https://github.com/airbytehq/airbyte/pull/29213) | Change all `*id` fields and `products.year` to be integer | | 5.0.0 | 2023-08-08 | [29213](https://github.com/airbytehq/airbyte/pull/29213) | Change all `*id` fields and `products.year` to be integer |
| 4.0.0 | 2023-07-19 | [28485](https://github.com/airbytehq/airbyte/pull/28485) | Bump to test publication | | 4.0.0 | 2023-07-19 | [28485](https://github.com/airbytehq/airbyte/pull/28485) | Bump to test publication |
| 3.0.2 | 2023-07-07 | [27807](https://github.com/airbytehq/airbyte/pull/28060) | Bump to test publication | | 3.0.2 | 2023-07-07 | [27807](https://github.com/airbytehq/airbyte/pull/28060) | Bump to test publication |