Skip to content

Commit

Permalink
Do not flag unimplemented methods (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Nov 3, 2023
1 parent f28dd93 commit edf72f9
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/check_python_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
'viam.app.app_client.AppClient.get_rover_rental_parts',
]

def is_unimplemented(obj):
if obj.find(class_="property"):
return "abstract" in obj.find(class_="property").text
else:
return False

def make_soup(url):
page = urlopen(url)
Expand Down Expand Up @@ -89,6 +94,7 @@ def parse(type, names):
# Find all python methods objects on Python docs site soup
py_methods_sdk_docs = soup.find_all("dl", class_="py method")
py_methods_sdk_docs_filtered_ids = []
py_methods_sdk_docs_undocumented_ids = []

# Get ids and filter list
for tag in py_methods_sdk_docs:
Expand All @@ -100,7 +106,11 @@ def parse(type, names):
and not id.endswith(".get_resource_name") and not id.endswith(".get_operation") \
and not id.endswith(".LOGGER") and not id.endswith("__") \
and not id in ignore_apis:
py_methods_sdk_docs_filtered_ids.append(id)
if is_unimplemented(tag_sigobject):
py_methods_sdk_docs_undocumented_ids.append(id)
else:
py_methods_sdk_docs_filtered_ids.append(id)


# Get methods information
method_text = []
Expand Down Expand Up @@ -248,13 +258,14 @@ def parse(type, names):


print(f"SDK methods missing for type {type}: {sdk_methods_missing}\n\n")
print(f"SDK methods unimplemented for type {type}: {py_methods_sdk_docs_undocumented_ids}\n\n")
print(f"SDK methods found for type {type}: {sdk_methods_found}\n\n")

return sdk_methods_missing, methods_dict

def print_method_information(missing_methods, methods_dict):
for method in missing_methods:
print(f"Method: {method} \n\n{methods_dict.get(method)}")
print(f"Method: {method}\n\n{methods_dict.get(method)}")
print("---\n")


Expand All @@ -271,7 +282,7 @@ def print_method_information(missing_methods, methods_dict):
total_sdk_methods_missing.extend(missing_robot_apis)

if total_sdk_methods_missing:
print(f"Total SDK methods missing: {total_sdk_methods_missing} \n\nMissing Method Information: \n")
print(f"Total SDK methods missing: {total_sdk_methods_missing} \n\nMissing Method Information:\n")
print_method_information(missing_services, services_dict)
print_method_information(missing_components, components_dict)
print_method_information(missing_app_apis, app_apis_dict)
Expand Down
96 changes: 96 additions & 0 deletions docs/program/apis/cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -1328,3 +1328,99 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/

{{% /tab %}}
{{< /tabs >}}

<!-- ### GetUserIdByEmail
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### CreateOrganization
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### ListOrganizationsByUser
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### DeleteOrganization
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### CreateOrganizationInvite
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### DeleteOrganizationMember
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### DeleteOrganizationInvite
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### ResendOrganinzationInvite
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### ShareLocation
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### UnshareLocation
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### CheckPermissions
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}}
### CreateKey
{{< tabs >}}
{{% tab name="Python" %}}
{{% /tab %}}
{{< /tabs >}} -->
12 changes: 12 additions & 0 deletions static/include/services/apis/cloud.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
<!-- prettier-ignore -->
Method Name | Description
----------- | -----------
<!-- [`GetUserIdByEmail`](/program/apis/cloud/#getuseridbyemail) | Not implemented. -->
<!-- [`CreateOrganization`](/program/apis/cloud/#createorganization) | Not implemented. -->
[`ListOrganizations`](/program/apis/cloud/#listorganizations) | List the {{< glossary_tooltip term_id="organization" text="organizations" >}} the user owns.
<!-- [`ListOrganizationsByUser`](/program/apis/cloud/#listorganizationsbyuser) | Not implemented. -->
[`GetOrganizationNamespaceAvailability`](/program/apis/cloud/#getorganizationnamespaceavailability) | Check the availability of an organization namespace.
<!-- [`DeleteOrganization`](/program/apis/cloud/#deleteorganization) | Not implemented. -->
[`ListOrganizationMembers`](/program/apis/cloud/#listorganizationmembers) | List the members and invites of the current organization.
<!-- [`CreateOrganizationInvite`](/program/apis/cloud/#getuseridbyemail) | Not implemented. -->
[`UpdateOrganizationInviteAuthorizations`](/program/apis/cloud/#updateorganizationinviteauthorizations) | Update the authorizations attached to an organization invite that has already been created.
<!-- [`DeleteOrganizationInvite`](/program/apis/cloud/#getuseridbyemail) | Not implemented. -->
<!-- [`DeleteOrganizationMember`](/program/apis/cloud/#getuseridbyemail) | Not implemented. -->
<!-- [`ResendOrganinzationInvite`](/program/apis/cloud/#getuseridbyemail) | Not implemented. -->
[`CreateLocation`](/program/apis/cloud/#createlocation) | Create and name a {{< glossary_tooltip term_id="location" text="location" >}}.
[`GetLocation`](/program/apis/cloud/#getlocation) | Get a location by its ID.
[`UpdateLocation`](/program/apis/cloud/#updatelocation ) | Change the name of and/or assign a parent location to a location.
[`DeleteLocation`](/program/apis/cloud/#deletelocation ) | Delete a location.
[`ListLocations`](/program/apis/cloud/#listlocations ) | List locations.
<!-- [`ShareLocation`](/program/apis/cloud/#sharelocation) | Not implemented. -->
<!-- [`UnshareLocation`](/program/apis/cloud/#unsharelocation) | Not implemented. -->
[`LocationAuth`](/program/apis/cloud/#locationauth ) | Get a location's authorization (location secrets).
[`CreateLocationSecret`](/program/apis/cloud/#createlocationsecret ) | Create a new location secret.
[`DeleteLocationSecret`](/program/apis/cloud/#deletelocationsecret ) | Delete a location secret.
Expand Down Expand Up @@ -38,8 +48,10 @@ Method Name | Description
[`AddRole`](/program/apis/cloud/#addrole ) | Add a role (owner or operator).
[`RemoveRole`](/program/apis/cloud/#removerole ) | Remove a role (owner or operator).
[`ListAuthorizations`](/program/apis/cloud/#listauthorizations ) | List authorizations (owners and operators).
<!-- [`CheckPermissions`](/program/apis/cloud/#checkpermissions) | Not implemented. -->
[`CreateModule`](/program/apis/cloud/#createmodule ) | Create a {{< glossary_tooltip term_id="module" text="module" >}}.
[`UpdateModule`](/program/apis/cloud/#updatemodule ) | Update module metadata.
[`UploadModuleFile`](/program/apis/cloud/#uploadmodulefile ) | Upload a module file.
[`GetModule`](/program/apis/cloud/#getmodule ) | Get a module by its ID.
[`ListModules`](/program/apis/cloud/#listmodules ) | List available modules.
<!-- [`CreateKey`](/program/apis/cloud/#createkey) | Not implemented. -->

0 comments on commit edf72f9

Please sign in to comment.