Skip to content

Commit

Permalink
Update Ruff config
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Jan 28, 2025
1 parent 197eb23 commit b30d17a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-json
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
rev: v0.9.3
hooks:
- id: ruff
args: [--fix]
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ plugins = "sqlalchemy.ext.mypy.plugin" # TODO: Remove this when SQLAlchemy 2.0

[tool.ruff]
src = ["tap_mysql"]
target-version = "py38"
target-version = "py39"

[[tool.mypy.overrides]]
ignore_missing_imports = true
Expand All @@ -74,11 +74,8 @@ module = [

[tool.ruff.lint]
ignore = [
"ANN101", # missing-type-self
"ANN102", # missing-type-cls
# Conflict with Ruff's formatter
"COM812",
"ISC001",
]
select = ["ALL"]

Expand Down
7 changes: 5 additions & 2 deletions tap_mysql/client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""SQL client handling."""

from __future__ import annotations

import datetime
from typing import TYPE_CHECKING, Any, Iterable
from typing import TYPE_CHECKING, Any

import singer_sdk.helpers._typing
import sqlalchemy
Expand All @@ -12,6 +13,8 @@
from singer_sdk.helpers._typing import TypeConformanceLevel

if TYPE_CHECKING:
from collections.abc import Iterable

from sqlalchemy.engine import Engine
from sqlalchemy.engine.reflection import Inspector

Expand Down Expand Up @@ -211,7 +214,7 @@ def get_schema_names(self, engine: Engine, inspected: Inspector) -> list[str]:
return self.config["filter_schemas"]
return super().get_schema_names(engine, inspected)

def discover_catalog_entry( # noqa: PLR0913
def discover_catalog_entry(
self,
engine: Engine,
inspected: Inspector,
Expand Down
6 changes: 5 additions & 1 deletion tap_mysql/tap.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""mysql tap class."""

from __future__ import annotations

import atexit
import io
import signal
import sys
from functools import cached_property
from typing import Any, Mapping, cast
from typing import TYPE_CHECKING, Any, cast

import paramiko
from singer_sdk import SQLTap, Stream
Expand All @@ -17,6 +18,9 @@

from tap_mysql.client import MySQLConnector, MySQLStream

if TYPE_CHECKING:
from collections.abc import Mapping


class TapMySQL(SQLTap):
"""Singer tap for MySQL."""
Expand Down
1 change: 1 addition & 0 deletions tests/test_selected_columns_only.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests selected columns only from stream."""

# flake8: noqa
import json

Expand Down
1 change: 0 additions & 1 deletion tests/test_ssh_tunnel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests standard tap features using the built-in SDK tests library."""


from tap_mysql.tap import TapMySQL

TABLE_NAME = "test_replication_key"
Expand Down

0 comments on commit b30d17a

Please sign in to comment.