Skip to content

Commit

Permalink
play
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-tricot committed Sep 8, 2023
1 parent 8c9c423 commit 91edbcd
Show file tree
Hide file tree
Showing 6 changed files with 344 additions and 12 deletions.
4 changes: 2 additions & 2 deletions airbyte-integrations/connectors/source-pokeapi/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*
!Dockerfile
!main.py
!source_pokeapi
!setup.py
!src/source_pokeapi
!pyproject.toml
!secrets
6 changes: 3 additions & 3 deletions airbyte-integrations/connectors/source-pokeapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM python:3.9-slim

# Bash is installed for more convenient debugging.
RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/*
#RUN apt-get clean && apt-get update && apt-get install -y bash --allow-insecure-repositories && rm -rf /var/lib/apt/lists/*


WORKDIR /airbyte/integration_code
COPY source_pokeapi ./source_pokeapi
COPY src/source_pokeapi ./src/source_pokeapi
COPY main.py ./
COPY setup.py ./
COPY pyproject.toml ./
RUN pip install .

ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
Expand Down
17 changes: 17 additions & 0 deletions airbyte-integrations/connectors/source-pokeapi/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
DOCKER_REPOSITORY = $(shell cat metadata.yaml | grep 'dockerRepository' | cut -d : -f 2 | tr -d '[[:blank:]]')
PROJECT_TOP_LEVEL = $(shell git rev-parse --show-toplevel)

all: check

format-ruff:
Expand All @@ -15,11 +18,25 @@ lint-ruff:
lint-mypy:
poetry run mypy src tests || true

build-python:
rm -rf dist build/dist
mkdir -p build
poetry build
mv dist build/

build-docker:
docker build . -t $(DOCKER_REPOSITORY):dev

format: format-ruff format-black

lint: lint-mypy lint-ruff lint-black

test:
poetry run pytest

integration_test:
source "$(PROJECT_TOP_LEVEL)/airbyte-integrations/bases/connector-acceptance-test/acceptance-test-docker.sh"

build: build-python build-docker

check: lint test
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ acceptance_tests:
bypass_reason: "The spec is currently invalid: it has additionalProperties set to false"
connection:
tests:
- config_path: "integration_tests/config.json"
- config_path: "tests/integration_tests/config.json"
status: "succeed"
discovery:
tests:
- config_path: "integration_tests/config.json"
- config_path: "tests/integration_tests/config.json"
basic_read:
tests:
- config_path: "integration_tests/config.json"
- config_path: "tests/integration_tests/config.json"
expect_records:
bypass_reason: "We should create an expected_records file"
full_refresh:
tests:
- config_path: "integration_tests/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
- config_path: "tests/integration_tests/config.json"
configured_catalog_path: "tests/integration_tests/configured_catalog.json"
incremental:
bypass_reason: "This connector does not support incremental syncs."
12 changes: 10 additions & 2 deletions airbyte-integrations/connectors/source-pokeapi/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
[tool.poetry]
name = "source-pokeapi"
name = "airbyte-source-pokeapi"
version = "0.1.0"
description = "Source implementation for Pokeapi."
authors = ["Airbyte <contact@airbyte.io>"]
classifiers = [
"Framework :: Airbyte :: Connectors :: Sources"
]
packages = [
{ include = "source_pokeapi", from = "src" }
]
include = [
{ path = "src/*/*.json"},
{ path = "src/*/schemas/*.json"},
{ path = "schemas/shared/*.json"}
{ path = "src/*/schemas/shared/*.json"}
]

[tool.poetry.dependencies]
Expand All @@ -20,6 +26,7 @@ mypy = "^1.4.1"

[tool.poetry.group.dev.dependencies]
pytest = "~6"
# Could we publish it?
connector-acceptance-test = {path = "../../bases/connector-acceptance-test", develop = true}

[build-system]
Expand Down Expand Up @@ -50,3 +57,4 @@ disallow_untyped_defs = "False"
testpaths = [
"tests/unit_tests"
]
addopts ="-r a --capture=no -vv --color=yes"

0 comments on commit 91edbcd

Please sign in to comment.