From 4c4ad3c717c95b594a9738928cdf5948bfbd5bce Mon Sep 17 00:00:00 2001 From: Filip Francetic Date: Thu, 19 Dec 2024 05:28:19 -0800 Subject: [PATCH] Delete thrift py3 services reflection Summary: The ability to reflect on services is something that is no longer used, so deleting the relevant code that exposes it. There are some SvIf bindings in `services_reflection.pxd`, and those need to remain because they're needed in the services/clients files (I tried moving them into metadata but that broke for files that define types but not services, as you get a py3-types -> py3-metadata -> cpp2-services dependency chain), so renaming those files to services_interface to reflect what they actually mean and deleting `services_reflection.py`. #buildall Reviewed By: ahilger Differential Revision: D67328763 fbshipit-source-id: 332a2d4b8c8c25364b38d4c304c2b51b33f3345e --- .../generate/t_mstch_py3_generator.cc | 3 +- .../templates/py3/clients.pyx.mustache | 9 +- .../templates/py3/services.pyx.mustache | 9 +- ...stache => services_interface.pxd.mustache} | 0 .../py3/services_reflection.py.mustache | 96 -- .../out/py3/gen-py3/module/clients.pyx | 33 +- .../out/py3/gen-py3/module/services.pyx | 33 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 313 ----- .../out/py3/gen-py3/module/clients.pyx | 21 +- .../out/py3/gen-py3/module/services.pyx | 21 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 300 ----- .../test/fixtures/basic/module/clients.pyx | 27 +- .../test/fixtures/basic/module/services.pyx | 27 +- ..._reflection.pxd => services_interface.pxd} | 0 .../basic/module/services_reflection.py | 342 ------ .../out/py3/gen-py3/module/clients.pyx | 9 +- .../out/py3/gen-py3/module/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 90 -- ..._reflection.pxd => services_interface.pxd} | 0 .../gen-py3/service/services_reflection.py | 91 -- .../py3_service/gen-py3/service/clients.pyx | 9 +- .../py3_service/gen-py3/service/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../gen-py3/service/services_reflection.py | 91 -- .../out/py3/gen-py3/module/clients.pyx | 21 +- .../out/py3/gen-py3/module/services.pyx | 21 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 90 -- .../another_interactions/shared/clients.pyx | 9 +- .../another_interactions/shared/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../shared/services_reflection.py | 28 - .../fixtures/interactions/module/clients.pyx | 33 +- .../fixtures/interactions/module/services.pyx | 33 +- ..._reflection.pxd => services_interface.pxd} | 0 .../module/services_reflection.py | 247 ---- .../out/py3/gen-py3/module/clients.pyx | 21 +- .../out/py3/gen-py3/module/services.pyx | 21 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 1093 ----------------- .../test/module/module/clients.pyx | 9 +- .../test/module/module/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../test/module/module/services_reflection.py | 50 - .../py3_emptyns/gen-py3/emptyns/clients.pyx | 9 +- .../py3_emptyns/gen-py3/emptyns/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../gen-py3/emptyns/services_reflection.py | 50 - .../extend/test/extend/clients.pyx | 9 +- .../extend/test/extend/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../extend/test/extend/services_reflection.py | 51 - .../my/namespacing/test/hsmodule/clients.pyx | 9 +- .../my/namespacing/test/hsmodule/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../test/hsmodule/services_reflection.py | 50 - .../namespace_from_package/module/clients.pyx | 9 +- .../module/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../module/services_reflection.py | 50 - .../module/clients.pyx | 9 +- .../module/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../module/services_reflection.py | 50 - .../params/out/py3/gen-py3/module/clients.pyx | 9 +- .../out/py3/gen-py3/module/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 138 --- .../py3/out/py3/gen-py3/module/clients.pyx | 21 +- .../py3/out/py3/gen-py3/module/services.pyx | 21 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 971 --------------- ..._reflection.pxd => services_interface.pxd} | 0 .../gen-py3/module/services_reflection.py | 971 --------------- .../out/py3_empty/gen-py3/empty/clients.pyx | 9 +- .../out/py3_empty/gen-py3/empty/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../gen-py3/empty/services_reflection.py | 28 - .../out/py3/gen-py3/module/clients.pyx | 21 +- .../out/py3/gen-py3/module/services.pyx | 21 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 98 -- .../gen-py3/module_structs/clients.pyx | 3 +- .../gen-py3/module_structs/services.pyx | 3 +- ..._reflection.pxd => services_interface.pxd} | 0 .../module_structs/services_reflection.py | 18 - .../sink/out/py3/gen-py3/module/clients.pyx | 9 +- .../sink/out/py3/gen-py3/module/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 28 - .../stream/out/py3/gen-py3/module/clients.pyx | 9 +- .../out/py3/gen-py3/module/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3/gen-py3/module/services_reflection.py | 248 ---- .../out/py3_s/gen-py3/s/clients.pyx | 9 +- .../out/py3_s/gen-py3/s/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../py3_s/gen-py3/s/services_reflection.py | 45 - .../thrift/fixtures/types/module/clients.pyx | 9 +- .../thrift/fixtures/types/module/services.pyx | 9 +- ..._reflection.pxd => services_interface.pxd} | 0 .../types/module/services_reflection.py | 73 -- 105 files changed, 141 insertions(+), 6252 deletions(-) rename thrift/compiler/generate/templates/py3/{services_reflection.pxd.mustache => services_interface.pxd.mustache} (100%) delete mode 100644 thrift/compiler/generate/templates/py3/services_reflection.py.mustache rename thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services_reflection.py rename thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/services_reflection.py rename thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services_reflection.py rename thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services_reflection.py rename thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services_reflection.py rename thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services_reflection.py rename thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services_reflection.py rename thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services_reflection.py rename thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services_reflection.py rename thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services_reflection.py rename thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services_reflection.py rename thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services_reflection.py rename thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services_reflection.py rename thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services_reflection.py rename thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services_reflection.py rename thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/{services_reflection.pxd => services_interface.pxd} (100%) delete mode 100644 thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services_reflection.py diff --git a/thrift/compiler/generate/t_mstch_py3_generator.cc b/thrift/compiler/generate/t_mstch_py3_generator.cc index e3df77790fc..2675ce8e6e0 100644 --- a/thrift/compiler/generate/t_mstch_py3_generator.cc +++ b/thrift/compiler/generate/t_mstch_py3_generator.cc @@ -1609,8 +1609,7 @@ void t_mstch_py3_generator::generate_services() { std::vector cythonFiles{ "clients_wrapper.pxd", "services_wrapper.pxd", - "services_reflection.pxd", - "services_reflection.py", + "services_interface.pxd", }; std::vector cppFiles{ diff --git a/thrift/compiler/generate/templates/py3/clients.pyx.mustache b/thrift/compiler/generate/templates/py3/clients.pyx.mustache index f99121f506e..30a0d8ca02f 100644 --- a/thrift/compiler/generate/templates/py3/clients.pyx.mustache +++ b/thrift/compiler/generate/templates/py3/clients.pyx.mustache @@ -87,8 +87,7 @@ import {{#includeNamespace}}{{value}}.{{/includeNamespace}}clients as _{{#includ {{/hasServices?}} {{/program:includeNamespaces}} -import {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.services_reflection as _services_reflection -cimport {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.services_reflection as _services_reflection +cimport {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.services_interface as _fbthrift_services_interface {{#program:services}} from {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.clients_wrapper cimport c{{service:name}}AsyncClient, c{{service:name}}ClientWrapper @@ -199,14 +198,10 @@ cdef class {{service:name}}({{#service:extends}}{{#service:externalProgram?}}{{! return self.create{{service:name}}() {{/service:supportedInteractions}} - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__{{service:name}}(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.c{{service:cpp_name}}SvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.c{{service:cpp_name}}SvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/generate/templates/py3/services.pyx.mustache b/thrift/compiler/generate/templates/py3/services.pyx.mustache index 89ad700ce4d..1ca4493ffa3 100644 --- a/thrift/compiler/generate/templates/py3/services.pyx.mustache +++ b/thrift/compiler/generate/templates/py3/services.pyx.mustache @@ -93,8 +93,7 @@ cimport {{#includeNamespace}}{{value}}.{{/includeNamespace}}cbindings as _{{#inc {{/hasTypes?}} {{/program:includeNamespaces}} -import {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.services_reflection as _services_reflection -cimport {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.services_reflection as _services_reflection +cimport {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.services_interface as _fbthrift_services_interface import asyncio import functools @@ -259,14 +258,10 @@ cdef class {{service:name}}Interface( {{/function:return_type}} {{/service:supportedFunctions}} - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__{{service:name}}(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.c{{service:cpp_name}}SvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.c{{service:cpp_name}}SvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/generate/templates/py3/services_reflection.pxd.mustache b/thrift/compiler/generate/templates/py3/services_interface.pxd.mustache similarity index 100% rename from thrift/compiler/generate/templates/py3/services_reflection.pxd.mustache rename to thrift/compiler/generate/templates/py3/services_interface.pxd.mustache diff --git a/thrift/compiler/generate/templates/py3/services_reflection.py.mustache b/thrift/compiler/generate/templates/py3/services_reflection.py.mustache deleted file mode 100644 index 29c2e4567fd..00000000000 --- a/thrift/compiler/generate/templates/py3/services_reflection.py.mustache +++ /dev/null @@ -1,96 +0,0 @@ -{{! - - Copyright (c) Meta Platforms, Inc. and affiliates. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -}}{{! -Reflection functions for clients and services -}} -{{> common/auto_generated_py}} - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - -{{#program:includeNamespaces}} -{{#hasTypes?}} -import {{#includeNamespace}}{{value}}.{{/includeNamespace}}types as _{{#includeNamespace}}{{value}}_{{/includeNamespace}}types -{{/hasTypes?}} -{{/program:includeNamespaces}} - -import {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.types as _{{#program:py3Namespaces}}{{value}}_{{/program:py3Namespaces}}{{program:name}}_types -{{#program:services}} - - -def get_reflection__{{service:name}}(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="{{service:name}}", - methods=None, - annotations={ - {{#service:annotations}} - {{> common/annotation }} - {{/service:annotations}} - }, - ) -{{#service:supportedFunctions}} - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="{{function:name}}", - arguments=( - {{#function:args}} - __ArgumentSpec.__new__( - __ArgumentSpec, - name="{{field:name}}", - type={{#field:type}}{{> types/python_type}}{{/field:type}}, - kind={{#field:type}}{{> types/thrift_number_type}}{{/field:type}}, - annotations={ - {{#field:annotations}} - {{> common/annotation }} - {{/field:annotations}} - }, - ), - {{/function:args}} - ), - result={{#function:return_type}}{{! - }}{{#type:void?}}{{^function:stream?}}None{{/function:stream?}}{{/type:void?}}{{! - }}{{#function:stream?}}{{! - }}{{> clients/stream_response_class_name}} if for_clients else {{! - }}{{> services/stream_response_class_name}}{{! - }}{{/function:stream?}}{{! - }}{{^type:void?}}{{^function:stream?}}{{> types/python_type}}{{/function:stream?}}{{/type:void?}}{{! - }}{{/function:return_type}}, - result_kind={{#function:return_type}}{{! - }}{{^function:stream?}}{{> types/thrift_number_type}}{{/function:stream?}}{{! - }}{{#function:stream?}}__NumberType.NOT_A_NUMBER{{/function:stream?}}{{/function:return_type}}, - exceptions=( - {{#function:exceptions}} - {{#field:type}}{{> types/python_type}}{{/field:type}}, - {{/function:exceptions}} - ), - annotations={ - {{#function:annotations}} - {{> common/annotation }} - {{/function:annotations}} - }, - ) - ) -{{/service:supportedFunctions}} - return spec -{{/program:services}} diff --git a/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/clients.pyx index a4a2cb2be9e..1aa8131cdf0 100644 --- a/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/clients.pyx @@ -53,8 +53,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cMyServiceAsyncClient, cMyServiceClientWrapper from module.clients_wrapper cimport cMyServicePrioParentAsyncClient, cMyServicePrioParentClientWrapper @@ -487,14 +486,10 @@ cdef class MyService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -568,14 +563,10 @@ cdef class MyServicePrioParent(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyServicePrioParent(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServicePrioParentSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServicePrioParentSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -624,14 +615,10 @@ cdef class MyServicePrioChild(MyServicePrioParent): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyServicePrioChild(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServicePrioChildSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServicePrioChildSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -697,14 +684,10 @@ cdef class BadService(thrift.py3.client.Client): ): return self.createBadInteraction() - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__BadService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cGoodServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cGoodServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -826,14 +809,10 @@ cdef class FooBarBazService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__FooBarBazService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cFooBarBazServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cFooBarBazServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services.pyx index 436021bbeca..5b59849f776 100644 --- a/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services.pyx @@ -57,8 +57,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -223,14 +222,10 @@ cdef class MyServiceInterface( self): raise NotImplementedError("async def doNothing is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -271,14 +266,10 @@ cdef class MyServicePrioParentInterface( self): raise NotImplementedError("async def pong is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyServicePrioParent(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServicePrioParentSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServicePrioParentSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -310,14 +301,10 @@ MyServicePrioParentInterface self): raise NotImplementedError("async def pang is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyServicePrioChild(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServicePrioChildSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServicePrioChildSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -349,14 +336,10 @@ cdef class BadServiceInterface( self): raise NotImplementedError("async def bar is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__BadService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cGoodServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cGoodServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -406,14 +389,10 @@ cdef class FooBarBazServiceInterface( self): raise NotImplementedError("async def baz is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__FooBarBazService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cFooBarBazServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cFooBarBazServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index 74646fb0801..00000000000 --- a/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,313 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/basic-annotations/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__MyService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="ping", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.MyException, - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getRandomData", - arguments=( - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="hasDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="putDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="data", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="lobDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="data", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - """cpp.name""": """dataStr""", }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="doNothing", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__MyServicePrioParent(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyServicePrioParent", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="ping", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="pong", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__MyServicePrioChild(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyServicePrioChild", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="pang", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__BadService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="BadService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="bar", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__FooBarBazService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="FooBarBazService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="foo", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="bar", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="baz", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/clients.pyx index 6380ab2358f..f24f1c89384 100644 --- a/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/clients.pyx @@ -53,8 +53,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cMyServiceAsyncClient, cMyServiceClientWrapper from module.clients_wrapper cimport cMyServiceFastAsyncClient, cMyServiceFastClientWrapper @@ -337,14 +336,10 @@ cdef class MyService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -496,14 +491,10 @@ cdef class MyServiceFast(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyServiceFast(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceFastSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceFastSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -581,14 +572,10 @@ cdef class DbMixedStackArguments(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__DbMixedStackArguments(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cDbMixedStackArgumentsSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cDbMixedStackArgumentsSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services.pyx index 20656c9aa9b..1f936f5ef69 100644 --- a/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services.pyx @@ -57,8 +57,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -210,14 +209,10 @@ cdef class MyServiceInterface( data): raise NotImplementedError("async def lobDataById is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -282,14 +277,10 @@ cdef class MyServiceFastInterface( data): raise NotImplementedError("async def lobDataById is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyServiceFast(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceFastSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceFastSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -332,14 +323,10 @@ cdef class DbMixedStackArgumentsInterface( key): raise NotImplementedError("async def getDataByKey1 is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__DbMixedStackArguments(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cDbMixedStackArgumentsSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cDbMixedStackArgumentsSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index b2b9d00be6c..00000000000 --- a/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,300 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/basic-stack-arguments/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__MyService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="hasDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="putDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="data", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="lobDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="data", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__MyServiceFast(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyServiceFast", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="hasDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="putDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="data", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="lobDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="data", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__DbMixedStackArguments(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="DbMixedStackArguments", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getDataByKey0", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="key", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bytes, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - """cpp.stack_arguments""": """0""", }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getDataByKey1", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="key", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bytes, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/clients.pyx b/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/clients.pyx index 7b86319325f..35e42066592 100644 --- a/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/clients.pyx +++ b/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/clients.pyx @@ -53,8 +53,7 @@ cimport test.fixtures.basic.module.types as _test_fixtures_basic_module_types cimport test.fixtures.basic.module.cbindings as _test_fixtures_basic_module_cbindings import test.fixtures.basic.module.types as _test_fixtures_basic_module_types -import test.fixtures.basic.module.services_reflection as _services_reflection -cimport test.fixtures.basic.module.services_reflection as _services_reflection +cimport test.fixtures.basic.module.services_interface as _fbthrift_services_interface from test.fixtures.basic.module.clients_wrapper cimport cFooServiceAsyncClient, cFooServiceClientWrapper from test.fixtures.basic.module.clients_wrapper cimport cFB303ServiceAsyncClient, cFB303ServiceClientWrapper @@ -287,14 +286,10 @@ cdef class FooService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__FooService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cFooServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cFooServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -349,14 +344,10 @@ cdef class FB303Service(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__FB303Service(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cFB303ServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cFB303ServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -670,14 +661,10 @@ cdef class MyService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -755,14 +742,10 @@ cdef class DbMixedStackArguments(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__DbMixedStackArguments(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cDbMixedStackArgumentsSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cDbMixedStackArgumentsSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services.pyx b/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services.pyx index cd3ea7fedc7..cfd6f84949d 100644 --- a/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services.pyx +++ b/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services.pyx @@ -57,8 +57,7 @@ cimport test.fixtures.basic.module.types as _test_fixtures_basic_module_types cimport test.fixtures.basic.module.cbindings as _test_fixtures_basic_module_cbindings import test.fixtures.basic.module.types as _test_fixtures_basic_module_types -import test.fixtures.basic.module.services_reflection as _services_reflection -cimport test.fixtures.basic.module.services_reflection as _services_reflection +cimport test.fixtures.basic.module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -194,14 +193,10 @@ cdef class FooServiceInterface( self): raise NotImplementedError("async def simple_rpc is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__FooService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cFooServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cFooServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -234,14 +229,10 @@ cdef class FB303ServiceInterface( int_parameter): raise NotImplementedError("async def simple_rpc is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__FB303Service(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cFB303ServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cFB303ServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -362,14 +353,10 @@ cdef class MyServiceInterface( self): raise NotImplementedError("async def rpc_skipped_codegen is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -412,14 +399,10 @@ cdef class DbMixedStackArgumentsInterface( key): raise NotImplementedError("async def getDataByKey1 is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__DbMixedStackArguments(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cDbMixedStackArgumentsSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cDbMixedStackArgumentsSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services_reflection.pxd b/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services_reflection.py b/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services_reflection.py deleted file mode 100644 index 2504344d444..00000000000 --- a/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/services_reflection.py +++ /dev/null @@ -1,342 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/basic/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import test.fixtures.basic.module.types as _test_fixtures_basic_module_types - - -def get_reflection__FooService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="FooService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="simple_rpc", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__FB303Service(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="FB303Service", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="simple_rpc", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="int_parameter", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_test_fixtures_basic_module_types.ReservedKeyword, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__MyService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="ping", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getRandomData", - arguments=( - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sink", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="sink", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="putDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="data", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="hasDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="deleteDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="lobDataById", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="id", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="data", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="invalid_return_for_hack", - arguments=( - ), - result=_test_fixtures_basic_module_types.Set__float, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="rpc_skipped_codegen", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__DbMixedStackArguments(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="DbMixedStackArguments", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getDataByKey0", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="key", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bytes, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getDataByKey1", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="key", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bytes, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/clients.pyx index 20ca758ab46..4b751e1a63e 100644 --- a/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/clients.pyx @@ -53,8 +53,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cRaiserAsyncClient, cRaiserClientWrapper @@ -271,14 +270,10 @@ cdef class Raiser(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__Raiser(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cRaiserSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cRaiserSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services.pyx index e590fff6c19..a10c253a1c5 100644 --- a/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services.pyx @@ -57,8 +57,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -154,14 +153,10 @@ cdef class RaiserInterface( self): raise NotImplementedError("async def get500 is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__Raiser(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cRaiserSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cRaiserSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index ea6c196688c..00000000000 --- a/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,90 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/exceptions/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__Raiser(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="Raiser", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="doBland", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="doRaise", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.Banal, - _module_types.Fiery, - _module_types.Serious, - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get200", - arguments=( - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get500", - arguments=( - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.Fiery, - _module_types.Banal, - _module_types.Serious, - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/services_reflection.pxd b/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/services_reflection.pxd rename to thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/services_reflection.py b/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/services_reflection.py deleted file mode 100644 index 71caf168f84..00000000000 --- a/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/services_reflection.py +++ /dev/null @@ -1,91 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/includes/src/service.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - -import includes.types as _includes_types -import module.types as _module_types -import transitive.types as _transitive_types - -import service.types as _service_types - - -def get_reflection__MyService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="query", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="s", - type=_module_types.MyStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="i", - type=_includes_types.Included, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="has_arg_docs", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="s", - type=_module_types.MyStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="i", - type=_includes_types.Included, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/clients.pyx b/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/clients.pyx index 631d4ad0117..15aa313bd57 100644 --- a/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/clients.pyx +++ b/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/clients.pyx @@ -62,8 +62,7 @@ cimport transitive.types as _transitive_types cimport transitive.cbindings as _transitive_cbindings import transitive.types as _transitive_types -import service.services_reflection as _services_reflection -cimport service.services_reflection as _services_reflection +cimport service.services_interface as _fbthrift_services_interface from service.clients_wrapper cimport cMyServiceAsyncClient, cMyServiceClientWrapper @@ -170,14 +169,10 @@ cdef class MyService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services.pyx b/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services.pyx index 893fb84542b..44a5b32a20e 100644 --- a/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services.pyx +++ b/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services.pyx @@ -66,8 +66,7 @@ import transitive.types as _transitive_types cimport transitive.types as _transitive_types cimport transitive.cbindings as _transitive_cbindings -import service.services_reflection as _services_reflection -cimport service.services_reflection as _services_reflection +cimport service.services_interface as _fbthrift_services_interface import asyncio import functools @@ -133,14 +132,10 @@ cdef class MyServiceInterface( i): raise NotImplementedError("async def has_arg_docs is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services_reflection.pxd b/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services_reflection.pxd rename to thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services_reflection.py b/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services_reflection.py deleted file mode 100644 index 71caf168f84..00000000000 --- a/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/services_reflection.py +++ /dev/null @@ -1,91 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/includes/src/service.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - -import includes.types as _includes_types -import module.types as _module_types -import transitive.types as _transitive_types - -import service.types as _service_types - - -def get_reflection__MyService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="query", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="s", - type=_module_types.MyStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="i", - type=_includes_types.Included, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="has_arg_docs", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="s", - type=_module_types.MyStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="i", - type=_includes_types.Included, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/clients.pyx index f5b0f5992ae..d92ab6017e7 100644 --- a/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/clients.pyx @@ -53,8 +53,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cMyRootAsyncClient, cMyRootClientWrapper from module.clients_wrapper cimport cMyNodeAsyncClient, cMyNodeClientWrapper @@ -143,14 +142,10 @@ cdef class MyRoot(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyRoot(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyRootSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyRootSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -199,14 +194,10 @@ cdef class MyNode(MyRoot): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyNode(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyNodeSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyNodeSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -255,14 +246,10 @@ cdef class MyLeaf(MyNode): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyLeaf(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyLeafSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyLeafSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services.pyx index 986befcc9d8..66d253faee9 100644 --- a/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services.pyx @@ -57,8 +57,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -113,14 +112,10 @@ cdef class MyRootInterface( self): raise NotImplementedError("async def do_root is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyRoot(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyRootSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyRootSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -152,14 +147,10 @@ MyRootInterface self): raise NotImplementedError("async def do_mid is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyNode(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyNodeSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyNodeSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -191,14 +182,10 @@ MyNodeInterface self): raise NotImplementedError("async def do_leaf is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyLeaf(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyLeafSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyLeafSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index a73a44b6c8e..00000000000 --- a/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,90 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/inheritance/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__MyRoot(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyRoot", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="do_root", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__MyNode(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyNode", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="do_mid", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__MyLeaf(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyLeaf", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="do_leaf", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/clients.pyx b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/clients.pyx index dc78f7bb9a1..97aeea70f2f 100644 --- a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/clients.pyx +++ b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/clients.pyx @@ -53,8 +53,7 @@ cimport test.fixtures.another_interactions.shared.types as _test_fixtures_anothe cimport test.fixtures.another_interactions.shared.cbindings as _test_fixtures_another_interactions_shared_cbindings import test.fixtures.another_interactions.shared.types as _test_fixtures_another_interactions_shared_types -import test.fixtures.another_interactions.shared.services_reflection as _services_reflection -cimport test.fixtures.another_interactions.shared.services_reflection as _services_reflection +cimport test.fixtures.another_interactions.shared.services_interface as _fbthrift_services_interface from test.fixtures.another_interactions.shared.clients_wrapper cimport cInteractLocallyAsyncClient, cInteractLocallyClientWrapper from test.fixtures.another_interactions.shared.clients_wrapper cimport cInteractLocallyClientWrapper_SharedInteractionInteractionWrapper @@ -134,14 +133,10 @@ cdef class InteractLocally(thrift.py3.client.Client): ): return self.createSharedInteraction() - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__InteractLocally(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cInteractLocallySvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cInteractLocallySvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services.pyx b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services.pyx index e036e4b938b..157570f6f7d 100644 --- a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services.pyx +++ b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services.pyx @@ -57,8 +57,7 @@ cimport test.fixtures.another_interactions.shared.types as _test_fixtures_anothe cimport test.fixtures.another_interactions.shared.cbindings as _test_fixtures_another_interactions_shared_cbindings import test.fixtures.another_interactions.shared.types as _test_fixtures_another_interactions_shared_types -import test.fixtures.another_interactions.shared.services_reflection as _services_reflection -cimport test.fixtures.another_interactions.shared.services_reflection as _services_reflection +cimport test.fixtures.another_interactions.shared.services_interface as _fbthrift_services_interface import asyncio import functools @@ -134,14 +133,10 @@ cdef class InteractLocallyInterface( get_executor() ) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__InteractLocally(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cInteractLocallySvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cInteractLocallySvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services_reflection.pxd b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services_reflection.pxd rename to thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services_reflection.py b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services_reflection.py deleted file mode 100644 index f416a2eb5b1..00000000000 --- a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/services_reflection.py +++ /dev/null @@ -1,28 +0,0 @@ -# -# Autogenerated by Thrift for shared.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import test.fixtures.another_interactions.shared.types as _test_fixtures_another_interactions_shared_types - - -def get_reflection__InteractLocally(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="InteractLocally", - methods=None, - annotations={ - }, - ) - return spec diff --git a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/clients.pyx b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/clients.pyx index f0e2148de9e..5b98f9b1164 100644 --- a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/clients.pyx +++ b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/clients.pyx @@ -59,8 +59,7 @@ import test.fixtures.another_interactions.shared.types as _test_fixtures_another cimport test.fixtures.another_interactions.shared.clients as _test_fixtures_another_interactions_shared_clients import test.fixtures.another_interactions.shared.clients as _test_fixtures_another_interactions_shared_clients -import test.fixtures.interactions.module.services_reflection as _services_reflection -cimport test.fixtures.interactions.module.services_reflection as _services_reflection +cimport test.fixtures.interactions.module.services_interface as _fbthrift_services_interface from test.fixtures.interactions.module.clients_wrapper cimport cMyServiceAsyncClient, cMyServiceClientWrapper from test.fixtures.interactions.module.clients_wrapper cimport cMyServiceClientWrapper_MyInteractionInteractionWrapper @@ -787,14 +786,10 @@ cdef class MyService(thrift.py3.client.Client): ): return self.createSerialInteraction() - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -1073,14 +1068,10 @@ cdef class Factories(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__Factories(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cFactoriesSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cFactoriesSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -1180,14 +1171,10 @@ cdef class Perform(thrift.py3.client.Client): ): return self.createSerialInteraction() - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__Perform(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cPerformSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cPerformSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -1419,14 +1406,10 @@ cdef class InteractWithShared(thrift.py3.client.Client): ): return self.createMyInteraction() - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__InteractWithShared(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cInteractWithSharedSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cInteractWithSharedSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -1603,14 +1586,10 @@ cdef class BoxService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__BoxService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cBoxServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cBoxServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services.pyx b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services.pyx index 2ab9bb761f1..8d46df8fc26 100644 --- a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services.pyx +++ b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services.pyx @@ -64,8 +64,7 @@ import test.fixtures.another_interactions.shared.types as _test_fixtures_another cimport test.fixtures.another_interactions.shared.types as _test_fixtures_another_interactions_shared_types cimport test.fixtures.another_interactions.shared.cbindings as _test_fixtures_another_interactions_shared_cbindings -import test.fixtures.interactions.module.services_reflection as _services_reflection -cimport test.fixtures.interactions.module.services_reflection as _services_reflection +cimport test.fixtures.interactions.module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -376,14 +375,10 @@ cdef class MyServiceInterface( return (ServerStream_cint32_t._fbthrift_create(cmove(deref(streams).first)), ServerPublisher_cint32_t._fbthrift_create(cmove(deref(streams).second))) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__MyService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cMyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cMyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -449,14 +444,10 @@ cdef class FactoriesInterface( return (ServerStream_cint32_t._fbthrift_create(cmove(deref(streams).first)), ServerPublisher_cint32_t._fbthrift_create(cmove(deref(streams).second))) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__Factories(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cFactoriesSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cFactoriesSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -488,14 +479,10 @@ cdef class PerformInterface( self): raise NotImplementedError("async def foo is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__Perform(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cPerformSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cPerformSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -527,14 +514,10 @@ cdef class InteractWithSharedInterface( self): raise NotImplementedError("async def do_some_similar_things is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__InteractWithShared(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cInteractWithSharedSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cInteractWithSharedSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -567,14 +550,10 @@ cdef class BoxServiceInterface( req): raise NotImplementedError("async def getABoxSession is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__BoxService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cBoxServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cBoxServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services_reflection.pxd b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services_reflection.py b/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services_reflection.py deleted file mode 100644 index 8cd84819e4c..00000000000 --- a/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/services_reflection.py +++ /dev/null @@ -1,247 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/interactions/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - -import test.fixtures.another_interactions.shared.types as _test_fixtures_another_interactions_shared_types - -import test.fixtures.interactions.module.types as _test_fixtures_interactions_module_types - - -def get_reflection__MyService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="MyService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="foo", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="interact", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="arg", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="interactFast", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="serialize", - arguments=( - ), - result=_test_fixtures_interactions_module_types.ResponseAndClientBufferedStream__i32_i32 if for_clients else _test_fixtures_interactions_module_types.ResponseAndServerStream__i32_i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__Factories(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="Factories", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="foo", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="interact", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="arg", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="interactFast", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="serialize", - arguments=( - ), - result=_test_fixtures_interactions_module_types.ResponseAndClientBufferedStream__i32_i32 if for_clients else _test_fixtures_interactions_module_types.ResponseAndServerStream__i32_i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__Perform(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="Perform", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="foo", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__InteractWithShared(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="InteractWithShared", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="do_some_similar_things", - arguments=( - ), - result=_test_fixtures_another_interactions_shared_types.DoSomethingResult, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__BoxService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="BoxService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="getABoxSession", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="req", - type=_test_fixtures_interactions_module_types.ShouldBeBoxed, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_test_fixtures_interactions_module_types.ShouldBeBoxed, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/clients.pyx index fe90d851665..d0aa57b3b9e 100644 --- a/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/clients.pyx @@ -56,8 +56,7 @@ cimport includes.types as _includes_types cimport includes.cbindings as _includes_cbindings import includes.types as _includes_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cEmptyServiceAsyncClient, cEmptyServiceClientWrapper from module.clients_wrapper cimport cReturnServiceAsyncClient, cReturnServiceClientWrapper @@ -732,14 +731,10 @@ cdef class EmptyService(thrift.py3.client.Client): ) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__EmptyService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cEmptyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cEmptyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -1300,14 +1295,10 @@ cdef class ReturnService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__ReturnService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cReturnServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cReturnServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -2224,14 +2215,10 @@ cdef class ParamService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__ParamService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cParamServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cParamServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services.pyx index 197af5b4b19..8aecfd7a4c1 100644 --- a/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services.pyx @@ -60,8 +60,7 @@ import includes.types as _includes_types cimport includes.types as _includes_types cimport includes.cbindings as _includes_cbindings -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -459,14 +458,10 @@ cdef class EmptyServiceInterface( get_executor() ) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__EmptyService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cEmptyServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cEmptyServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -680,14 +675,10 @@ cdef class ReturnServiceInterface( size): raise NotImplementedError("async def readData is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__ReturnService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cReturnServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cReturnServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -1012,14 +1003,10 @@ cdef class ParamServiceInterface( param1): raise NotImplementedError("async def listunion_string_param is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__ParamService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cParamServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cParamServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index be19e983757..00000000000 --- a/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,1093 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/mcpp2-compare/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - -import includes.types as _includes_types - -import module.types as _module_types - - -def get_reflection__EmptyService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="EmptyService", - methods=None, - annotations={ - }, - ) - return spec - - -def get_reflection__ReturnService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="ReturnService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="noReturn", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="boolReturn", - arguments=( - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="i16Return", - arguments=( - ), - result=int, - result_kind=__NumberType.I16, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="i32Return", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="i64Return", - arguments=( - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="floatReturn", - arguments=( - ), - result=float, - result_kind=__NumberType.FLOAT, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="doubleReturn", - arguments=( - ), - result=float, - result_kind=__NumberType.DOUBLE, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="stringReturn", - arguments=( - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="binaryReturn", - arguments=( - ), - result=bytes, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="mapReturn", - arguments=( - ), - result=_module_types.Map__string_i64, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="simpleTypedefReturn", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="complexTypedefReturn", - arguments=( - ), - result=_module_types.List__Map__Empty_MyStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="list_mostComplexTypedefReturn", - arguments=( - ), - result=_module_types.List__List__List__Map__Empty_MyStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="enumReturn", - arguments=( - ), - result=_module_types.MyEnumA, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="list_EnumReturn", - arguments=( - ), - result=_module_types.List__MyEnumA, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="structReturn", - arguments=( - ), - result=_module_types.MyStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="set_StructReturn", - arguments=( - ), - result=_module_types.Set__MyStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="unionReturn", - arguments=( - ), - result=_module_types.ComplexUnion, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="list_UnionReturn", - arguments=( - ), - result=_module_types.List__ComplexUnion, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="readDataEb", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="size", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=_fbthrift_iobuf.IOBuf, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="readData", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="size", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=_fbthrift_iobuf.IOBuf, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__ParamService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="ParamService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="void_ret_i16_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="void_ret_byte_i16_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=int, - kind=__NumberType.BYTE, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param2", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="void_ret_map_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.Map__string_i64, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="void_ret_map_setlist_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.Map__string_i64, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param2", - type=_module_types.Set__List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="void_ret_map_typedef_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="void_ret_enum_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.MyEnumA, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="void_ret_struct_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.MyStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="void_ret_listunion_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.List__ComplexUnion, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="bool_ret_i32_i64_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param2", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="bool_ret_map_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.Map__string_i64, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="bool_ret_union_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.ComplexUnion, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="i64_ret_float_double_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=float, - kind=__NumberType.FLOAT, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param2", - type=float, - kind=__NumberType.DOUBLE, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="i64_ret_string_typedef_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param2", - type=_module_types.Set__List__List__Map__Empty_MyStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="i64_ret_i32_i32_i32_i32_i32_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param2", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param3", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param4", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param5", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="double_ret_setstruct_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.Set__MyStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=float, - result_kind=__NumberType.DOUBLE, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="string_ret_string_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="binary_ret_binary_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=bytes, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bytes, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="map_ret_bool_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=bool, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Map__string_i64, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="list_ret_map_setlist_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.Map__i32_List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param2", - type=_module_types.List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.List__bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="mapsetlistmapliststring_ret_listlistlist_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.List__List__List__List__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Map__Set__List__i32_Map__List__Set__string_string, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="typedef_ret_i32_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="listtypedef_ret_typedef_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.List__Map__Empty_MyStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.List__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="enum_ret_double_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=float, - kind=__NumberType.DOUBLE, - annotations={ - }, - ), - ), - result=_module_types.MyEnumA, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="enum_ret_double_enum_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=float, - kind=__NumberType.DOUBLE, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param2", - type=_module_types.MyEnumA, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.MyEnumA, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="listenum_ret_map_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.Map__string_i64, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.List__MyEnumA, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="struct_ret_i16_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - ), - result=_module_types.MyStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="setstruct_ret_set_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=_module_types.Set__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Set__MyStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="union_ret_i32_i32_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param2", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ComplexUnion, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="listunion_string_param", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="param1", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.List__ComplexUnion, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/clients.pyx b/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/clients.pyx index 9518a21acd8..32e12931ae2 100644 --- a/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/clients.pyx +++ b/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/clients.pyx @@ -53,8 +53,7 @@ cimport my.namespacing.test.module.module.types as _my_namespacing_test_module_m cimport my.namespacing.test.module.module.cbindings as _my_namespacing_test_module_module_cbindings import my.namespacing.test.module.module.types as _my_namespacing_test_module_module_types -import my.namespacing.test.module.module.services_reflection as _services_reflection -cimport my.namespacing.test.module.module.services_reflection as _services_reflection +cimport my.namespacing.test.module.module.services_interface as _fbthrift_services_interface from my.namespacing.test.module.module.clients_wrapper cimport cTestServiceAsyncClient, cTestServiceClientWrapper @@ -121,14 +120,10 @@ cdef class TestService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services.pyx b/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services.pyx index 47c92dd1d1f..3679833b1ca 100644 --- a/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services.pyx +++ b/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services.pyx @@ -57,8 +57,7 @@ cimport my.namespacing.test.module.module.types as _my_namespacing_test_module_m cimport my.namespacing.test.module.module.cbindings as _my_namespacing_test_module_module_cbindings import my.namespacing.test.module.module.types as _my_namespacing_test_module_module_types -import my.namespacing.test.module.module.services_reflection as _services_reflection -cimport my.namespacing.test.module.module.services_reflection as _services_reflection +cimport my.namespacing.test.module.module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -128,14 +127,10 @@ cdef class TestServiceInterface( int1): raise NotImplementedError("async def init is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services_reflection.pxd b/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services_reflection.py b/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services_reflection.py deleted file mode 100644 index e11f73b880d..00000000000 --- a/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/services_reflection.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/namespace/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import my.namespacing.test.module.module.types as _my_namespacing_test_module_module_types - - -def get_reflection__TestService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="TestService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="init", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="int1", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/clients.pyx b/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/clients.pyx index e773f4b3a4c..0b0a6741665 100644 --- a/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/clients.pyx +++ b/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/clients.pyx @@ -53,8 +53,7 @@ cimport emptyns.types as _emptyns_types cimport emptyns.cbindings as _emptyns_cbindings import emptyns.types as _emptyns_types -import emptyns.services_reflection as _services_reflection -cimport emptyns.services_reflection as _services_reflection +cimport emptyns.services_interface as _fbthrift_services_interface from emptyns.clients_wrapper cimport cTestServiceAsyncClient, cTestServiceClientWrapper @@ -121,14 +120,10 @@ cdef class TestService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services.pyx b/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services.pyx index 01d3f5812f9..8895576cbce 100644 --- a/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services.pyx +++ b/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services.pyx @@ -57,8 +57,7 @@ cimport emptyns.types as _emptyns_types cimport emptyns.cbindings as _emptyns_cbindings import emptyns.types as _emptyns_types -import emptyns.services_reflection as _services_reflection -cimport emptyns.services_reflection as _services_reflection +cimport emptyns.services_interface as _fbthrift_services_interface import asyncio import functools @@ -128,14 +127,10 @@ cdef class TestServiceInterface( int1): raise NotImplementedError("async def init is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services_reflection.pxd b/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services_reflection.pxd rename to thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services_reflection.py b/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services_reflection.py deleted file mode 100644 index 8f3277dbdb2..00000000000 --- a/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/services_reflection.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/namespace/src/emptyns.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import emptyns.types as _emptyns_types - - -def get_reflection__TestService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="TestService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="init", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="int1", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/clients.pyx b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/clients.pyx index 8dec5d6ec7a..fe8136d46a3 100644 --- a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/clients.pyx +++ b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/clients.pyx @@ -58,8 +58,7 @@ import my.namespacing.test.hsmodule.types as _my_namespacing_test_hsmodule_types cimport my.namespacing.test.hsmodule.clients as _my_namespacing_test_hsmodule_clients import my.namespacing.test.hsmodule.clients as _my_namespacing_test_hsmodule_clients -import my.namespacing.extend.test.extend.services_reflection as _services_reflection -cimport my.namespacing.extend.test.extend.services_reflection as _services_reflection +cimport my.namespacing.extend.test.extend.services_interface as _fbthrift_services_interface from my.namespacing.extend.test.extend.clients_wrapper cimport cExtendTestServiceAsyncClient, cExtendTestServiceClientWrapper from my.namespacing.test.hsmodule.clients_wrapper cimport cHsTestServiceClientWrapper @@ -123,14 +122,10 @@ cdef class ExtendTestService(_my_namespacing_test_hsmodule_clients.HsTestService return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__ExtendTestService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cExtendTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cExtendTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services.pyx b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services.pyx index 2c0ec81d6cb..bd154eedede 100644 --- a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services.pyx +++ b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services.pyx @@ -62,8 +62,7 @@ import my.namespacing.test.hsmodule.types as _my_namespacing_test_hsmodule_types cimport my.namespacing.test.hsmodule.types as _my_namespacing_test_hsmodule_types cimport my.namespacing.test.hsmodule.cbindings as _my_namespacing_test_hsmodule_cbindings -import my.namespacing.extend.test.extend.services_reflection as _services_reflection -cimport my.namespacing.extend.test.extend.services_reflection as _services_reflection +cimport my.namespacing.extend.test.extend.services_interface as _fbthrift_services_interface import asyncio import functools @@ -133,14 +132,10 @@ cdef class ExtendTestServiceInterface( struct1): raise NotImplementedError("async def check is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__ExtendTestService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cExtendTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cExtendTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services_reflection.pxd b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services_reflection.pxd rename to thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services_reflection.py b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services_reflection.py deleted file mode 100644 index 60d2846ee41..00000000000 --- a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/services_reflection.py +++ /dev/null @@ -1,51 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/namespace/src/extend.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - -import my.namespacing.test.hsmodule.types as _my_namespacing_test_hsmodule_types - -import my.namespacing.extend.test.extend.types as _my_namespacing_extend_test_extend_types - - -def get_reflection__ExtendTestService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="ExtendTestService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="check", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="struct1", - type=_my_namespacing_test_hsmodule_types.HsFoo, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/clients.pyx b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/clients.pyx index e6c0676d891..62b6b17b83b 100644 --- a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/clients.pyx +++ b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/clients.pyx @@ -53,8 +53,7 @@ cimport my.namespacing.test.hsmodule.types as _my_namespacing_test_hsmodule_type cimport my.namespacing.test.hsmodule.cbindings as _my_namespacing_test_hsmodule_cbindings import my.namespacing.test.hsmodule.types as _my_namespacing_test_hsmodule_types -import my.namespacing.test.hsmodule.services_reflection as _services_reflection -cimport my.namespacing.test.hsmodule.services_reflection as _services_reflection +cimport my.namespacing.test.hsmodule.services_interface as _fbthrift_services_interface from my.namespacing.test.hsmodule.clients_wrapper cimport cHsTestServiceAsyncClient, cHsTestServiceClientWrapper @@ -121,14 +120,10 @@ cdef class HsTestService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__HsTestService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cHsTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cHsTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services.pyx b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services.pyx index 183e5015031..f6e27a96f5a 100644 --- a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services.pyx +++ b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services.pyx @@ -57,8 +57,7 @@ cimport my.namespacing.test.hsmodule.types as _my_namespacing_test_hsmodule_type cimport my.namespacing.test.hsmodule.cbindings as _my_namespacing_test_hsmodule_cbindings import my.namespacing.test.hsmodule.types as _my_namespacing_test_hsmodule_types -import my.namespacing.test.hsmodule.services_reflection as _services_reflection -cimport my.namespacing.test.hsmodule.services_reflection as _services_reflection +cimport my.namespacing.test.hsmodule.services_interface as _fbthrift_services_interface import asyncio import functools @@ -128,14 +127,10 @@ cdef class HsTestServiceInterface( int1): raise NotImplementedError("async def init is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__HsTestService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cHsTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cHsTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services_reflection.pxd b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services_reflection.pxd rename to thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services_reflection.py b/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services_reflection.py deleted file mode 100644 index 15110f37179..00000000000 --- a/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/services_reflection.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Autogenerated by Thrift for hsmodule.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import my.namespacing.test.hsmodule.types as _my_namespacing_test_hsmodule_types - - -def get_reflection__HsTestService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="HsTestService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="init", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="int1", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/clients.pyx b/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/clients.pyx index 84313612778..8a8ad88248e 100644 --- a/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/clients.pyx +++ b/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/clients.pyx @@ -53,8 +53,7 @@ cimport test.namespace_from_package.module.types as _test_namespace_from_package cimport test.namespace_from_package.module.cbindings as _test_namespace_from_package_module_cbindings import test.namespace_from_package.module.types as _test_namespace_from_package_module_types -import test.namespace_from_package.module.services_reflection as _services_reflection -cimport test.namespace_from_package.module.services_reflection as _services_reflection +cimport test.namespace_from_package.module.services_interface as _fbthrift_services_interface from test.namespace_from_package.module.clients_wrapper cimport cTestServiceAsyncClient, cTestServiceClientWrapper @@ -121,14 +120,10 @@ cdef class TestService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services.pyx b/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services.pyx index feafabf8f8e..57c36a5add0 100644 --- a/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services.pyx +++ b/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services.pyx @@ -57,8 +57,7 @@ cimport test.namespace_from_package.module.types as _test_namespace_from_package cimport test.namespace_from_package.module.cbindings as _test_namespace_from_package_module_cbindings import test.namespace_from_package.module.types as _test_namespace_from_package_module_types -import test.namespace_from_package.module.services_reflection as _services_reflection -cimport test.namespace_from_package.module.services_reflection as _services_reflection +cimport test.namespace_from_package.module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -128,14 +127,10 @@ cdef class TestServiceInterface( int1): raise NotImplementedError("async def init is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services_reflection.pxd b/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services_reflection.py b/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services_reflection.py deleted file mode 100644 index b631b2d8559..00000000000 --- a/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/services_reflection.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/namespace_from_package/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import test.namespace_from_package.module.types as _test_namespace_from_package_module_types - - -def get_reflection__TestService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="TestService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="init", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="int1", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/clients.pyx b/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/clients.pyx index 8d343570d70..f54bbda60eb 100644 --- a/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/clients.pyx +++ b/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/clients.pyx @@ -53,8 +53,7 @@ cimport test.namespace_from_package_without_module_name.module.types as _test_na cimport test.namespace_from_package_without_module_name.module.cbindings as _test_namespace_from_package_without_module_name_module_cbindings import test.namespace_from_package_without_module_name.module.types as _test_namespace_from_package_without_module_name_module_types -import test.namespace_from_package_without_module_name.module.services_reflection as _services_reflection -cimport test.namespace_from_package_without_module_name.module.services_reflection as _services_reflection +cimport test.namespace_from_package_without_module_name.module.services_interface as _fbthrift_services_interface from test.namespace_from_package_without_module_name.module.clients_wrapper cimport cTestServiceAsyncClient, cTestServiceClientWrapper @@ -121,14 +120,10 @@ cdef class TestService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services.pyx b/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services.pyx index adab4a79b9c..2fcf34065ce 100644 --- a/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services.pyx +++ b/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services.pyx @@ -57,8 +57,7 @@ cimport test.namespace_from_package_without_module_name.module.types as _test_na cimport test.namespace_from_package_without_module_name.module.cbindings as _test_namespace_from_package_without_module_name_module_cbindings import test.namespace_from_package_without_module_name.module.types as _test_namespace_from_package_without_module_name_module_types -import test.namespace_from_package_without_module_name.module.services_reflection as _services_reflection -cimport test.namespace_from_package_without_module_name.module.services_reflection as _services_reflection +cimport test.namespace_from_package_without_module_name.module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -128,14 +127,10 @@ cdef class TestServiceInterface( int1): raise NotImplementedError("async def init is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services_reflection.pxd b/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services_reflection.py b/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services_reflection.py deleted file mode 100644 index e130a4147ef..00000000000 --- a/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/services_reflection.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/namespace_from_package_without_module_name/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import test.namespace_from_package_without_module_name.module.types as _test_namespace_from_package_without_module_name_module_types - - -def get_reflection__TestService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="TestService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="init", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="int1", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/clients.pyx index f185a13f406..f0daf0c053c 100644 --- a/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/clients.pyx @@ -53,8 +53,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cNestedContainersAsyncClient, cNestedContainersClientWrapper @@ -287,14 +286,10 @@ cdef class NestedContainers(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__NestedContainers(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cNestedContainersSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cNestedContainersSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services.pyx index 83135bf3d9c..a6439de174b 100644 --- a/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services.pyx @@ -57,8 +57,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -152,14 +151,10 @@ cdef class NestedContainersInterface( foo): raise NotImplementedError("async def turtles is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__NestedContainers(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cNestedContainersSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cNestedContainersSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index e7e7bf84e9e..00000000000 --- a/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,138 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/params/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__NestedContainers(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="NestedContainers", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="mapList", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=_module_types.Map__i32_List__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="mapSet", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=_module_types.Map__i32_Set__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="listMap", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=_module_types.List__Map__i32_i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="listSet", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=_module_types.List__Set__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="turtles", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=_module_types.List__List__Map__i32_Map__i32_Set__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/clients.pyx index 1e3870a6d48..b2ef0a5da91 100644 --- a/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/clients.pyx @@ -53,8 +53,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cSimpleServiceAsyncClient, cSimpleServiceClientWrapper from module.clients_wrapper cimport cDerivedServiceAsyncClient, cDerivedServiceClientWrapper @@ -1818,14 +1817,10 @@ cdef class SimpleService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__SimpleService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cSimpleServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cSimpleServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -1875,14 +1870,10 @@ cdef class DerivedService(SimpleService): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__DerivedService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cDerivedServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cDerivedServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -1931,14 +1922,10 @@ cdef class RederivedService(DerivedService): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__RederivedService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cRederivedServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cRederivedServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services.pyx index 05ad5065330..31893c89478 100644 --- a/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services.pyx @@ -57,8 +57,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -833,14 +832,10 @@ cdef class SimpleServiceInterface( u): raise NotImplementedError("async def get_binary_union_struct is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__SimpleService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cSimpleServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cSimpleServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -873,14 +868,10 @@ SimpleServiceInterface self): raise NotImplementedError("async def get_six is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__DerivedService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cDerivedServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cDerivedServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -912,14 +903,10 @@ DerivedServiceInterface self): raise NotImplementedError("async def get_seven is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__RederivedService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cRederivedServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cRederivedServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index c9c842f8ad9..00000000000 --- a/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,971 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__SimpleService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="SimpleService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_five", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="add_five", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="num", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="do_nothing", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="concat", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="first", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="second", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_value", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="simple_struct", - type=_module_types.SimpleStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="negate", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=bool, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="tiny", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=int, - kind=__NumberType.BYTE, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.BYTE, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="small", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I16, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="big", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="two", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=float, - kind=__NumberType.DOUBLE, - annotations={ - }, - ), - ), - result=float, - result_kind=__NumberType.DOUBLE, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="expected_exception", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.SimpleException, - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="unexpected_exception", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_i16_list", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="numbers", - type=_module_types.List__i16, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_i32_list", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="numbers", - type=_module_types.List__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_i64_list", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="numbers", - type=_module_types.List__i64, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="concat_many", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="count_structs", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="items", - type=_module_types.List__SimpleStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_set", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="numbers", - type=_module_types.Set__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="contains_word", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.Set__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="word", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_map_value", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.Map__string_string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="key", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="map_length", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="items", - type=_module_types.Map__string_SimpleStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I16, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_map_values", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="items", - type=_module_types.Map__string_i16, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I16, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="complex_sum_i32", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="counter", - type=_module_types.ComplexStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="repeat_name", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="counter", - type=_module_types.ComplexStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_struct", - arguments=( - ), - result=_module_types.SimpleStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="fib", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="n", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - ), - result=_module_types.List__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="unique_words", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Set__string, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="words_count", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Map__string_i16, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="set_enum", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="in_enum", - type=_module_types.AnEnum, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.AnEnum, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="list_of_lists", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="num_lists", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="num_items", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - ), - result=_module_types.List__List__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="word_character_frequency", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="sentence", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Map__string_Map__string_i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="list_of_sets", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="some_words", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.List__Set__string, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="nested_map_argument", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="struct_map", - type=_module_types.Map__string_List__SimpleStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="make_sentence", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="word_chars", - type=_module_types.List__List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_union", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="sets", - type=_module_types.List__Set__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Set__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_keys", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="string_map", - type=_module_types.List__Map__string_string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Set__string, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="lookup_double", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="key", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=float, - result_kind=__NumberType.DOUBLE, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="retrieve_binary", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="something", - type=bytes, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bytes, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="contain_binary", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="binaries", - type=_module_types.List__binary, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Set__binary, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="contain_enum", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="the_enum", - type=_module_types.List__AnEnum, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.List__AnEnum, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_binary_union_struct", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="u", - type=_module_types.BinaryUnion, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.BinaryUnionStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__DerivedService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="DerivedService", - methods=None, - annotations={ - """bar""": """1""", """foo""": """\"\"\"""", }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_six", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__RederivedService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="RederivedService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_seven", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/services_reflection.py deleted file mode 100644 index c9c842f8ad9..00000000000 --- a/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,971 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__SimpleService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="SimpleService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_five", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="add_five", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="num", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="do_nothing", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="concat", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="first", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="second", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_value", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="simple_struct", - type=_module_types.SimpleStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="negate", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=bool, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="tiny", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=int, - kind=__NumberType.BYTE, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.BYTE, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="small", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I16, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="big", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=int, - kind=__NumberType.I64, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I64, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="two", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="input", - type=float, - kind=__NumberType.DOUBLE, - annotations={ - }, - ), - ), - result=float, - result_kind=__NumberType.DOUBLE, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="expected_exception", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.SimpleException, - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="unexpected_exception", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_i16_list", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="numbers", - type=_module_types.List__i16, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_i32_list", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="numbers", - type=_module_types.List__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_i64_list", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="numbers", - type=_module_types.List__i64, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="concat_many", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="count_structs", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="items", - type=_module_types.List__SimpleStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_set", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="numbers", - type=_module_types.Set__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="contains_word", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.Set__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="word", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bool, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_map_value", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.Map__string_string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="key", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="map_length", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="items", - type=_module_types.Map__string_SimpleStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I16, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="sum_map_values", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="items", - type=_module_types.Map__string_i16, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I16, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="complex_sum_i32", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="counter", - type=_module_types.ComplexStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="repeat_name", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="counter", - type=_module_types.ComplexStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_struct", - arguments=( - ), - result=_module_types.SimpleStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="fib", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="n", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - ), - result=_module_types.List__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="unique_words", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Set__string, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="words_count", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="words", - type=_module_types.List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Map__string_i16, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="set_enum", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="in_enum", - type=_module_types.AnEnum, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.AnEnum, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="list_of_lists", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="num_lists", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="num_items", - type=int, - kind=__NumberType.I16, - annotations={ - }, - ), - ), - result=_module_types.List__List__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="word_character_frequency", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="sentence", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Map__string_Map__string_i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="list_of_sets", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="some_words", - type=str, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.List__Set__string, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="nested_map_argument", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="struct_map", - type=_module_types.Map__string_List__SimpleStruct, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="make_sentence", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="word_chars", - type=_module_types.List__List__string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=str, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_union", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="sets", - type=_module_types.List__Set__i32, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Set__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_keys", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="string_map", - type=_module_types.List__Map__string_string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Set__string, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="lookup_double", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="key", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=float, - result_kind=__NumberType.DOUBLE, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="retrieve_binary", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="something", - type=bytes, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=bytes, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="contain_binary", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="binaries", - type=_module_types.List__binary, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.Set__binary, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="contain_enum", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="the_enum", - type=_module_types.List__AnEnum, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.List__AnEnum, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_binary_union_struct", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="u", - type=_module_types.BinaryUnion, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_module_types.BinaryUnionStruct, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__DerivedService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="DerivedService", - methods=None, - annotations={ - """bar""": """1""", """foo""": """\"\"\"""", }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_six", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__RederivedService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="RederivedService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="get_seven", - arguments=( - ), - result=int, - result_kind=__NumberType.I32, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/clients.pyx b/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/clients.pyx index 5e68c0264a5..98625bf9dc1 100644 --- a/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/clients.pyx +++ b/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/clients.pyx @@ -53,8 +53,7 @@ cimport empty.types as _empty_types cimport empty.cbindings as _empty_cbindings import empty.types as _empty_types -import empty.services_reflection as _services_reflection -cimport empty.services_reflection as _services_reflection +cimport empty.services_interface as _fbthrift_services_interface from empty.clients_wrapper cimport cNullServiceAsyncClient, cNullServiceClientWrapper @@ -77,14 +76,10 @@ cdef class NullService(thrift.py3.client.Client): ) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__NullService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cNullServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cNullServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services.pyx b/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services.pyx index a9de1c6c570..c6f58621261 100644 --- a/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services.pyx +++ b/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services.pyx @@ -57,8 +57,7 @@ cimport empty.types as _empty_types cimport empty.cbindings as _empty_cbindings import empty.types as _empty_types -import empty.services_reflection as _services_reflection -cimport empty.services_reflection as _services_reflection +cimport empty.services_interface as _fbthrift_services_interface import asyncio import functools @@ -102,14 +101,10 @@ cdef class NullServiceInterface( get_executor() ) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__NullService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cNullServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cNullServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services_reflection.pxd b/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services_reflection.pxd rename to thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services_reflection.py b/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services_reflection.py deleted file mode 100644 index 00cac574951..00000000000 --- a/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/services_reflection.py +++ /dev/null @@ -1,28 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/empty.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import empty.types as _empty_types - - -def get_reflection__NullService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="NullService", - methods=None, - annotations={ - }, - ) - return spec diff --git a/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/clients.pyx index 0755f3c00a5..4c750d0cc77 100644 --- a/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/clients.pyx @@ -54,8 +54,7 @@ cimport module.cbindings as _module_cbindings import module.types as _module_types from thrift.py3.stream cimport cResponseAndClientBufferedStream, cClientBufferedStream -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cAAsyncClient, cAClientWrapper from module.clients_wrapper cimport cAClientWrapper_IInteractionWrapper @@ -189,14 +188,10 @@ cdef class A(thrift.py3.client.Client): ): return self.createI() - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__A(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cASvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cASvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -295,14 +290,10 @@ cdef class B(A): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__B(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cBSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cBSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -343,14 +334,10 @@ cdef class C(thrift.py3.client.Client): ): return self.createI() - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__C(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cCSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cCSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services.pyx index 0190aa55940..a1ab1de5fcd 100644 --- a/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services.pyx @@ -59,8 +59,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -217,14 +216,10 @@ cdef class AInterface( self): raise NotImplementedError("async def foo is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__A(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cASvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cASvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -272,14 +267,10 @@ AInterface return (ServerStream_cint32_t._fbthrift_create(cmove(deref(streams).first)), ServerPublisher_cint32_t._fbthrift_create(cmove(deref(streams).second))) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__B(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cBSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cBSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod @@ -302,14 +293,10 @@ cdef class CInterface( get_executor() ) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__C(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cCSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cCSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index 2012c2e7eab..00000000000 --- a/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,98 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/single_file_service/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__A(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="A", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="foo", - arguments=( - ), - result=_module_types.Foo, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__B(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="B", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="bar", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=_module_types.Foo, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="stream_stuff", - arguments=( - ), - result=_module_types.ClientBufferedStream__i32 if for_clients else _module_types.ServerStream__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec - - -def get_reflection__C(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="C", - methods=None, - annotations={ - }, - ) - return spec diff --git a/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/clients.pyx b/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/clients.pyx index d5a868e13fb..08efc4cd637 100644 --- a/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/clients.pyx +++ b/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/clients.pyx @@ -53,8 +53,7 @@ cimport module_structs.types as _module_structs_types cimport module_structs.cbindings as _module_structs_cbindings import module_structs.types as _module_structs_types -import module_structs.services_reflection as _services_reflection -cimport module_structs.services_reflection as _services_reflection +cimport module_structs.services_interface as _fbthrift_services_interface diff --git a/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services.pyx b/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services.pyx index cffc91fd37b..6099284538a 100644 --- a/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services.pyx +++ b/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services.pyx @@ -57,8 +57,7 @@ cimport module_structs.types as _module_structs_types cimport module_structs.cbindings as _module_structs_cbindings import module_structs.types as _module_structs_types -import module_structs.services_reflection as _services_reflection -cimport module_structs.services_reflection as _services_reflection +cimport module_structs.services_interface as _fbthrift_services_interface import asyncio import functools diff --git a/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services_reflection.pxd b/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services_reflection.pxd rename to thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services_reflection.py b/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services_reflection.py deleted file mode 100644 index 42865b11e3a..00000000000 --- a/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/services_reflection.py +++ /dev/null @@ -1,18 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/single_file_service/src/module_structs.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module_structs.types as _module_structs_types diff --git a/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/clients.pyx index 48689e60d12..caaf8e06865 100644 --- a/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/clients.pyx @@ -53,8 +53,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cSinkServiceAsyncClient, cSinkServiceClientWrapper @@ -77,14 +76,10 @@ cdef class SinkService(thrift.py3.client.Client): ) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__SinkService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cSinkServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cSinkServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services.pyx index 9d6ad5195d1..e014a68259b 100644 --- a/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services.pyx @@ -57,8 +57,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -102,14 +101,10 @@ cdef class SinkServiceInterface( get_executor() ) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__SinkService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cSinkServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cSinkServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index 62deecc6072..00000000000 --- a/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,28 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/sink/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__SinkService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="SinkService", - methods=None, - annotations={ - }, - ) - return spec diff --git a/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/clients.pyx b/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/clients.pyx index e6c78ea5787..2ba46310160 100644 --- a/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/clients.pyx +++ b/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/clients.pyx @@ -54,8 +54,7 @@ cimport module.cbindings as _module_cbindings import module.types as _module_types from thrift.py3.stream cimport cResponseAndClientBufferedStream, cClientBufferedStream -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface from module.clients_wrapper cimport cPubSubStreamingServiceAsyncClient, cPubSubStreamingServiceClientWrapper @@ -528,14 +527,10 @@ cdef class PubSubStreamingService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__PubSubStreamingService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cPubSubStreamingServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cPubSubStreamingServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services.pyx b/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services.pyx index 9015a7dc4cc..359f9158a74 100644 --- a/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services.pyx +++ b/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services.pyx @@ -59,8 +59,7 @@ cimport module.types as _module_types cimport module.cbindings as _module_cbindings import module.types as _module_types -import module.services_reflection as _services_reflection -cimport module.services_reflection as _services_reflection +cimport module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -640,14 +639,10 @@ cdef class PubSubStreamingServiceInterface( return (ServerStream_cint32_t._fbthrift_create(cmove(deref(streams).first)), ServerPublisher_cint32_t._fbthrift_create(cmove(deref(streams).second))) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__PubSubStreamingService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cPubSubStreamingServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cPubSubStreamingServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services_reflection.pxd b/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services_reflection.py b/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services_reflection.py deleted file mode 100644 index 249495ad177..00000000000 --- a/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/services_reflection.py +++ /dev/null @@ -1,248 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/stream/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - - -import module.types as _module_types - - -def get_reflection__PubSubStreamingService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="PubSubStreamingService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="returnstream", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="i32_from", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="i32_to", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ClientBufferedStream__i32 if for_clients else _module_types.ServerStream__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="streamthrows", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ClientBufferedStream__i32 if for_clients else _module_types.ServerStream__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="servicethrows", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ClientBufferedStream__i32 if for_clients else _module_types.ServerStream__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.FooEx, - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="servicethrows2", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ClientBufferedStream__i32 if for_clients else _module_types.ServerStream__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.FooEx, - _module_types.FooEx2, - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="boththrows", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ClientBufferedStream__i32 if for_clients else _module_types.ServerStream__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.FooEx, - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="responseandstreamstreamthrows", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ResponseAndClientBufferedStream__i32_i32 if for_clients else _module_types.ResponseAndServerStream__i32_i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="responseandstreamservicethrows", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ResponseAndClientBufferedStream__i32_i32 if for_clients else _module_types.ResponseAndServerStream__i32_i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.FooEx, - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="responseandstreamboththrows", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="foo", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ResponseAndClientBufferedStream__i32_i32 if for_clients else _module_types.ResponseAndServerStream__i32_i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _module_types.FooEx, - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="returnstreamFast", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="i32_from", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - __ArgumentSpec.__new__( - __ArgumentSpec, - name="i32_to", - type=int, - kind=__NumberType.I32, - annotations={ - }, - ), - ), - result=_module_types.ClientBufferedStream__i32 if for_clients else _module_types.ServerStream__i32, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/clients.pyx b/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/clients.pyx index 6b64b2a5bd1..96f24813758 100644 --- a/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/clients.pyx +++ b/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/clients.pyx @@ -59,8 +59,7 @@ cimport c.types as _c_types cimport c.cbindings as _c_cbindings import c.types as _c_types -import s.services_reflection as _services_reflection -cimport s.services_reflection as _services_reflection +cimport s.services_interface as _fbthrift_services_interface from s.clients_wrapper cimport cTestServiceAsyncClient, cTestServiceClientWrapper @@ -128,14 +127,10 @@ cdef class TestService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services.pyx b/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services.pyx index 98f349b59c9..fd0ccedef64 100644 --- a/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services.pyx +++ b/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services.pyx @@ -63,8 +63,7 @@ import c.types as _c_types cimport c.types as _c_types cimport c.cbindings as _c_cbindings -import s.services_reflection as _services_reflection -cimport s.services_reflection as _services_reflection +cimport s.services_interface as _fbthrift_services_interface import asyncio import functools @@ -117,14 +116,10 @@ cdef class TestServiceInterface( self): raise NotImplementedError("async def test is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__TestService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cTestServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cTestServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services_reflection.pxd b/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services_reflection.pxd rename to thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services_reflection.py b/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services_reflection.py deleted file mode 100644 index bc4c299cf17..00000000000 --- a/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/services_reflection.py +++ /dev/null @@ -1,45 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/transitive-deps/src/s.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - -import b.types as _b_types -import c.types as _c_types - -import s.types as _s_types - - -def get_reflection__TestService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="TestService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="test", - arguments=( - ), - result=None, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - _c_types.E, - ), - annotations={ - }, - ) - ) - return spec diff --git a/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/clients.pyx b/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/clients.pyx index f550fd95f7b..6d52876e114 100644 --- a/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/clients.pyx +++ b/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/clients.pyx @@ -56,8 +56,7 @@ cimport apache.thrift.fixtures.types.included.types as _apache_thrift_fixtures_t cimport apache.thrift.fixtures.types.included.cbindings as _apache_thrift_fixtures_types_included_cbindings import apache.thrift.fixtures.types.included.types as _apache_thrift_fixtures_types_included_types -import apache.thrift.fixtures.types.module.services_reflection as _services_reflection -cimport apache.thrift.fixtures.types.module.services_reflection as _services_reflection +cimport apache.thrift.fixtures.types.module.services_interface as _fbthrift_services_interface from apache.thrift.fixtures.types.module.clients_wrapper cimport cSomeServiceAsyncClient, cSomeServiceClientWrapper @@ -164,14 +163,10 @@ cdef class SomeService(thrift.py3.client.Client): return asyncio_shield(__future) - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__SomeService(for_clients=True) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cSomeServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cSomeServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services.pyx b/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services.pyx index 250589ffcf0..9703a6f83da 100644 --- a/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services.pyx +++ b/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services.pyx @@ -60,8 +60,7 @@ import apache.thrift.fixtures.types.included.types as _apache_thrift_fixtures_ty cimport apache.thrift.fixtures.types.included.types as _apache_thrift_fixtures_types_included_types cimport apache.thrift.fixtures.types.included.cbindings as _apache_thrift_fixtures_types_included_cbindings -import apache.thrift.fixtures.types.module.services_reflection as _services_reflection -cimport apache.thrift.fixtures.types.module.services_reflection as _services_reflection +cimport apache.thrift.fixtures.types.module.services_interface as _fbthrift_services_interface import asyncio import functools @@ -157,14 +156,10 @@ cdef class SomeServiceInterface( r): raise NotImplementedError("async def binary_keyed_map is not implemented") - @classmethod - def __get_reflection__(cls): - return _services_reflection.get_reflection__SomeService(for_clients=False) - @staticmethod def __get_metadata__(): cdef __fbthrift_cThriftServiceMetadataResponse response - ServiceMetadata[_services_reflection.cSomeServiceSvIf].gen(response) + ServiceMetadata[_fbthrift_services_interface.cSomeServiceSvIf].gen(response) return __MetadataBox.box(cmove(deref(response.metadata_ref()))) @staticmethod diff --git a/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services_reflection.pxd b/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services_interface.pxd similarity index 100% rename from thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services_reflection.pxd rename to thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services_interface.pxd diff --git a/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services_reflection.py b/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services_reflection.py deleted file mode 100644 index 2198e0d3e77..00000000000 --- a/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/services_reflection.py +++ /dev/null @@ -1,73 +0,0 @@ -# -# Autogenerated by Thrift for thrift/compiler/test/fixtures/types/src/module.thrift -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# @generated -# - -from thrift.py3.reflection import ( - ArgumentSpec as __ArgumentSpec, - InterfaceSpec as __InterfaceSpec, - MethodSpec as __MethodSpec, - NumberType as __NumberType, -) - -import folly.iobuf as _fbthrift_iobuf - -import apache.thrift.fixtures.types.included.types as _apache_thrift_fixtures_types_included_types - -import apache.thrift.fixtures.types.module.types as _apache_thrift_fixtures_types_module_types - - -def get_reflection__SomeService(for_clients: bool): - spec: __InterfaceSpec = __InterfaceSpec( - name="SomeService", - methods=None, - annotations={ - }, - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="bounce_map", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="m", - type=_apache_thrift_fixtures_types_module_types.std_unordered_map__Map__i32_string, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_apache_thrift_fixtures_types_module_types.std_unordered_map__Map__i32_string, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - spec.add_method( - __MethodSpec.__new__( - __MethodSpec, - name="binary_keyed_map", - arguments=( - __ArgumentSpec.__new__( - __ArgumentSpec, - name="r", - type=_apache_thrift_fixtures_types_module_types.List__i64, - kind=__NumberType.NOT_A_NUMBER, - annotations={ - }, - ), - ), - result=_apache_thrift_fixtures_types_module_types.Map__binary_i64, - result_kind=__NumberType.NOT_A_NUMBER, - exceptions=( - ), - annotations={ - }, - ) - ) - return spec