Skip to content

Commit 386067d

Browse files
authored
source-google-webfonts: ensure inline schemas, updated cdk, poetry (where possible) (#37172)
1 parent 88f42db commit 386067d

File tree

9 files changed

+1231
-252
lines changed

9 files changed

+1231
-252
lines changed

airbyte-integrations/connectors/source-google-webfonts/Dockerfile

-38
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,55 @@
1-
# Google Webfonts Source
1+
# Google-Webfonts source connector
22

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

67
## Local development
78

89
### Prerequisites
9-
**To iterate on this connector, make sure to complete this prerequisites section.**
10-
11-
#### Minimum Python version required `= 3.9.0`
10+
* Python (~=3.9)
11+
* Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
1212

13-
#### Build & Activate Virtual Environment and install dependencies
14-
From this connector directory, create a virtual environment:
15-
```
16-
python -m venv .venv
17-
```
1813

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+
### Installing the connector
15+
From this connector directory, run:
16+
```bash
17+
poetry install --with dev
2418
```
25-
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
2619

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

32-
#### Create credentials
33-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/google-webfonts)
21+
### Create credentials
22+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/google-webfonts)
3423
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_google_webfonts/spec.yaml` file.
3524
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
36-
See `integration_tests/sample_config.json` for a sample config file.
25+
See `sample_files/sample_config.json` for a sample config file.
3726

38-
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source google-webfonts test creds`
39-
and place them into `secrets/config.json`.
4027

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

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

44-
#### Build
45-
**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:
4645
```bash
4746
airbyte-ci connectors --name=source-google-webfonts build
4847
```
4948

50-
An image will be built with the tag `airbyte/source-google-webfonts:dev`.
49+
An image will be available on your host with the tag `airbyte/source-google-webfonts:dev`.
5150

52-
**Via `docker build`:**
53-
```bash
54-
docker build -t airbyte/source-google-webfonts:dev .
55-
```
5651

57-
#### Run
52+
### Running as a docker container
5853
Then run any of the connector commands as follows:
5954
```
6055
docker run --rm airbyte/source-google-webfonts:dev spec
@@ -63,29 +58,34 @@ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-google-webfonts:dev di
6358
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-google-webfonts:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
6459
```
6560

66-
## Testing
61+
### Running our CI test suite
6762
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
6863
```bash
6964
airbyte-ci connectors --name=source-google-webfonts test
7065
```
7166

7267
### Customizing acceptance Tests
73-
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.
7469
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.
7570

76-
## Dependency Management
77-
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.
78-
We split dependencies between two groups, dependencies that are:
79-
* required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
80-
* 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+
```
8177

82-
### 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
8381
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
8482
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-google-webfonts test`
85-
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`
8686
3. Make sure the `metadata.yaml` content is up to date.
87-
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/google-webfonts.md`).
87+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/google-webfonts.md`).
8888
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).
8989
6. Pat yourself on the back for being an awesome contributor.
9090
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
91-
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: a68fbcde-b465-4ab3-b2a6-b0590a875835
5-
dockerImageTag: 0.1.0
10+
dockerImageTag: 0.1.3
611
dockerRepository: airbyte/source-google-webfonts
12+
documentationUrl: https://docs.airbyte.com/integrations/sources/google-webfonts
713
githubIssueLabel: source-google-webfonts
814
icon: googleworkpace.svg
915
license: MIT
1016
name: Google Webfonts
11-
remoteRegistries:
12-
pypi:
13-
enabled: true
14-
packageName: airbyte-source-google-webfonts
1517
registries:
1618
cloud:
1719
enabled: true
1820
oss:
1921
enabled: true
2022
releaseStage: alpha
21-
documentationUrl: https://docs.airbyte.com/integrations/sources/google-webfonts
23+
remoteRegistries:
24+
pypi:
25+
enabled: true
26+
packageName: airbyte-source-google-webfonts
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)