polyapi-python 0.3.8.dev10__py3-none-any.whl → 0.3.9.dev2__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.
polyapi/deployables.py CHANGED
@@ -118,13 +118,13 @@ def get_all_deployable_files_windows(config: PolyDeployConfig) -> List[str]:
118
118
  pattern = ' '.join(f"/C:\"polyConfig: {name}\"" for name in config["type_names"]) or '/C:"polyConfig"'
119
119
 
120
120
  exclude_command = f" | findstr /V /I \"{exclude_pattern}\"" if exclude_pattern else ''
121
- search_command = f" | findstr /S /M /I /F:/ {pattern} *.*"
121
+ search_command = f" | findstr /M /I /F:/ {pattern}"
122
122
 
123
123
  result = []
124
124
  for dir_path in config["include_dirs"]:
125
125
  if dir_path != '.':
126
126
  include_pattern = " ".join(f"{dir_path}*.{f}" for f in config["include_files_or_extensions"]) or "*"
127
- dir_command = f"dir {include_pattern} /S /P /B > NUL"
127
+ dir_command = f"dir {include_pattern} /S /P /B"
128
128
  full_command = f"{dir_command}{exclude_command}{search_command}"
129
129
  try:
130
130
  output = subprocess.check_output(full_command, shell=True, text=True)
polyapi/poly_schemas.py CHANGED
@@ -121,7 +121,7 @@ def add_schema_file(
121
121
  # Read current __init__.py content if it exists
122
122
  init_content = ""
123
123
  if os.path.exists(init_path):
124
- with open(init_path, "r") as f:
124
+ with open(init_path, "r", encoding='utf-8') as f:
125
125
  init_content = f.read()
126
126
 
127
127
  # Prepare new content to append to __init__.py
@@ -129,12 +129,12 @@ def add_schema_file(
129
129
 
130
130
  # Use temporary files for atomic writes
131
131
  # Write to __init__.py atomically
132
- with tempfile.NamedTemporaryFile(mode="w", delete=False, dir=full_path, suffix=".tmp") as temp_init:
132
+ with tempfile.NamedTemporaryFile(mode="w", delete=False, dir=full_path, suffix=".tmp", encoding='utf-8') as temp_init:
133
133
  temp_init.write(new_init_content)
134
134
  temp_init_path = temp_init.name
135
135
 
136
136
  # Write to schema file atomically
137
- with tempfile.NamedTemporaryFile(mode="w", delete=False, dir=full_path, suffix=".tmp") as temp_schema:
137
+ with tempfile.NamedTemporaryFile(mode="w", delete=False, dir=full_path, suffix=".tmp", encoding='utf-8') as temp_schema:
138
138
  temp_schema.write(schema_defs)
139
139
  temp_schema_path = temp_schema.name
140
140
 
@@ -205,7 +205,7 @@ def create_schema(
205
205
  def add_schema_to_init(full_path: str, spec: SchemaSpecDto):
206
206
  init_the_init(full_path, code_imports="")
207
207
  init_path = os.path.join(full_path, "__init__.py")
208
- with open(init_path, "a") as f:
208
+ with open(init_path, "a", encoding='utf-8') as f:
209
209
  f.write(render_poly_schema(spec) + "\n\n")
210
210
 
211
211
 
polyapi/prepare.py CHANGED
@@ -138,11 +138,13 @@ def prepare_deployables(lazy: bool = False, disable_docs: bool = False, disable_
138
138
  write_updated_deployable(deployable, disable_docs)
139
139
  # Re-stage any updated staged files.
140
140
  staged = subprocess.check_output('git diff --name-only --cached', shell=True, text=True, ).split('\n')
141
+ rootPath = subprocess.check_output('git rev-parse --show-toplevel', shell=True, text=True).replace('\n', '')
141
142
  for deployable in dirty_deployables:
142
143
  try:
143
- if deployable["file"] in staged:
144
- print(f'Staging {deployable["file"]}')
145
- subprocess.run(['git', 'add', deployable["file"]])
144
+ deployableName = deployable["file"].replace('\\', '/').replace(f"{rootPath}/", '')
145
+ if deployableName in staged:
146
+ print(f'Staging {deployableName}')
147
+ subprocess.run(['git', 'add', deployableName])
146
148
  except:
147
149
  print('Warning: File staging failed, check that all files are staged properly.')
148
150
 
polyapi/schema.py CHANGED
@@ -93,7 +93,7 @@ def generate_schema_types(input_data: Dict, root=None):
93
93
  with contextlib.redirect_stdout(None):
94
94
  process_config(config, [tmp_input])
95
95
 
96
- with open(tmp_output) as f:
96
+ with open(tmp_output, encoding='utf-8') as f:
97
97
  output = f.read()
98
98
 
99
99
  output = clean_malformed_examples(output)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.8.dev10
3
+ Version: 0.3.9.dev2
4
4
  Summary: The Python Client for PolyAPI, the IPaaS by Developers for Developers
5
5
  Author-email: Dan Fellin <dan@polyapi.io>
6
6
  License: MIT License
@@ -6,26 +6,26 @@ polyapi/cli.py,sha256=unKqAoZ1hTGAeyYRfNQ6jO15Um7N4F95k__1qFue5bI,10659
6
6
  polyapi/client.py,sha256=DW6ljG_xCwAo2yz23A9QfLooE6ZUDvSpdA4e_dCQjiQ,1418
7
7
  polyapi/config.py,sha256=cAMv2n9tGN_BTvqt7V32o5F86qRhxAKyey_PoId2D8s,7638
8
8
  polyapi/constants.py,sha256=sc-FnS0SngBLvSu1ZWMs0UCf9EYD1u1Yhfr-sZXGLns,607
9
- polyapi/deployables.py,sha256=8x-Y7MlpWnTqsWhidmO6yVZe2nTChzma6hJNVsfg94s,12113
9
+ polyapi/deployables.py,sha256=vaZvdkPpwgjVtRXD4IxFsJ90Qmgs-AOIB3ygy4QCG78,12100
10
10
  polyapi/error_handler.py,sha256=I_e0iz6VM23FLVQWJljxs2NGcl_OODbi43OcbnqBlp8,2398
11
11
  polyapi/exceptions.py,sha256=Zh7i7eCUhDuXEdUYjatkLFTeZkrx1BJ1P5ePgbJ9eIY,89
12
12
  polyapi/execute.py,sha256=sjI6BMBYPSCD6UngV9DzpJIRSU6p02aShNaTXhDExtY,3457
13
13
  polyapi/function_cli.py,sha256=H0sVrbvRBXw_xeApe2MvQw8p_xE7jVTTOU-07Dg041A,4220
14
14
  polyapi/generate.py,sha256=slCw9AOvQHQ8UtEaumFI1NoRvjH2Dj3Y33u7imQqi8c,19521
15
15
  polyapi/parser.py,sha256=20ZE7kSXx3UL7QVSIYYxzsnJlygVbsaDAg9q7c41WxQ,20695
16
- polyapi/poly_schemas.py,sha256=760g-rBou-XT0y7N0THHHJBHlqIrOhVsAj500T6Qp0Q,8994
17
- polyapi/prepare.py,sha256=pRWBhpgqMtKP04P9F6PIA3eCkOpCxQSv9TZdR3qR34I,7216
16
+ polyapi/poly_schemas.py,sha256=fZ6AGvHcOKQJtlrzSuzeBNed5DxPMA2dJGdJvuFCHWM,9066
17
+ polyapi/prepare.py,sha256=NQzpMIoakNovStvOGOmqSYIpTwiWXaweNSE9se10A2E,7420
18
18
  polyapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  polyapi/rendered_spec.py,sha256=nJEj2vRgG3N20fU4s-ThRtOIwAuTzXwXuOBIkXljDVc,2240
20
- polyapi/schema.py,sha256=zMN0zr_dku-NzmL8e0C6lbym8I0SrzXxtU5I8-YwHkM,5291
20
+ polyapi/schema.py,sha256=-mtRV5iL3CV0X3phXhGYFV8sLz0KouTACOKWyGO9Pwc,5309
21
21
  polyapi/server.py,sha256=YXWxhYBx-hluwDQ8Jvfpy2s8ogz0GsNTMcZVNcP5ca8,2147
22
22
  polyapi/sync.py,sha256=PGdC0feBBjEVrF3d9EluW_OAxbWuzSrfh84czma8kWg,6476
23
23
  polyapi/typedefs.py,sha256=vJLZYBNmR3i8yQEDYlu1UfvtJyg6E1R1QyGlgFUm2rU,2362
24
24
  polyapi/utils.py,sha256=1F7Dwst_PbPuUBUSxx5r8d2DHDgqHtu07QW92T_YSdw,12454
25
25
  polyapi/variables.py,sha256=VAp2d5I-4WLYHCPF1w3pqU4-z8_XRQpYW-ddOw6G5S4,7268
26
26
  polyapi/webhook.py,sha256=gWYXHz0PnB_uY_lnHeUlg3EIHfTGwF-Tc6UaatldZBw,5333
27
- polyapi_python-0.3.8.dev10.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
28
- polyapi_python-0.3.8.dev10.dist-info/METADATA,sha256=gEaVycjq9LZDUwCA43SyffH-G52cN1CnB1OP004FHz8,5785
29
- polyapi_python-0.3.8.dev10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
- polyapi_python-0.3.8.dev10.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
31
- polyapi_python-0.3.8.dev10.dist-info/RECORD,,
27
+ polyapi_python-0.3.9.dev2.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
28
+ polyapi_python-0.3.9.dev2.dist-info/METADATA,sha256=usG3SiNj-dqnbOg8FPn3c_lW8gTYTNgKKnWqPuhlrew,5784
29
+ polyapi_python-0.3.9.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
+ polyapi_python-0.3.9.dev2.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
31
+ polyapi_python-0.3.9.dev2.dist-info/RECORD,,