polyapi-python 0.3.8.dev0__tar.gz → 0.3.8.dev1__tar.gz

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.
Files changed (46) hide show
  1. {polyapi_python-0.3.8.dev0/polyapi_python.egg-info → polyapi_python-0.3.8.dev1}/PKG-INFO +1 -1
  2. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/deployables.py +12 -8
  3. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/prepare.py +13 -0
  4. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1/polyapi_python.egg-info}/PKG-INFO +1 -1
  5. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/pyproject.toml +1 -1
  6. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/LICENSE +0 -0
  7. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/README.md +0 -0
  8. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/__init__.py +0 -0
  9. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/__main__.py +0 -0
  10. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/api.py +0 -0
  11. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/auth.py +0 -0
  12. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/cli.py +0 -0
  13. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/client.py +0 -0
  14. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/config.py +0 -0
  15. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/constants.py +0 -0
  16. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/error_handler.py +0 -0
  17. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/exceptions.py +0 -0
  18. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/execute.py +0 -0
  19. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/function_cli.py +0 -0
  20. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/generate.py +0 -0
  21. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/parser.py +0 -0
  22. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/poly_schemas.py +0 -0
  23. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/py.typed +0 -0
  24. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/rendered_spec.py +0 -0
  25. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/schema.py +0 -0
  26. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/server.py +0 -0
  27. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/sync.py +0 -0
  28. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/typedefs.py +0 -0
  29. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/utils.py +0 -0
  30. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/variables.py +0 -0
  31. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi/webhook.py +0 -0
  32. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi_python.egg-info/SOURCES.txt +0 -0
  33. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi_python.egg-info/dependency_links.txt +0 -0
  34. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi_python.egg-info/requires.txt +0 -0
  35. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/polyapi_python.egg-info/top_level.txt +0 -0
  36. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/setup.cfg +0 -0
  37. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_api.py +0 -0
  38. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_auth.py +0 -0
  39. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_deployables.py +0 -0
  40. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_generate.py +0 -0
  41. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_parser.py +0 -0
  42. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_rendered_spec.py +0 -0
  43. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_schema.py +0 -0
  44. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_server.py +0 -0
  45. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_utils.py +0 -0
  46. {polyapi_python-0.3.8.dev0 → polyapi_python-0.3.8.dev1}/tests/test_variables.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.8.dev0
3
+ Version: 0.3.8.dev1
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
@@ -112,20 +112,24 @@ class PolyDeployConfig(TypedDict):
112
112
 
113
113
  def get_all_deployable_files_windows(config: PolyDeployConfig) -> List[str]:
114
114
  # Constructing the Windows command using dir and findstr
115
- include_pattern = " ".join(f"*.{f}" if "." in f else f"*.{f}" for f in config["include_files_or_extensions"]) or "*"
116
- exclude_pattern = '|'.join(config["exclude_dirs"])
117
- pattern = '|'.join(f"polyConfig: {name}" for name in config["type_names"]) or 'polyConfig'
115
+ include_pattern = " ".join(f"*.{f}" for f in config["include_files_or_extensions"]) or "*"
116
+ exclude_pattern = ' '.join(f"\\{f}" for f in config["exclude_dirs"])
117
+ pattern = ' '.join(f"\\<polyConfig: {name}\\>" for name in config["type_names"]) or 'polyConfig'
118
118
 
119
- exclude_command = f" | findstr /V /I \"{exclude_pattern}\"" if exclude_pattern else ''
120
- search_command = f" | findstr /M /I /F:/ /C:\"{pattern}\""
119
+ # Using two regular quotes or two smart quotes throws "The syntax of the command is incorrect".
120
+ # For some reason, starting with a regular quote and leaving the end without a quote works.
121
+ exclude_command = f" | findstr /V /I \"{exclude_pattern}" if exclude_pattern else ''
122
+ search_command = f" | findstr /M /I /F:/ {pattern}"
121
123
 
122
124
  result = []
123
125
  for dir_path in config["include_dirs"]:
124
- dir_command = f"dir /S /P /B {include_pattern} {dir_path}"
126
+ if dir_path is not '.':
127
+ include_pattern = " ".join(f"{dir_path}*.{f}" for f in config["include_files_or_extensions"]) or "*"
128
+ dir_command = f"dir {include_pattern} /S /P /B"
125
129
  full_command = f"{dir_command}{exclude_command}{search_command}"
126
130
  try:
127
131
  output = subprocess.check_output(full_command, shell=True, text=True)
128
- result.extend(output.strip().split('\r\n'))
132
+ result.extend(output.strip().split('\n'))
129
133
  except subprocess.CalledProcessError:
130
134
  pass
131
135
  return result
@@ -154,7 +158,7 @@ def get_all_deployable_files(config: PolyDeployConfig) -> List[str]:
154
158
  if not config.get("include_files_or_extensions"):
155
159
  config["include_files_or_extensions"] = ["py"]
156
160
  if not config.get("exclude_dirs"):
157
- config["exclude_dirs"] = ["poly", "node_modules", "dist", "build", "output", ".vscode", ".poly", ".github", ".husky", ".yarn"]
161
+ config["exclude_dirs"] = ["Lib", "node_modules", "dist", "build", "output", ".vscode", ".poly", ".github", ".husky", ".yarn", ".venv"]
158
162
 
159
163
  is_windows = os.name == "nt"
160
164
  if is_windows:
@@ -1,5 +1,6 @@
1
1
  import os
2
2
  import sys
3
+ import subprocess
3
4
  from typing import List, Tuple, Literal
4
5
  import requests
5
6
 
@@ -135,6 +136,18 @@ def prepare_deployables(lazy: bool = False, disable_docs: bool = False, disable_
135
136
  # NOTE: write_updated_deployable has side effects that update deployable.fileRevision which is in both this list and parsed_deployables
136
137
  for deployable in dirty_deployables:
137
138
  write_updated_deployable(deployable, disable_docs)
139
+ # Re-stage any updated staged files.
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', '')
142
+ for deployable in dirty_deployables:
143
+ try:
144
+ deployableName = deployable["file"].replace('\\', '/').replace(f"{rootPath}/", '')
145
+ if deployableName in staged:
146
+ print(f'Staging {deployableName}')
147
+ subprocess.run(['git', 'add', deployableName])
148
+ except:
149
+ print('Warning: File staging failed, check that all files are staged properly.')
150
+
138
151
 
139
152
  print("Poly deployments are prepared.")
140
153
  save_deployable_records(parsed_deployables)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.8.dev0
3
+ Version: 0.3.8.dev1
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
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "polyapi-python"
6
- version = "0.3.8.dev0"
6
+ version = "0.3.8.dev1"
7
7
  description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers"
8
8
  authors = [{ name = "Dan Fellin", email = "dan@polyapi.io" }]
9
9
  dependencies = [