airbyte-source-azure-blob-storage 0.3.4__tar.gz → 0.3.5__tar.gz

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.

Potentially problematic release.


This version of airbyte-source-azure-blob-storage might be problematic. Click here for more details.

Files changed (32) hide show
  1. airbyte_source_azure_blob_storage-0.3.5/PKG-INFO +112 -0
  2. airbyte_source_azure_blob_storage-0.3.5/README.md +91 -0
  3. airbyte_source_azure_blob_storage-0.3.5/pyproject.toml +45 -0
  4. {airbyte-source-azure-blob-storage-0.3.4 → airbyte_source_azure_blob_storage-0.3.5}/source_azure_blob_storage/run.py +2 -0
  5. airbyte-source-azure-blob-storage-0.3.4/PKG-INFO +0 -142
  6. airbyte-source-azure-blob-storage-0.3.4/README.md +0 -149
  7. airbyte-source-azure-blob-storage-0.3.4/airbyte_source_azure_blob_storage.egg-info/PKG-INFO +0 -142
  8. airbyte-source-azure-blob-storage-0.3.4/airbyte_source_azure_blob_storage.egg-info/SOURCES.txt +0 -28
  9. airbyte-source-azure-blob-storage-0.3.4/airbyte_source_azure_blob_storage.egg-info/dependency_links.txt +0 -1
  10. airbyte-source-azure-blob-storage-0.3.4/airbyte_source_azure_blob_storage.egg-info/entry_points.txt +0 -2
  11. airbyte-source-azure-blob-storage-0.3.4/airbyte_source_azure_blob_storage.egg-info/requires.txt +0 -8
  12. airbyte-source-azure-blob-storage-0.3.4/airbyte_source_azure_blob_storage.egg-info/top_level.txt +0 -2
  13. airbyte-source-azure-blob-storage-0.3.4/integration_tests/__init__.py +0 -3
  14. airbyte-source-azure-blob-storage-0.3.4/integration_tests/abnormal_states/avro.json +0 -12
  15. airbyte-source-azure-blob-storage-0.3.4/integration_tests/abnormal_states/csv.json +0 -12
  16. airbyte-source-azure-blob-storage-0.3.4/integration_tests/abnormal_states/jsonl.json +0 -12
  17. airbyte-source-azure-blob-storage-0.3.4/integration_tests/abnormal_states/jsonl_newlines.json +0 -14
  18. airbyte-source-azure-blob-storage-0.3.4/integration_tests/abnormal_states/parquet.json +0 -18
  19. airbyte-source-azure-blob-storage-0.3.4/integration_tests/acceptance.py +0 -16
  20. airbyte-source-azure-blob-storage-0.3.4/integration_tests/configured_catalog.json +0 -14
  21. airbyte-source-azure-blob-storage-0.3.4/integration_tests/configured_catalogs/avro.json +0 -38
  22. airbyte-source-azure-blob-storage-0.3.4/integration_tests/configured_catalogs/csv.json +0 -35
  23. airbyte-source-azure-blob-storage-0.3.4/integration_tests/configured_catalogs/jsonl.json +0 -41
  24. airbyte-source-azure-blob-storage-0.3.4/integration_tests/configured_catalogs/parquet.json +0 -74
  25. airbyte-source-azure-blob-storage-0.3.4/integration_tests/spec.json +0 -387
  26. airbyte-source-azure-blob-storage-0.3.4/setup.cfg +0 -138
  27. airbyte-source-azure-blob-storage-0.3.4/setup.py +0 -41
  28. {airbyte-source-azure-blob-storage-0.3.4 → airbyte_source_azure_blob_storage-0.3.5}/source_azure_blob_storage/__init__.py +0 -0
  29. {airbyte-source-azure-blob-storage-0.3.4 → airbyte_source_azure_blob_storage-0.3.5}/source_azure_blob_storage/config.py +0 -0
  30. {airbyte-source-azure-blob-storage-0.3.4 → airbyte_source_azure_blob_storage-0.3.5}/source_azure_blob_storage/legacy_config_transformer.py +0 -0
  31. {airbyte-source-azure-blob-storage-0.3.4 → airbyte_source_azure_blob_storage-0.3.5}/source_azure_blob_storage/source.py +0 -0
  32. {airbyte-source-azure-blob-storage-0.3.4 → airbyte_source_azure_blob_storage-0.3.5}/source_azure_blob_storage/stream_reader.py +0 -0
@@ -0,0 +1,112 @@
1
+ Metadata-Version: 2.1
2
+ Name: airbyte-source-azure-blob-storage
3
+ Version: 0.3.5
4
+ Summary: Source implementation for Azure Blob Storage.
5
+ Home-page: https://airbyte.com
6
+ License: MIT
7
+ Author: Airbyte
8
+ Author-email: contact@airbyte.io
9
+ Requires-Python: >=3.9,<3.12
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Requires-Dist: airbyte-cdk[file-based] (==0.75)
16
+ Requires-Dist: pytz (==2024.1)
17
+ Requires-Dist: smart-open[azure] (==6.4.0)
18
+ Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/azure-blob-storage
19
+ Project-URL: Repository, https://github.com/airbytehq/airbyte
20
+ Description-Content-Type: text/markdown
21
+
22
+ # Azure-Blob-Storage source connector
23
+
24
+
25
+ This is the repository for the Azure-Blob-Storage source connector, written in Python.
26
+ For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/azure-blob-storage).
27
+
28
+ ## Local development
29
+
30
+ ### Prerequisites
31
+ * Python (~=3.9)
32
+ * Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
33
+
34
+
35
+ ### Installing the connector
36
+ From this connector directory, run:
37
+ ```bash
38
+ poetry install --with dev
39
+ ```
40
+
41
+
42
+ ### Create credentials
43
+ **If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/azure-blob-storage)
44
+ to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_azure_blob_storage/spec.yaml` file.
45
+ Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
46
+ See `sample_files/sample_config.json` for a sample config file.
47
+
48
+
49
+ ### Locally running the connector
50
+ ```
51
+ poetry run source-azure-blob-storage spec
52
+ poetry run source-azure-blob-storage check --config secrets/config.json
53
+ poetry run source-azure-blob-storage discover --config secrets/config.json
54
+ poetry run source-azure-blob-storage read --config secrets/config.json --catalog sample_files/configured_catalog.json
55
+ ```
56
+
57
+ ### Running unit tests
58
+ To run unit tests locally, from the connector directory run:
59
+ ```
60
+ poetry run pytest unit_tests
61
+ ```
62
+
63
+ ### Building the docker image
64
+ 1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
65
+ 2. Run the following command to build the docker image:
66
+ ```bash
67
+ airbyte-ci connectors --name=source-azure-blob-storage build
68
+ ```
69
+
70
+ An image will be available on your host with the tag `airbyte/source-azure-blob-storage:dev`.
71
+
72
+
73
+ ### Running as a docker container
74
+ Then run any of the connector commands as follows:
75
+ ```
76
+ docker run --rm airbyte/source-azure-blob-storage:dev spec
77
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev check --config /secrets/config.json
78
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev discover --config /secrets/config.json
79
+ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-azure-blob-storage:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
80
+ ```
81
+
82
+ ### Running our CI test suite
83
+ You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
84
+ ```bash
85
+ airbyte-ci connectors --name=source-azure-blob-storage test
86
+ ```
87
+
88
+ ### Customizing acceptance Tests
89
+ Customize `acceptance-test-config.yml` file to configure acceptance tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
90
+ If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
91
+
92
+ ### Dependency Management
93
+ All of your dependencies should be managed via Poetry.
94
+ To add a new dependency, run:
95
+ ```bash
96
+ poetry add <package-name>
97
+ ```
98
+
99
+ Please commit the changes to `pyproject.toml` and `poetry.lock` files.
100
+
101
+ ## Publishing a new version of the connector
102
+ You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
103
+ 1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-azure-blob-storage test`
104
+ 2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
105
+ - bump the `dockerImageTag` value in in `metadata.yaml`
106
+ - bump the `version` value in `pyproject.toml`
107
+ 3. Make sure the `metadata.yaml` content is up to date.
108
+ 4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/azure-blob-storage.md`).
109
+ 5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
110
+ 6. Pat yourself on the back for being an awesome contributor.
111
+ 7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
112
+ 8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
@@ -0,0 +1,91 @@
1
+ # Azure-Blob-Storage source connector
2
+
3
+
4
+ This is the repository for the Azure-Blob-Storage source connector, written in Python.
5
+ For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/azure-blob-storage).
6
+
7
+ ## Local development
8
+
9
+ ### Prerequisites
10
+ * Python (~=3.9)
11
+ * Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
12
+
13
+
14
+ ### Installing the connector
15
+ From this connector directory, run:
16
+ ```bash
17
+ poetry install --with dev
18
+ ```
19
+
20
+
21
+ ### Create credentials
22
+ **If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/azure-blob-storage)
23
+ to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_azure_blob_storage/spec.yaml` file.
24
+ Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
25
+ See `sample_files/sample_config.json` for a sample config file.
26
+
27
+
28
+ ### Locally running the connector
29
+ ```
30
+ poetry run source-azure-blob-storage spec
31
+ poetry run source-azure-blob-storage check --config secrets/config.json
32
+ poetry run source-azure-blob-storage discover --config secrets/config.json
33
+ poetry run source-azure-blob-storage read --config secrets/config.json --catalog sample_files/configured_catalog.json
34
+ ```
35
+
36
+ ### Running unit tests
37
+ To run unit tests locally, from the connector directory run:
38
+ ```
39
+ poetry run pytest unit_tests
40
+ ```
41
+
42
+ ### Building the docker image
43
+ 1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
44
+ 2. Run the following command to build the docker image:
45
+ ```bash
46
+ airbyte-ci connectors --name=source-azure-blob-storage build
47
+ ```
48
+
49
+ An image will be available on your host with the tag `airbyte/source-azure-blob-storage:dev`.
50
+
51
+
52
+ ### Running as a docker container
53
+ Then run any of the connector commands as follows:
54
+ ```
55
+ docker run --rm airbyte/source-azure-blob-storage:dev spec
56
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev check --config /secrets/config.json
57
+ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev discover --config /secrets/config.json
58
+ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-azure-blob-storage:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
59
+ ```
60
+
61
+ ### Running our CI test suite
62
+ You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
63
+ ```bash
64
+ airbyte-ci connectors --name=source-azure-blob-storage test
65
+ ```
66
+
67
+ ### Customizing acceptance Tests
68
+ Customize `acceptance-test-config.yml` file to configure acceptance tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
69
+ If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
70
+
71
+ ### Dependency Management
72
+ All of your dependencies should be managed via Poetry.
73
+ To add a new dependency, run:
74
+ ```bash
75
+ poetry add <package-name>
76
+ ```
77
+
78
+ Please commit the changes to `pyproject.toml` and `poetry.lock` files.
79
+
80
+ ## Publishing a new version of the connector
81
+ You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
82
+ 1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-azure-blob-storage test`
83
+ 2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
84
+ - bump the `dockerImageTag` value in in `metadata.yaml`
85
+ - bump the `version` value in `pyproject.toml`
86
+ 3. Make sure the `metadata.yaml` content is up to date.
87
+ 4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/azure-blob-storage.md`).
88
+ 5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
89
+ 6. Pat yourself on the back for being an awesome contributor.
90
+ 7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
91
+ 8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = [
3
+ "poetry-core>=1.0.0",
4
+ ]
5
+ build-backend = "poetry.core.masonry.api"
6
+
7
+ [tool.poetry]
8
+ version = "0.3.5"
9
+ name = "airbyte-source-azure-blob-storage"
10
+ description = "Source implementation for Azure Blob Storage."
11
+ authors = [
12
+ "Airbyte <contact@airbyte.io>",
13
+ ]
14
+ license = "MIT"
15
+ readme = "README.md"
16
+ documentation = "https://docs.airbyte.com/integrations/sources/azure-blob-storage"
17
+ homepage = "https://airbyte.com"
18
+ repository = "https://github.com/airbytehq/airbyte"
19
+ packages = [
20
+ { include = "source_azure_blob_storage" },
21
+ ]
22
+
23
+ [tool.poetry.dependencies]
24
+ python = "^3.9,<3.12"
25
+ pytz = "==2024.1"
26
+
27
+ [tool.poetry.dependencies.airbyte-cdk]
28
+ version = "0.75"
29
+ extras = [
30
+ "file-based",
31
+ ]
32
+
33
+ [tool.poetry.dependencies.smart-open]
34
+ extras = [
35
+ "azure",
36
+ ]
37
+ version = "==6.4.0"
38
+
39
+ [tool.poetry.scripts]
40
+ source-azure-blob-storage = "source_azure_blob_storage.run:run"
41
+
42
+ [tool.poetry.group.dev.dependencies]
43
+ pytest-mock = "^3.6.1"
44
+ requests-mock = "^1.9.3"
45
+ pytest = "^6.2"
@@ -8,6 +8,7 @@ from datetime import datetime
8
8
 
9
9
  from airbyte_cdk.entrypoint import AirbyteEntrypoint, launch
10
10
  from airbyte_cdk.models import AirbyteErrorTraceMessage, AirbyteMessage, AirbyteTraceMessage, TraceType, Type
11
+ from airbyte_cdk.sources.file_based.stream.cursor import DefaultFileBasedCursor
11
12
  from source_azure_blob_storage import Config, SourceAzureBlobStorage, SourceAzureBlobStorageStreamReader
12
13
 
13
14
 
@@ -23,6 +24,7 @@ def run():
23
24
  SourceAzureBlobStorage.read_catalog(catalog_path) if catalog_path else None,
24
25
  SourceAzureBlobStorage.read_config(config_path) if catalog_path else None,
25
26
  SourceAzureBlobStorage.read_state(state_path) if catalog_path else None,
27
+ cursor_cls=DefaultFileBasedCursor,
26
28
  )
27
29
  except Exception:
28
30
  print(
@@ -1,142 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: airbyte-source-azure-blob-storage
3
- Version: 0.3.4
4
- Summary: Source implementation for Azure Blob Storage.
5
- Author: Airbyte
6
- Author-email: contact@airbyte.io
7
- Description-Content-Type: text/markdown
8
- Requires-Dist: airbyte-cdk[file-based]>=0.61.0
9
- Requires-Dist: smart_open[azure]
10
- Requires-Dist: pytz
11
- Provides-Extra: tests
12
- Requires-Dist: requests-mock~=1.9.3; extra == "tests"
13
- Requires-Dist: pytest-mock~=3.6.1; extra == "tests"
14
- Requires-Dist: pytest~=6.2; extra == "tests"
15
-
16
- # Azure Blob Storage Source
17
-
18
- This is the repository for the Azure Blob Storage source connector, written in Python.
19
- For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/azure-blob-storage).
20
-
21
-
22
- **To iterate on this connector, make sure to complete this prerequisites section.**
23
-
24
-
25
- From this connector directory, create a virtual environment:
26
- ```
27
- python -m venv .venv
28
- ```
29
-
30
- This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
31
- development environment of choice. To activate it from the terminal, run:
32
- ```
33
- source .venv/bin/activate
34
- pip install -r requirements.txt
35
- ```
36
- If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
37
-
38
- Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
39
- used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
40
- If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
41
- should work as you expect.
42
-
43
- **If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/azure-blob-storage)
44
- to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_azure_blob_storage/spec.yaml` file.
45
- Note that the `secrets` directory is gitignored by default, so there is no danger of accidentally checking in sensitive information.
46
- See `integration_tests/sample_config.json` for a sample config file.
47
-
48
- **If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source azure-blob-storage test creds`
49
- and place them into `secrets/config.json`.
50
-
51
- ```
52
- python main.py spec
53
- python main.py check --config secrets/config.json
54
- python main.py discover --config secrets/config.json
55
- python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
56
- ```
57
-
58
-
59
-
60
-
61
- The Airbyte way of building this connector is to use our `airbyte-ci` tool.
62
- You can follow install instructions [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md#L1).
63
- Then running the following command will build your connector:
64
-
65
- ```bash
66
- airbyte-ci connectors --name=source-azure-blob-storage build
67
- ```
68
- Once the command is done, you will find your connector image in your local docker registry: `airbyte/source-azure-blob-storage:dev`.
69
-
70
- When contributing on our connector you might need to customize the build process to add a system dependency or set an env var.
71
- You can customize our build process by adding a `build_customization.py` module to your connector.
72
- This module should contain a `pre_connector_install` and `post_connector_install` async function that will mutate the base image and the connector container respectively.
73
- It will be imported at runtime by our build process and the functions will be called if they exist.
74
-
75
- Here is an example of a `build_customization.py` module:
76
- ```python
77
- from __future__ import annotations
78
-
79
- from typing import TYPE_CHECKING
80
-
81
- if TYPE_CHECKING:
82
- from dagger import Container
83
-
84
-
85
- async def pre_connector_install(base_image_container: Container) -> Container:
86
- return await base_image_container.with_env_variable("MY_PRE_BUILD_ENV_VAR", "my_pre_build_env_var_value")
87
-
88
- async def post_connector_install(connector_container: Container) -> Container:
89
- return await connector_container.with_env_variable("MY_POST_BUILD_ENV_VAR", "my_post_build_env_var_value")
90
- ```
91
-
92
- This connector is built using our dynamic built process in `airbyte-ci`.
93
- The base image used to build it is defined within the metadata.yaml file under the `connectorBuildOptions`.
94
- The build logic is defined using [Dagger](https://dagger.io/) [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/pipelines/builds/python_connectors.py).
95
- It does not rely on a Dockerfile.
96
-
97
- If you would like to patch our connector and build your own a simple approach would be to:
98
-
99
- 1. Create your own Dockerfile based on the latest version of the connector image.
100
- ```Dockerfile
101
- FROM airbyte/source-azure-blob-storage:latest
102
-
103
- COPY . ./airbyte/integration_code
104
- RUN pip install ./airbyte/integration_code
105
-
106
- ```
107
- Please use this as an example. This is not optimized.
108
-
109
- 2. Build your image:
110
- ```bash
111
- docker build -t airbyte/source-azure-blob-storage:dev .
112
- docker run airbyte/source-azure-blob-storage:dev spec
113
- ```
114
- Then run any of the connector commands as follows:
115
- ```
116
- docker run --rm airbyte/source-azure-blob-storage:dev spec
117
- docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev check --config /secrets/config.json
118
- docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev discover --config /secrets/config.json
119
- docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-azure-blob-storage:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
120
- ```
121
-
122
- You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
123
- ```bash
124
- airbyte-ci connectors --name=source-azure-blob-storage test
125
- ```
126
-
127
- Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
128
- If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
129
-
130
- All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
131
- We split dependencies between two groups, dependencies that are:
132
- * required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
133
- * required for the testing need to go to `TEST_REQUIREMENTS` list
134
-
135
- You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
136
- 1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-azure-blob-storage test`
137
- 2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
138
- 3. Make sure the `metadata.yaml` content is up to date.
139
- 4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/azure-blob-storage.md`).
140
- 5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
141
- 6. Pat yourself on the back for being an awesome contributor.
142
- 7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
@@ -1,149 +0,0 @@
1
- # Azure Blob Storage Source
2
-
3
- This is the repository for the Azure Blob Storage source connector, written in Python.
4
- For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/azure-blob-storage).
5
-
6
- ## Local development
7
-
8
- ### Prerequisites
9
- **To iterate on this connector, make sure to complete this prerequisites section.**
10
-
11
- #### Minimum Python version required `= 3.9.0`
12
-
13
- #### Build & Activate Virtual Environment and install dependencies
14
- From this connector directory, create a virtual environment:
15
- ```
16
- python -m venv .venv
17
- ```
18
-
19
- This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
20
- development environment of choice. To activate it from the terminal, run:
21
- ```
22
- source .venv/bin/activate
23
- pip install -r requirements.txt
24
- ```
25
- If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
26
-
27
- Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
28
- used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
29
- If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
30
- should work as you expect.
31
-
32
- #### Create credentials
33
- **If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/azure-blob-storage)
34
- to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_azure_blob_storage/spec.yaml` file.
35
- Note that the `secrets` directory is gitignored by default, so there is no danger of accidentally checking in sensitive information.
36
- See `integration_tests/sample_config.json` for a sample config file.
37
-
38
- **If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source azure-blob-storage test creds`
39
- and place them into `secrets/config.json`.
40
-
41
- ### Locally running the connector
42
- ```
43
- python main.py spec
44
- python main.py check --config secrets/config.json
45
- python main.py discover --config secrets/config.json
46
- python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
47
- ```
48
-
49
- ### Locally running the connector docker image
50
-
51
-
52
-
53
- #### Use `airbyte-ci` to build your connector
54
- The Airbyte way of building this connector is to use our `airbyte-ci` tool.
55
- You can follow install instructions [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md#L1).
56
- Then running the following command will build your connector:
57
-
58
- ```bash
59
- airbyte-ci connectors --name=source-azure-blob-storage build
60
- ```
61
- Once the command is done, you will find your connector image in your local docker registry: `airbyte/source-azure-blob-storage:dev`.
62
-
63
- ##### Customizing our build process
64
- When contributing on our connector you might need to customize the build process to add a system dependency or set an env var.
65
- You can customize our build process by adding a `build_customization.py` module to your connector.
66
- This module should contain a `pre_connector_install` and `post_connector_install` async function that will mutate the base image and the connector container respectively.
67
- It will be imported at runtime by our build process and the functions will be called if they exist.
68
-
69
- Here is an example of a `build_customization.py` module:
70
- ```python
71
- from __future__ import annotations
72
-
73
- from typing import TYPE_CHECKING
74
-
75
- if TYPE_CHECKING:
76
- # Feel free to check the dagger documentation for more information on the Container object and its methods.
77
- # https://dagger-io.readthedocs.io/en/sdk-python-v0.6.4/
78
- from dagger import Container
79
-
80
-
81
- async def pre_connector_install(base_image_container: Container) -> Container:
82
- return await base_image_container.with_env_variable("MY_PRE_BUILD_ENV_VAR", "my_pre_build_env_var_value")
83
-
84
- async def post_connector_install(connector_container: Container) -> Container:
85
- return await connector_container.with_env_variable("MY_POST_BUILD_ENV_VAR", "my_post_build_env_var_value")
86
- ```
87
-
88
- #### Build your own connector image
89
- This connector is built using our dynamic built process in `airbyte-ci`.
90
- The base image used to build it is defined within the metadata.yaml file under the `connectorBuildOptions`.
91
- The build logic is defined using [Dagger](https://dagger.io/) [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/pipelines/builds/python_connectors.py).
92
- It does not rely on a Dockerfile.
93
-
94
- If you would like to patch our connector and build your own a simple approach would be to:
95
-
96
- 1. Create your own Dockerfile based on the latest version of the connector image.
97
- ```Dockerfile
98
- FROM airbyte/source-azure-blob-storage:latest
99
-
100
- COPY . ./airbyte/integration_code
101
- RUN pip install ./airbyte/integration_code
102
-
103
- # The entrypoint and default env vars are already set in the base image
104
- # ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
105
- # ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
106
- ```
107
- Please use this as an example. This is not optimized.
108
-
109
- 2. Build your image:
110
- ```bash
111
- docker build -t airbyte/source-azure-blob-storage:dev .
112
- # Running the spec command against your patched connector
113
- docker run airbyte/source-azure-blob-storage:dev spec
114
- ```
115
- #### Run
116
- Then run any of the connector commands as follows:
117
- ```
118
- docker run --rm airbyte/source-azure-blob-storage:dev spec
119
- docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev check --config /secrets/config.json
120
- docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev discover --config /secrets/config.json
121
- docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-azure-blob-storage:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
122
- ```
123
-
124
- ## Testing
125
- You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
126
- ```bash
127
- airbyte-ci connectors --name=source-azure-blob-storage test
128
- ```
129
-
130
- ### Customizing acceptance Tests
131
- Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
132
- If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
133
-
134
- ## Dependency Management
135
- All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
136
- We split dependencies between two groups, dependencies that are:
137
- * required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
138
- * required for the testing need to go to `TEST_REQUIREMENTS` list
139
-
140
- ### Publishing a new version of the connector
141
- You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
142
- 1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-azure-blob-storage test`
143
- 2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
144
- 3. Make sure the `metadata.yaml` content is up to date.
145
- 4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/azure-blob-storage.md`).
146
- 5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
147
- 6. Pat yourself on the back for being an awesome contributor.
148
- 7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
149
-