|
1 |
| -# Rabbitmq Destination |
| 1 | +# Rss Source |
2 | 2 |
|
3 |
| -This is the repository for the Rabbitmq destination connector, written in Python. |
4 |
| -For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/destinations/rabbitmq). |
| 3 | +This is the repository for the Rss configuration based source connector. |
| 4 | +For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/rss). |
5 | 5 |
|
6 | 6 | ## Local development
|
7 | 7 |
|
8 | 8 | ### Prerequisites
|
9 |
| -**To iterate on this connector, make sure to complete this prerequisites section.** |
10 | 9 |
|
11 |
| -#### Minimum Python version required `= 3.7.0` |
| 10 | +* Python (`^3.9`) |
| 11 | +* Poetry (`^1.7`) - installation instructions [here](https://python-poetry.org/docs/#installation) |
12 | 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 | 13 |
|
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 |
| 14 | + |
| 15 | +### Installing the connector |
| 16 | + |
| 17 | +From this connector directory, run: |
| 18 | +```bash |
| 19 | +poetry install --with dev |
24 | 20 | ```
|
25 |
| -If you are in an IDE, follow your IDE's instructions to activate the virtualenv. |
26 | 21 |
|
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 | 22 |
|
32 |
| -#### Create credentials |
33 |
| -**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/destinations/rabbitmq) |
34 |
| -to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `destination_rabbitmq/spec.json` 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. |
| 23 | +### Create credentials |
| 24 | + |
| 25 | +**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/rss) |
| 26 | +to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `src/source_rss/spec.yaml` file. |
| 27 | +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 `sample_files/sample_config.json` for a sample config file. |
37 | 29 |
|
38 |
| -**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `destination rabbitmq test creds` |
39 |
| -and place them into `secrets/config.json`. |
40 | 30 |
|
41 | 31 | ### Locally running the connector
|
| 32 | + |
42 | 33 | ```
|
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 |
| 34 | +poetry run source-rss spec |
| 35 | +poetry run source-rss check --config secrets/config.json |
| 36 | +poetry run source-rss discover --config secrets/config.json |
| 37 | +poetry run source-rss read --config secrets/config.json --catalog sample_files/configured_catalog.json |
47 | 38 | ```
|
48 | 39 |
|
49 |
| -### Locally running the connector docker image |
| 40 | +### Running tests |
50 | 41 |
|
| 42 | +To run tests locally, from the connector directory run: |
51 | 43 |
|
52 |
| -#### Build |
53 |
| -**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):** |
54 |
| -```bash |
55 |
| -airbyte-ci connectors --name destination-rabbitmq build |
| 44 | +``` |
| 45 | +poetry run pytest tests |
56 | 46 | ```
|
57 | 47 |
|
58 |
| -An image will be built with the tag `airbyte/destination-rabbitmq:dev`. |
| 48 | +### Building the docker image |
59 | 49 |
|
60 |
| -**Via `docker build`:** |
| 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: |
61 | 52 | ```bash
|
62 |
| -docker build -t airbyte/destination-rabbitmq:dev . |
| 53 | +airbyte-ci connectors --name=source-rss build |
63 | 54 | ```
|
64 | 55 |
|
65 |
| -#### Run |
| 56 | +An image will be available on your host with the tag `airbyte/source-rss:dev`. |
| 57 | + |
| 58 | + |
| 59 | +### Running as a docker container |
| 60 | + |
66 | 61 | Then run any of the connector commands as follows:
|
67 | 62 | ```
|
68 |
| -docker run --rm airbyte/destination-rabbitmq:dev spec |
69 |
| -docker run --rm -v $(pwd)/secrets:/secrets airbyte/destination-rabbitmq:dev check --config /secrets/config.json |
70 |
| -# messages.jsonl is a file containing line-separated JSON representing AirbyteMessages |
71 |
| -cat messages.jsonl | docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/destination-rabbitmq:dev write --config /secrets/config.json --catalog /integration_tests/configured_catalog.json |
| 63 | +docker run --rm airbyte/source-rss:dev spec |
| 64 | +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-rss:dev check --config /secrets/config.json |
| 65 | +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-rss:dev discover --config /secrets/config.json |
| 66 | +docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-rss:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json |
72 | 67 | ```
|
73 | 68 |
|
74 |
| -## Testing |
| 69 | +### Running our CI test suite |
| 70 | + |
75 | 71 | You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
|
76 | 72 | ```bash
|
77 | 73 | airbyte-ci connectors --name=source-rss test
|
78 | 74 | ```
|
79 | 75 |
|
80 | 76 | ### Customizing acceptance Tests
|
81 |
| -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. |
| 77 | + |
| 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. |
82 | 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.
|
83 | 80 |
|
84 |
| -## Dependency Management |
85 |
| -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. |
86 |
| -We split dependencies between two groups, dependencies that are: |
87 |
| -* required for your connector to work need to go to `MAIN_REQUIREMENTS` list. |
88 |
| -* required for the testing need to go to `TEST_REQUIREMENTS` list |
| 81 | +### Dependency Management |
| 82 | + |
| 83 | +All of your dependencies should be managed via Poetry. |
| 84 | +To add a new dependency, run: |
| 85 | +```bash |
| 86 | +poetry add <package-name> |
| 87 | +``` |
| 88 | + |
| 89 | +Please commit the changes to `pyproject.toml` and `poetry.lock` files. |
| 90 | + |
| 91 | +## Publishing a new version of the connector |
89 | 92 |
|
90 |
| -### Publishing a new version of the connector |
91 | 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?
|
92 | 94 | 1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-rss test`
|
93 |
| -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). |
| 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)): |
| 96 | + - bump the `dockerImageTag` value in in `metadata.yaml` |
| 97 | + - bump the `version` value in `pyproject.toml` |
94 | 98 | 3. Make sure the `metadata.yaml` content is up to date.
|
95 |
| -4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/rss.md`). |
| 99 | +4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/rss.md`). |
96 | 100 | 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).
|
97 | 101 | 6. Pat yourself on the back for being an awesome contributor.
|
98 | 102 | 7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
|
99 |
| - |
| 103 | +8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry. |
0 commit comments