Skip to content

Commit

Permalink
Merge branch 'main' into edgarrmondragon/refactor/jsonschema-draft-20…
Browse files Browse the repository at this point in the history
…2012
  • Loading branch information
edgarrmondragon committed Oct 2, 2024
2 parents 75f10b0 + 743bfaf commit 9e89e7b
Show file tree
Hide file tree
Showing 83 changed files with 3,669 additions and 651 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
griffe==1.2.0
griffe==1.3.1
pip==24.2
poetry==1.8.3
poetry-plugin-export==1.8.0
poetry-dynamic-versioning==1.4.0
poetry-dynamic-versioning==1.4.1
pre-commit==3.8.0
nox==2024.4.15
nox-poetry==1.0.3
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
name: Packages
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.10.0
uses: pypa/gh-action-pypi-publish@v1.10.2

upload-to-release:
name: Upload files to release
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ jobs:
pipx inject nox nox-poetry
nox --version
- uses: actions/cache@v4
if: matrix.session == 'tests'
with:
path: http_cache.sqlite
key: http_cache-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.sqlalchemy }}

- name: Run Nox
env:
SQLALCHEMY_VERSION: ${{ matrix.sqlalchemy }}
Expand All @@ -100,7 +106,7 @@ jobs:
if: always() && (matrix.session == 'tests')
with:
include-hidden-files: true
name: coverage-data-nox_${{ matrix.session }}-${{ matrix.os }}-py${{ matrix.python-version }}_sqlalchemy_${{ matrix.sqlalchemy }}
name: coverage-data-nox_-${{ matrix.os }}-py${{ matrix.python-version }}_sqlalchemy_${{ matrix.sqlalchemy }}
path: ".coverage.*"

tests-external:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Create Pull Request
if: ${{ github.event.inputs.dry_run == 'false' }}
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
id: create-pull-request
with:
token: ${{ secrets.MELTYBOT_GITHUB_AUTH_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# HTTP cache
http_cache.sqlite

# Local Poetry configuration file

poetry.toml
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ repos:
)$
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.2
rev: 0.29.3
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-readthedocs

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.6.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
- name: Publish
## TODO: create a trusted publisher on PyPI
## https://docs.pypi.org/trusted-publishers/
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.2
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ on:
- tox.ini
workflow_dispatch:

env:
FORCE_COLOR: 1

jobs:
pytest:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: {{ '${{secrets.GITHUB_TOKEN}}' }}
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand All @@ -44,13 +44,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: {{ '${{ matrix.python-version }}' }}
- name: Install Poetry
run: |
pip install poetry
- name: Install dependencies
run: |
poetry env use {{ '${{ matrix.python-version }}' }}
poetry install
- name: Test with pytest
- run: pipx install tox
- name: Run Tox
run: |
poetry run pytest
tox -e $(echo py{{ '${{ matrix.python-version }}' }} | tr -d .)
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.2
rev: 0.29.3
hooks:
- id: check-dependabot
- id: check-github-workflows

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.6.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ keywords = [
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -30,7 +29,7 @@ packages = [
{%- endif %}

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.9"
singer-sdk = { version="~=0.40.0"{{ ', extras = ["faker"]' if cookiecutter.faker_extra }} }
fs-s3fs = { version = "~=1.1.1", optional = true }

Expand All @@ -49,8 +48,7 @@ python_version = "3.12"
warn_unused_configs = true

[tool.ruff]
src = ["{{cookiecutter.library_name}}"]
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
ignore = [
Expand All @@ -64,14 +62,11 @@ select = ["ALL"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.lint.isort]
known-first-party = ["{{cookiecutter.library_name}}"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[build-system]
requires = ["poetry-core==1.9.0"]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
Expand Down
19 changes: 6 additions & 13 deletions cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy

[tox]
envlist = py{38,39,310,311,312}
isolated_build = true
envlist = py3{9,10,11,12}
requires =
tox>=4.19

[testenv]
allowlist_externals = poetry
deps =
pytest
commands =
poetry install -v
poetry run pytest

[testenv:pytest]
# Run the python tests.
# To execute, run `tox -e pytest`
envlist = py{38,39,310,311,312}
commands =
poetry install -v
poetry run pytest
pytest {posargs}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
from __future__ import annotations

import typing as t
from typing import TYPE_CHECKING

import singer_sdk.typing as th
from singer_sdk import _singerlib as singer
from singer_sdk.mapper import PluginMapper
from singer_sdk.mapper_base import InlineMapper

if TYPE_CHECKING:
if t.TYPE_CHECKING:
from pathlib import PurePath


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
- name: Publish
## TODO: create a trusted publisher on PyPI
## https://docs.pypi.org/trusted-publishers/
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.2
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ on:
- tox.ini
workflow_dispatch:

env:
FORCE_COLOR: 1

jobs:
pytest:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: {{ '${{secrets.GITHUB_TOKEN}}' }}
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand All @@ -44,13 +44,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: {{ '${{ matrix.python-version }}' }}
- name: Install Poetry
run: |
pip install poetry
- name: Install dependencies
run: |
poetry env use {{ '${{ matrix.python-version }}' }}
poetry install
- name: Test with pytest
- run: pipx install tox
- name: Run Tox
run: |
poetry run pytest
tox -e $(echo py{{ '${{ matrix.python-version }}' }} | tr -d .)
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.2
rev: 0.29.3
hooks:
- id: check-dependabot
- id: check-github-workflows

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.6.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Now you can test and orchestrate using Meltano:
# Test invocation:
meltano invoke {{ cookiecutter.tap_id }} --version
# OR run a test `elt` pipeline:
meltano elt {{ cookiecutter.tap_id }} target-jsonl
meltano run {{ cookiecutter.tap_id }} target-jsonl
```

### SDK Dev Guide
Expand Down
12 changes: 3 additions & 9 deletions cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ keywords = [
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -29,8 +28,7 @@ packages = [
{%- endif %}

[tool.poetry.dependencies]
python = ">=3.8"
importlib-resources = { version = "==6.4.*", python = "<3.9" }
python = ">=3.9"
singer-sdk = { version="~=0.40.0", extras = [
{%- if cookiecutter.auth_method == "JWT" -%}"jwt", {% endif -%}
{%- if cookiecutter.faker_extra -%}"faker",{%- endif -%}
Expand Down Expand Up @@ -64,8 +62,7 @@ plugins = "sqlmypy"
{%- endif %}

[tool.ruff]
src = ["{{cookiecutter.library_name}}"]
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
ignore = [
Expand All @@ -79,14 +76,11 @@ select = ["ALL"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.lint.isort]
known-first-party = ["{{cookiecutter.library_name}}"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[build-system]
requires = ["poetry-core==1.9.0"]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
Expand Down
19 changes: 6 additions & 13 deletions cookiecutter/tap-template/{{cookiecutter.tap_id}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy

[tox]
envlist = py{38,39,310,311,312}
isolated_build = true
envlist = py3{9,10,11,12}
requires =
tox>=4.19

[testenv]
allowlist_externals = poetry
deps =
pytest
commands =
poetry install -v
poetry run pytest

[testenv:pytest]
# Run the python tests.
# To execute, run `tox -e pytest`
envlist = py{38,39,310,311,312}
commands =
poetry install -v
poetry run pytest
pytest {posargs}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import TYPE_CHECKING, Iterable
import typing as t

import requests # noqa: TCH002
from singer_sdk.streams import {{ cookiecutter.stream_type }}Stream
Expand All @@ -12,7 +12,7 @@
from {{ cookiecutter.library_name }}.auth import {{ cookiecutter.source_name }}Authenticator
{%- endif %}

if TYPE_CHECKING:
if t.TYPE_CHECKING:
from singer_sdk.helpers.types import Context


Expand Down Expand Up @@ -54,7 +54,7 @@ def http_headers(self) -> dict:
{%- endif %}
return headers

def parse_response(self, response: requests.Response) -> Iterable[dict]:
def parse_response(self, response: requests.Response) -> t.Iterable[dict]:
"""Parse the response and return an iterator of result records.
Args:
Expand Down
Loading

0 comments on commit 9e89e7b

Please sign in to comment.