refactor: Migrate RemoteWhisperTranscriber
to OpenAI SDK.
#204
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Verify preview imports only preview | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
paths: | |
- "haystack/preview/**.py" | |
jobs: | |
verify-imports: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# With the default value of 1, there are corner cases where tj-actions/changed-files | |
# fails with a `no merge base` error | |
fetch-depth: 0 | |
- name: Get changed files | |
id: files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
haystack/preview/**.py | |
- name: Check imports | |
shell: python | |
run: | | |
import re | |
regex = r"^(from haystack|import haystack)(?!\.preview| import preview)(.*)" | |
changed_files = "${{ steps.files.outputs.all_changed_files }}".split() | |
matches = {} | |
for path in changed_files: | |
with open(path, "r") as f: | |
file_matches = [] | |
for line in f.readlines(): | |
file_matches.extend(re.finditer(regex, line.strip())) | |
if file_matches: | |
matches[path] = file_matches | |
for path, match in matches.items(): | |
print(f"Bad imports in file '{path}'") | |
for m in match: | |
print(m.group()) | |
print() | |
if matches: | |
print("::error:: Imports in haystack.preview can only import from haystack.preview") | |
import sys; sys.exit(1) |