fivetran-connector-sdk 1.1.4__py3-none-any.whl → 1.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,7 +31,7 @@ from fivetran_connector_sdk.protos import connector_sdk_pb2_grpc
31
31
 
32
32
  # Version format: <major_version>.<minor_version>.<patch_version>
33
33
  # (where Major Version = 1 for GA, Minor Version is incremental MM from Jan 25 onwards, Patch Version is incremental within a month)
34
- __version__ = "1.1.4"
34
+ __version__ = "1.2.0"
35
35
 
36
36
  MAC_OS = "mac"
37
37
  WIN_OS = "windows"
@@ -49,6 +49,7 @@ REQUIREMENTS_TXT = "requirements.txt"
49
49
  PYPI_PACKAGE_DETAILS_URL = "https://pypi.org/pypi/fivetran_connector_sdk/json"
50
50
  ONE_DAY_IN_SEC = 24 * 60 * 60
51
51
  MAX_RETRIES = 3
52
+ VIRTUAL_ENV_CONFIG = "pyvenv.cfg"
52
53
 
53
54
  # Compile patterns used in the implementation
54
55
  WORD_DASH_DOT_PATTERN = re.compile(r'^[\w.-]*$')
@@ -444,7 +445,7 @@ def _yield_check(stack):
444
445
  else:
445
446
  # This should never happen
446
447
  raise RuntimeError(
447
- f"The '{called_method}' function is missing in the connector. Please ensure that the '{called_method}' function is properly defined in your code to proceed. Reference: https://fivetran.com/docs/connectors/connector-sdk/technical-reference#technicaldetailsmethods")
448
+ f"The '{called_method}' function is missing in the connector calling code '{calling_code}'. Please ensure that the '{called_method}' function is properly defined in your code to proceed. Reference: https://fivetran.com/docs/connectors/connector-sdk/technical-reference#technicaldetailsmethods")
448
449
 
449
450
 
450
451
  def _check_dict(incoming: dict, string_only: bool = False) -> dict:
@@ -729,6 +730,13 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
729
730
  force (bool): Force update an existing connection.
730
731
 
731
732
  """
733
+ # Detect and exclude virtual environment directories
734
+ venv_dirs = [name for name in os.listdir(project_path)
735
+ if os.path.isdir(os.path.join(project_path, name)) and
736
+ VIRTUAL_ENV_CONFIG in os.listdir(os.path.join(project_path, name))]
737
+
738
+ ignored_dirs = EXCLUDED_PIPREQS_DIRS + venv_dirs if venv_dirs else EXCLUDED_PIPREQS_DIRS
739
+
732
740
  # tmp_requirements is only generated when pipreqs command is successful
733
741
  tmp_requirements_file_path = os.path.join(project_path, 'tmp_requirements.txt')
734
742
  # Run the pipreqs command and capture stderr
@@ -736,7 +744,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
736
744
  while attempt < MAX_RETRIES:
737
745
  attempt += 1
738
746
  result = subprocess.run(
739
- ["pipreqs", project_path, "--savepath", tmp_requirements_file_path, "--ignore"] + EXCLUDED_PIPREQS_DIRS,
747
+ ["pipreqs", project_path, "--savepath", tmp_requirements_file_path, "--ignore", ",".join(ignored_dirs)],
740
748
  stderr=subprocess.PIPE,
741
749
  text=True # Ensures output is in string format
742
750
  )
@@ -1151,7 +1159,8 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
1151
1159
  path = os.path.join(top, name)
1152
1160
  if os.path.isdir(path):
1153
1161
  if (name not in EXCLUDED_DIRS) and (not name.startswith(".")):
1154
- dirs.append(name)
1162
+ if VIRTUAL_ENV_CONFIG not in os.listdir(path): # Check for virtual env indicator
1163
+ dirs.append(name)
1155
1164
  else:
1156
1165
  # Include all files if in `drivers` folder
1157
1166
  if os.path.basename(top) == DRIVERS:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fivetran_connector_sdk
3
- Version: 1.1.4
3
+ Version: 1.2.0
4
4
  Summary: Build custom connectors on Fivetran platform
5
5
  Author-email: Fivetran <developers@fivetran.com>
6
6
  Project-URL: Homepage, https://fivetran.com/docs/connectors/connector-sdk
@@ -1,4 +1,4 @@
1
- fivetran_connector_sdk/__init__.py,sha256=YBheEV1zFD2kAO8oF1qCNi3Pa73XNUP90PlnKhNgUDM,78705
1
+ fivetran_connector_sdk/__init__.py,sha256=XlVgreErkBABrP22wD702qUH9XsxFyqVGe_f9lb1HRI,79263
2
2
  fivetran_connector_sdk/protos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  fivetran_connector_sdk/protos/common_pb2.py,sha256=kUwVcyZHgLigNR-KnHZn7dHrlxaMnUXqzprsRx6T72M,6831
4
4
  fivetran_connector_sdk/protos/common_pb2.pyi,sha256=S0hdIzoXyyOKD5cjiGeDDLYpQ9J3LjAvu4rCj1JvJWE,9038
@@ -6,8 +6,8 @@ fivetran_connector_sdk/protos/common_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXH
6
6
  fivetran_connector_sdk/protos/connector_sdk_pb2.py,sha256=9Ke_Ti1s0vAeXapfXT-EryrT2-TSGQb8mhs4gxTpUMk,7732
7
7
  fivetran_connector_sdk/protos/connector_sdk_pb2.pyi,sha256=FWYxRgshEF3QDYAE0TM_mv4N2gGvkxCH_uPpxnMc4oA,8406
8
8
  fivetran_connector_sdk/protos/connector_sdk_pb2_grpc.py,sha256=ZfJLp4DW7uP4pFOZ74s_wQ6tD3eIPi-08UfnLwe4tzo,7163
9
- fivetran_connector_sdk-1.1.4.dist-info/METADATA,sha256=aZIJmSPr_90F58xBksv8MAnEGkVIKM7Ox1j5Ar8Ku_o,2967
10
- fivetran_connector_sdk-1.1.4.dist-info/WHEEL,sha256=nn6H5-ilmfVryoAQl3ZQ2l8SH5imPWFpm1A5FgEuFV4,91
11
- fivetran_connector_sdk-1.1.4.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
12
- fivetran_connector_sdk-1.1.4.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
13
- fivetran_connector_sdk-1.1.4.dist-info/RECORD,,
9
+ fivetran_connector_sdk-1.2.0.dist-info/METADATA,sha256=vxP6elBzDjGbZ-e67pjRf8MyPLEJISbEx9UAdsXM25U,2967
10
+ fivetran_connector_sdk-1.2.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
11
+ fivetran_connector_sdk-1.2.0.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
12
+ fivetran_connector_sdk-1.2.0.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
13
+ fivetran_connector_sdk-1.2.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.1)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5