Skip to content

Commit

Permalink
improves tap-csv dependency on MAXOS
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfix committed Jun 23, 2022
1 parent af67924 commit 6634562
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions dlt/common/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from typing import AnyStr


class DltException(Exception):
pass

Expand Down Expand Up @@ -28,10 +31,14 @@ def __init__(self, method: str) -> None:


class CannotInstallDependency(DltException):
def __init__(self, dependency: str, interpreter: str, output: str) -> None:
def __init__(self, dependency: str, interpreter: str, output: AnyStr) -> None:
self.dependency = dependency
self.interpreter = interpreter
super().__init__(f"Cannot install dependency {dependency} with {interpreter} and pip:\n{output}\n")
if isinstance(output, bytes):
str_output = output.decode("utf-8")
else:
str_output = output
super().__init__(f"Cannot install dependency {dependency} with {interpreter} and pip:\n{str_output}\n")


class VenvNotFound(DltException):
Expand Down
3 changes: 2 additions & 1 deletion examples/singer_tap_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
# here we use context manager to automatically delete venv after example was run
# the dependency is meltano version of csv tap
print("Spawning virtual environment to run singer and installing csv tap from git+https://github.com/MeltanoLabs/tap-csv.git")
# WARNING: on MACOS you need to have working gcc to use tap-csv, otherwise dependency will not be installed
with Venv.create(mkdtemp(), ["git+https://github.com/MeltanoLabs/tap-csv.git"]) as venv:
# prep singer config for csv-tap
# prep singer config for tap-csv
csv_tap_config = {
"files": [
{
Expand Down

0 comments on commit 6634562

Please sign in to comment.