Skip to content

Commit

Permalink
Merge branch 'main' into 1733-tap-level-connector-instance-shared-wit…
Browse files Browse the repository at this point in the history
…h-streams
  • Loading branch information
edgarrmondragon authored Aug 17, 2023
2 parents 8fe9eb8 + efca24f commit ace7142
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body:
attributes:
label: Singer SDK Version
description: Version of the library you are using
placeholder: "0.31.0"
placeholder: "0.31.1"
validations:
required: true
- type: checkboxes
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.31.1 (2023-08-17)

### ✨ New

- [#1905](https://github.com/meltano/sdk/issues/1905) Add email field and use human-readable questions in templates

### 🐛 Fixes

- [#1913](https://github.com/meltano/sdk/issues/1913) Fix tap tests for multiple test classes with different input catalogs

## v0.31.0 (2023-08-07)

### ✨ New
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ packages = [

[tool.poetry.dependencies]
python = "<3.12,>=3.7.1"
singer-sdk = { version="^0.31.0" }
singer-sdk = { version="^0.31.1" }
fs-s3fs = { version = "^1.1.1", optional = true }

[tool.poetry.group.dev.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ packages = [

[tool.poetry.dependencies]
python = "<3.12,>=3.7.1"
singer-sdk = { version="^0.31.0" }
singer-sdk = { version="^0.31.1" }
fs-s3fs = { version = "^1.1.1", optional = true }
{%- if cookiecutter.stream_type in ["REST", "GraphQL"] %}
requests = "^2.31.0"
Expand All @@ -32,7 +32,7 @@ cached-property = "^1" # Remove after Python 3.7 support is dropped

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
singer-sdk = { version="^0.31.0", extras = ["testing"] }
singer-sdk = { version="^0.31.1", extras = ["testing"] }

[tool.poetry.extras]
s3 = ["fs-s3fs"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ packages = [

[tool.poetry.dependencies]
python = "<3.12,>=3.7.1"
singer-sdk = { version="^0.31.0" }
singer-sdk = { version="^0.31.1" }
fs-s3fs = { version = "^1.1.1", optional = true }
{%- if cookiecutter.serialization_method != "SQL" %}
requests = "^2.31.0"
{%- endif %}

[tool.poetry.dev-dependencies]
pytest = "^7.4.0"
singer-sdk = { version="^0.31.0", extras = ["testing"] }
singer-sdk = { version="^0.31.1", extras = ["testing"] }

[tool.poetry.extras]
s3 = ["fs-s3fs"]
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = "Meltano Core Team and Contributors"

# The full version, including alpha/beta/rc tags
release = "0.31.0"
release = "0.31.1"


# -- General configuration ---------------------------------------------------
Expand Down
86 changes: 43 additions & 43 deletions poetry.lock

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

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "singer-sdk"
version = "0.31.0"
version = "0.31.1"
description = "A framework for building Singer taps"
authors = ["Meltano Team and Contributors <[email protected]>"]
maintainers = ["Meltano Team and Contributors <[email protected]>"]
Expand Down Expand Up @@ -141,7 +141,7 @@ norecursedirs = "cookiecutter"

[tool.commitizen]
name = "cz_version_bump"
version = "0.31.0"
version = "0.31.1"
tag_format = "v$major.$minor.$patch$prerelease"
version_files = [
"docs/conf.py:^release =",
Expand Down
18 changes: 15 additions & 3 deletions singer_sdk/testing/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,20 @@
class BaseTestClass:
"""Base test class."""

params: t.ClassVar[dict] = {}
param_ids: t.ClassVar[dict] = {}
params: dict[str, t.Any]
param_ids: dict[str, list[str]]

def __init_subclass__(cls, **kwargs: t.Any) -> None:
"""Initialize a subclass.
Args:
**kwargs: Keyword arguments.
"""
# Add empty params and param_ids attributes to a direct subclass but not to
# subclasses of subclasses
if cls.__base__ == BaseTestClass:
cls.params = {}
cls.param_ids = {}


class TapTestClassFactory:
Expand Down Expand Up @@ -183,7 +195,7 @@ def _annotate_test_class( # noqa: C901
test = test_class()
test_name = f"test_{suite.kind}_{test.name}"
test_params = []
test_ids = []
test_ids: list[str] = []
for stream in streams:
test_params.extend(
[
Expand Down
22 changes: 22 additions & 0 deletions tests/core/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import pytest

from singer_sdk.testing.factory import BaseTestClass


def test_module_deprecations():
with pytest.deprecated_call():
Expand All @@ -19,3 +21,23 @@ def test_module_deprecations():
match="module singer_sdk.testing has no attribute",
):
testing.foo # noqa: B018


def test_test_class_mro():
class PluginTestClass(BaseTestClass):
pass

PluginTestClass.params["x"] = 1

class AnotherPluginTestClass(BaseTestClass):
pass

AnotherPluginTestClass.params["x"] = 2
AnotherPluginTestClass.params["y"] = 3

class SubPluginTestClass(PluginTestClass):
pass

assert PluginTestClass.params == {"x": 1}
assert AnotherPluginTestClass.params == {"x": 2, "y": 3}
assert SubPluginTestClass.params == {"x": 1}

0 comments on commit ace7142

Please sign in to comment.