diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml index 929567e8c..fd66735dc 100644 --- a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml +++ b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml @@ -44,13 +44,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: {{ '${{ matrix.python-version }}' }} - - name: Install Poetry + - run: pipx install tox + - name: Run Tox run: | - pip install poetry - - name: Install dependencies - run: | - poetry env use {{ '${{ matrix.python-version }}' }} - poetry install - - name: Test with pytest - run: | - poetry run pytest + tox -e $(echo py{{ '${{ matrix.python-version }}' }} | tr -d .) diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml index d8772f156..ed9549bca 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml @@ -44,13 +44,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: {{ '${{ matrix.python-version }}' }} - - name: Install Poetry + - run: pipx install tox + - name: Run Tox run: | - pip install poetry - - name: Install dependencies - run: | - poetry env use {{ '${{ matrix.python-version }}' }} - poetry install - - name: Test with pytest - run: | - poetry run pytest + tox -e $(echo py{{ '${{ matrix.python-version }}' }} | tr -d .) diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml index 01362f096..9a098a000 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml @@ -44,13 +44,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: {{ '${{ matrix.python-version }}' }} - - name: Install Poetry + - run: pipx install tox + - name: Run Tox run: | - pip install poetry - - name: Install dependencies - run: | - poetry env use {{ '${{ matrix.python-version }}' }} - poetry install - - name: Test with pytest - run: | - poetry run pytest + tox -e $(echo py{{ '${{ matrix.python-version }}' }} | tr -d .) diff --git a/samples/sample_tap_csv/client.py b/samples/sample_tap_csv/client.py index c5a40bfe2..e0767cb19 100644 --- a/samples/sample_tap_csv/client.py +++ b/samples/sample_tap_csv/client.py @@ -1,3 +1,5 @@ +"""Stream class for CSV files.""" + from __future__ import annotations import csv @@ -18,9 +20,11 @@ class CSVStream(FileStream): @property def primary_keys(self) -> t.Sequence[str]: + """Return the primary key fields for records in this stream.""" return (SDC_META_FILEPATH, SDC_META_LINE_NUMBER) def get_schema(self, path: str) -> dict[str, t.Any]: + """Return a schema for the given file.""" with self.filesystem.open(path, mode="r") as file: reader = csv.DictReader( file, @@ -38,6 +42,7 @@ def get_schema(self, path: str) -> dict[str, t.Any]: return schema def read_file(self, path: str) -> t.Iterable[Record]: + """Read the given file and emit records.""" with self.filesystem.open(path, mode="r") as file: reader = csv.DictReader( file,