Skip to content

Commit

Permalink
Merge branch 'main' into chore/add_raise_error_to_run_and_log
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Jul 8, 2024
2 parents cb6f219 + 2cda3b5 commit 2001bc7
Show file tree
Hide file tree
Showing 14 changed files with 302 additions and 241 deletions.
30 changes: 27 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,46 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: daily
interval: weekly
time: "12:00"
timezone: "UTC"
reviewers: [meltano/engineering]
labels: [dependencies]
commit-message:
prefix: "feat(deps): "
prefix-development: "chore(deps-dev): "
versioning-strategy: increase-if-necessary
groups:
development-dependencies:
dependency-type: development
runtime-dependencies:
dependency-type: production
update-types:
- "minor"
- "patch"
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: daily
interval: weekly
time: "12:00"
timezone: "UTC"
reviewers: [meltano/engineering]
labels: [dependencies]
commit-message:
prefix: "ci: "
groups:
ci:
patterns:
- "*"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
interval: monthly
reviewers: [meltano/engineering]
labels: [dependencies]
commit-message:
prefix: "ci: "
groups:
actions:
patterns:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
file_glob: true

- name: Publish
uses: pypa/gh-action-pypi-publish@v1.8.11
uses: pypa/gh-action-pypi-publish@v1.9.0
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-json
- id: check-toml
Expand All @@ -18,14 +18,14 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
rev: v0.5.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- id: ruff-format

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pipx install copier
Start a new EDK project using the supplied template (directly from Github):

```bash
copier gh:meltano/edk my-new-extension
copier copy gh:meltano/edk my-new-extension
```

Install the project dependencies:
Expand Down
1 change: 1 addition & 0 deletions copier_template/{{library_name}}/extension.py.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Meltano {{ extension_name }} extension."""

from __future__ import annotations

import subprocess
Expand Down
5 changes: 3 additions & 2 deletions copier_template/{{library_name}}/main.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sys
from typing import List

import structlog
import typer
import typer # type: ignore
from meltano.edk.extension import DescribeFormat
from meltano.edk.logging import default_logging_config, parse_log_level
from {{library_name}}.extension import {{ extension_name }}
Expand All @@ -16,7 +16,8 @@ log = structlog.get_logger(APP_NAME)

ext = {{ extension_name }}()

typer.core.rich = None # remove to enable stylized help output when `rich` is installed
# remove to enable stylized help output when `rich` is installed
typer.core.rich = None # type: ignore
app = typer.Typer(
name=APP_NAME,
pretty_exceptions_enable=False,
Expand Down
1 change: 1 addition & 0 deletions copier_template/{{library_name}}/pass_through.py.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Passthrough shim for {{ extension_name }} extension."""

import sys

import structlog
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
html_theme = "furo"
html_theme_options = {
# general
"source_repository": "https://github.com/meltano/sdk/",
"source_repository": "https://github.com/meltano/edk/",
"source_branch": "main",
"source_directory": "docs/",
"sidebar_hide_name": True,
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pipx install copier
Start a new EDK project using the supplied template (directly from Github):

```bash
copier gh:meltano/edk my-new-extension
copier copy gh:meltano/edk my-new-extension
```

Install the project dependencies:
Expand Down
1 change: 1 addition & 0 deletions meltano/edk/extension.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Meltano extension SDK base class and supporting methods."""

from __future__ import annotations

import sys
Expand Down
1 change: 1 addition & 0 deletions meltano/edk/logging.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Recommended logging configuration for extensions."""

from __future__ import annotations

import logging
Expand Down
13 changes: 9 additions & 4 deletions meltano/edk/process.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"""Utilities for working with subprocesses."""

from __future__ import annotations

import asyncio
import os
import signal
import subprocess
import sys
import typing as t

import structlog
Expand Down Expand Up @@ -137,10 +139,13 @@ async def _exec(
)

loop = asyncio.get_event_loop()
loop.add_signal_handler(
signal.SIGINT,
lambda s=signal.SIGINT: p.send_signal(s),
)
# Windows does not support add_signal_handler
# https://docs.python.org/3/library/asyncio-platforms.html
if sys.platform != "win32":
loop.add_signal_handler(
signal.SIGINT,
lambda s=signal.SIGINT: p.send_signal(s), # type: ignore[misc]
)

streams: list[asyncio.streams.StreamReader] = []

Expand Down
Loading

0 comments on commit 2001bc7

Please sign in to comment.