Skip to content

Commit 86852f2

Browse files
authored
source-coin-api: ensure inline schemas, updated cdk, poetry (where possible) (#37138)
1 parent a955535 commit 86852f2

File tree

11 files changed

+1312
-225
lines changed

11 files changed

+1312
-225
lines changed

airbyte-integrations/connectors/source-coin-api/Dockerfile

-38
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,55 @@
1-
# Coin Api Source
1+
# Coin-Api source connector
22

3-
This is the repository for the Coin Api configuration based source connector.
4-
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/coin-api).
3+
4+
This is the repository for the Coin-Api 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/coin-api).
56

67
## Local development
78

8-
#### Create credentials
9-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/coin-api)
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/coin-api)
1023
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_coin_api/spec.yaml` file.
1124
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
12-
See `integration_tests/sample_config.json` for a sample config file.
25+
See `sample_files/sample_config.json` for a sample config file.
1326

14-
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source coin-api test creds`
15-
and place them into `secrets/config.json`.
1627

17-
### Locally running the connector docker image
28+
### Locally running the connector
29+
```
30+
poetry run source-coin-api spec
31+
poetry run source-coin-api check --config secrets/config.json
32+
poetry run source-coin-api discover --config secrets/config.json
33+
poetry run source-coin-api read --config secrets/config.json --catalog sample_files/configured_catalog.json
34+
```
1835

36+
### Running unit tests
37+
To run unit tests locally, from the connector directory run:
38+
```
39+
poetry run pytest unit_tests
40+
```
1941

20-
#### Build
21-
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
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:
2245
```bash
2346
airbyte-ci connectors --name=source-coin-api build
2447
```
2548

26-
An image will be built with the tag `airbyte/source-coin-api:dev`.
49+
An image will be available on your host with the tag `airbyte/source-coin-api:dev`.
2750

28-
**Via `docker build`:**
29-
```bash
30-
docker build -t airbyte/source-coin-api:dev .
31-
```
3251

33-
#### Run
52+
### Running as a docker container
3453
Then run any of the connector commands as follows:
3554
```
3655
docker run --rm airbyte/source-coin-api:dev spec
@@ -39,29 +58,34 @@ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-coin-api:dev discover
3958
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-coin-api:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
4059
```
4160

42-
## Testing
61+
### Running our CI test suite
4362
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
4463
```bash
4564
airbyte-ci connectors --name=source-coin-api test
4665
```
4766

4867
### Customizing acceptance Tests
49-
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.
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.
5069
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.
5170

52-
## Dependency Management
53-
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.
54-
We split dependencies between two groups, dependencies that are:
55-
* required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
56-
* required for the testing need to go to `TEST_REQUIREMENTS` list
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+
```
5777

58-
### Publishing a new version of the connector
78+
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
79+
80+
## Publishing a new version of the connector
5981
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
6082
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-coin-api test`
61-
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).
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`
6286
3. Make sure the `metadata.yaml` content is up to date.
63-
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/coin-api.md`).
87+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/coin-api.md`).
6488
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).
6589
6. Pat yourself on the back for being an awesome contributor.
6690
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
67-
91+
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
data:
2+
ab_internal:
3+
ql: 100
4+
sl: 100
5+
connectorBuildOptions:
6+
baseImage: docker.io/airbyte/python-connector-base:1.2.0@sha256:c22a9d97464b69d6ef01898edf3f8612dc11614f05a84984451dde195f337db9
27
connectorSubtype: api
38
connectorType: source
49
definitionId: 919984ef-53a2-479b-8ffe-9c1ddb9fc3f3
5-
dockerImageTag: 0.2.0
10+
dockerImageTag: 0.2.4
611
dockerRepository: airbyte/source-coin-api
12+
documentationUrl: https://docs.airbyte.com/integrations/sources/coin-api
713
githubIssueLabel: source-coin-api
814
icon: coinapi.svg
915
license: MIT
1016
name: Coin API
11-
remoteRegistries:
12-
pypi:
13-
enabled: true
14-
packageName: airbyte-source-coin-api
1517
registries:
1618
cloud:
1719
enabled: true
1820
oss:
1921
enabled: true
2022
releaseStage: alpha
21-
documentationUrl: https://docs.airbyte.com/integrations/sources/coin-api
23+
remoteRegistries:
24+
pypi:
25+
enabled: true
26+
packageName: airbyte-source-coin-api
27+
supportLevel: community
2228
tags:
2329
- language:python
2430
- cdk:low-code
25-
ab_internal:
26-
sl: 100
27-
ql: 100
28-
supportLevel: community
2931
metadataSpecVersion: "1.0"

0 commit comments

Comments
 (0)