|
1 |
| -# Pokeapi Source |
| 1 | +# Pokeapi source connector |
2 | 2 |
|
3 |
| -This is the repository for the Pokeapi configuration based source connector. |
4 |
| -For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/pokeapi). |
| 3 | +This directory contains the manifest-only connector for `source-pokeapi`. |
| 4 | +This _manifest-only_ connector is not a Python package on its own, as it runs inside of the base `source-declarative-manifest` image. |
| 5 | + |
| 6 | +For information about how to configure and use this connector within Airbyte, see [the connector's full documentation](https://docs.airbyte.com/integrations/sources/pokeapi). |
5 | 7 |
|
6 | 8 | ## Local development
|
7 | 9 |
|
8 |
| -### Prerequisites |
| 10 | +We recommend using the Connector Builder to edit this connector. |
| 11 | +Using either Airbyte Cloud or your local Airbyte OSS instance, navigate to the **Builder** tab and select **Import a YAML**. |
| 12 | +Then select the connector's `manifest.yaml` file to load the connector into the Builder. You're now ready to make changes to the connector! |
9 | 13 |
|
10 |
| -* Python (`^3.9`) |
11 |
| -* Poetry (`^1.7`) - installation instructions [here](https://python-poetry.org/docs/#installation) |
| 14 | +If you prefer to develop locally, you can follow the instructions below. |
12 | 15 |
|
| 16 | +### Building the docker image |
13 | 17 |
|
| 18 | +You can build any manifest-only connector with `airbyte-ci`: |
14 | 19 |
|
15 |
| -### Installing the connector |
| 20 | +1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) |
| 21 | +2. Run the following command to build the docker image: |
16 | 22 |
|
17 |
| -From this connector directory, run: |
18 | 23 | ```bash
|
19 |
| -poetry install --with dev |
| 24 | +airbyte-ci connectors --name=source-pokeapi build |
20 | 25 | ```
|
21 | 26 |
|
| 27 | +An image will be available on your host with the tag `airbyte/source-pokeapi:dev`. |
22 | 28 |
|
23 |
| -### Create credentials |
| 29 | +### Creating credentials |
24 | 30 |
|
25 | 31 | **If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/pokeapi)
|
26 |
| -to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `spec` inside `source_pokeapi/manifest.yaml` file. |
| 32 | +to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `spec` object in the connector's `manifest.yaml` file. |
27 | 33 | Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
|
28 |
| -See `integration_tests/sample_config.json` for a sample config file. |
29 |
| - |
30 |
| - |
31 |
| -### Locally running the connector |
32 |
| - |
33 |
| -``` |
34 |
| -poetry run source-pokeapi spec |
35 |
| -poetry run source-pokeapi check --config secrets/config.json |
36 |
| -poetry run source-pokeapi discover --config secrets/config.json |
37 |
| -poetry run source-pokeapi read --config secrets/config.json --catalog sample_files/configured_catalog.json |
38 |
| -``` |
39 |
| - |
40 |
| -### Running tests |
41 | 34 |
|
42 |
| -To run tests locally, from the connector directory run: |
43 |
| - |
44 |
| -``` |
45 |
| -poetry run pytest tests |
46 |
| -``` |
| 35 | +### Running as a docker container |
47 | 36 |
|
48 |
| -### Building the docker image |
| 37 | +Then run any of the standard source connector commands: |
49 | 38 |
|
50 |
| -1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) |
51 |
| -2. Run the following command to build the docker image: |
52 | 39 | ```bash
|
53 |
| -airbyte-ci connectors --name=source-pokeapi build |
54 |
| -``` |
55 |
| - |
56 |
| -An image will be available on your host with the tag `airbyte/source-pokeapi:dev`. |
57 |
| - |
58 |
| - |
59 |
| -### Running as a docker container |
60 |
| - |
61 |
| -Then run any of the connector commands as follows: |
62 |
| -``` |
63 | 40 | docker run --rm airbyte/source-pokeapi:dev spec
|
64 | 41 | docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-pokeapi:dev check --config /secrets/config.json
|
65 | 42 | docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-pokeapi:dev discover --config /secrets/config.json
|
66 | 43 | docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-pokeapi:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
|
67 | 44 | ```
|
68 | 45 |
|
69 |
| -### Running our CI test suite |
| 46 | +### Running the CI test suite |
70 | 47 |
|
71 | 48 | You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
|
72 |
| -```bash |
73 |
| -airbyte-ci connectors --name=source-pokeapi test |
74 |
| -``` |
75 |
| - |
76 |
| -### Customizing acceptance Tests |
77 | 49 |
|
78 |
| -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. |
79 |
| -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. |
80 |
| - |
81 |
| -### Dependency Management |
82 |
| - |
83 |
| -All of your dependencies should be managed via Poetry. |
84 |
| -To add a new dependency, run: |
85 | 50 | ```bash
|
86 |
| -poetry add <package-name> |
| 51 | +airbyte-ci connectors --name=source-pokeapi test |
87 | 52 | ```
|
88 | 53 |
|
89 |
| -Please commit the changes to `pyproject.toml` and `poetry.lock` files. |
90 |
| - |
91 | 54 | ## Publishing a new version of the connector
|
92 | 55 |
|
93 |
| -You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what? |
94 |
| -1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-pokeapi test` |
95 |
| -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)): |
| 56 | +If you want to contribute changes to `source-pokeapi`, here's how you can do that: |
| 57 | +1. Make your changes locally, or load the connector's manifest into Connector Builder and make changes there. |
| 58 | +2. Make sure your changes are passing our test suite with `airbyte-ci connectors --name=source-pokeapi test` |
| 59 | +3. 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)): |
96 | 60 | - bump the `dockerImageTag` value in in `metadata.yaml`
|
97 |
| - - bump the `version` value in `pyproject.toml` |
98 |
| -3. Make sure the `metadata.yaml` content is up to date. |
99 | 61 | 4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/pokeapi.md`).
|
100 | 62 | 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).
|
101 | 63 | 6. Pat yourself on the back for being an awesome contributor.
|
|
0 commit comments