Skip to content

Commit

Permalink
source-exchange-rates: [autopull] base image + poetry + up_to_date (#…
Browse files Browse the repository at this point in the history
…38543)

Co-authored-by: Serhii Lazebnyi <serhii.lazebnyi@globallogic.com>
Co-authored-by: Serhii Lazebnyi <53845333+lazebnyi@users.noreply.github.com>
Co-authored-by: alafanechere <augustin.lafanechere@gmail.com>
Co-authored-by: Danylo Jablonski <150933663+DanyloGL@users.noreply.github.com>
Co-authored-by: Augustin <augustin@airbyte.io>
  • Loading branch information
6 people committed Jun 13, 2024
1 parent 575523a commit 61dd166
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 102 deletions.
32 changes: 10 additions & 22 deletions airbyte-integrations/connectors/source-exchange-rates/README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,45 @@
# Exchange Rates Source
# Exchange-Rates source connector

This is the repository for the Exchange Rates configuration based source connector.

This is the repository for the Exchange-Rates source connector, written in Python.
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/exchange-rates).

## Local development

### Prerequisites

* Python (`^3.9`)
* Poetry (`^1.7`) - installation instructions [here](https://python-poetry.org/docs/#installation)

* Python (~=3.9)
* Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)


### Installing the connector

From this connector directory, run:
```bash
poetry install --with dev
```


### Create credentials

**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/exchange-rates)
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `spec` inside `src/source_exchange_rates/mnifest.yaml` file.
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
See `integration_tests/sample_config.json` for a sample config file.
See `sample_files/sample_config.json` for a sample config file.


### Locally running the connector

```
poetry run source-exchange-rates spec
poetry run source-exchange-rates check --config secrets/config.json
poetry run source-exchange-rates discover --config secrets/config.json
poetry run source-exchange-rates read --config secrets/config.json --catalog integration_tests/configured_catalog.json
poetry run source-exchange-rates read --config secrets/config.json --catalog sample_files/configured_catalog.json
```

### Running tests

To run tests locally, from the connector directory run:

### Running unit tests
To run unit tests locally, from the connector directory run:
```
poetry run pytest tests
poetry run pytest unit_tests
```

### Building the docker image

1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
2. Run the following command to build the docker image:
```bash
Expand All @@ -57,7 +50,6 @@ An image will be available on your host with the tag `airbyte/source-exchange-ra


### Running as a docker container

Then run any of the connector commands as follows:
```
docker run --rm airbyte/source-exchange-rates:dev spec
Expand All @@ -67,19 +59,16 @@ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integrat
```

### Running our CI test suite

You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
```bash
airbyte-ci connectors --name=source-exchange-rates test
```

### Customizing acceptance Tests

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.
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.

### Dependency Management

All of your dependencies should be managed via Poetry.
To add a new dependency, run:
```bash
Expand All @@ -89,7 +78,6 @@ poetry add <package-name>
Please commit the changes to `pyproject.toml` and `poetry.lock` files.

## Publishing a new version of the connector

You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-exchange-rates test`
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)):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ acceptance_tests:
tests:
- config_path: "secrets/config.json"
status: "succeed"
timeout_seconds: 420
- config_path: "integration_tests/invalid_config.json"
status: "failed"
timeout_seconds: 420
discovery:
tests:
- config_path: "secrets/config.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: e2b40e36-aa0e-4bed-b41b-bcea6fa348b1
dockerImageTag: 1.3.2
dockerImageTag: 1.3.3
dockerRepository: airbyte/source-exchange-rates
githubIssueLabel: source-exchange-rates
icon: exchangeratesapi.svg
Expand Down
122 changes: 63 additions & 59 deletions airbyte-integrations/connectors/source-exchange-rates/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "1.3.2"
version = "1.3.3"
name = "source-exchange-rates"
description = "Source implementation for exchange-rates."
description = "Source implementation for Exchange Rates."
authors = [ "Airbyte <contact@airbyte.io>",]
license = "MIT"
readme = "README.md"
documentation = "https://docs.airbyte.com/integrations/sources/exchange-rates"
homepage = "https://airbyte.com"
repository = "https://github.com/airbytehq/airbyte"
packages = [ { include = "source_exchange_rates" }, {include = "main.py" } ]
[[tool.poetry.packages]]
include = "source_exchange_rates"

[tool.poetry.dependencies]
python = "^3.9,<3.12"
Expand All @@ -22,6 +23,5 @@ airbyte-cdk = "^0"
source-exchange-rates = "source_exchange_rates.run:run"

[tool.poetry.group.dev.dependencies]
requests-mock = "*"
pytest-mock = "*"
pytest = "*"
pytest = "^6.2"
pytest-mock = "^3.6.1"
Loading

0 comments on commit 61dd166

Please sign in to comment.