From 55ef67432a91991c512ead9b0402b6d66a786d27 Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Wed, 25 Jun 2025 07:08:42 -0600 Subject: [PATCH] next --- polyapi/generate.py | 17 ++++++++--------- pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/polyapi/generate.py b/polyapi/generate.py index ee2836c..0d80249 100644 --- a/polyapi/generate.py +++ b/polyapi/generate.py @@ -2,7 +2,7 @@ import requests import os import shutil -from typing import List, Optional, Tuple, cast +from typing import Any, List, Optional, Tuple, cast from .auth import render_auth_function from .client import render_client_function @@ -41,7 +41,7 @@ def get_specs(contexts: Optional[List[str]] = None, names: Optional[List[str]] = assert api_key headers = get_auth_headers(api_key) url = f"{api_url}/specs" - params = {"noTypes": str(no_types).lower()} + params: Any = {"noTypes": str(no_types).lower()} if contexts: params["contexts"] = contexts @@ -155,7 +155,7 @@ def parse_function_specs( # Functions with serverSideAsync True will always return a Dict with execution ID if spec.get('serverSideAsync') and spec.get("function"): - spec['function']['returnType'] = {'kind': 'plain', 'value': 'object'} + spec['function']['returnType'] = {'kind': 'plain', 'value': 'object'} # type: ignore functions.append(spec) @@ -321,11 +321,9 @@ def generate(contexts: Optional[List[str]] = None, names: Optional[List[str]] = ) exit() - # Only process variables if no_types is False - if not no_types: - variables = get_variables() - if variables: - generate_variables(variables) + variables = get_variables() + if variables: + generate_variables(variables) # indicator to vscode extension that this is a polyapi-python project file_path = os.path.join(os.getcwd(), ".polyapi-python") @@ -354,8 +352,9 @@ def render_spec(spec: SpecificationDto) -> Tuple[str, str]: function_id = spec["id"] arguments: List[PropertySpecification] = [] - return_type = {} + return_type: Any = {} if spec.get("function"): + assert spec["function"] # Handle cases where arguments might be missing or None if spec["function"].get("arguments"): arguments = [ diff --git a/pyproject.toml b/pyproject.toml index 497818c..ae2466c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"] [project] name = "polyapi-python" -version = "0.3.8.dev3" +version = "0.3.8.dev4" description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers" authors = [{ name = "Dan Fellin", email = "dan@polyapi.io" }] dependencies = [