This repository was archived by the owner on Mar 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Python client v3 (UASTv2) #128
Merged
Merged
Changes from 22 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
9b5b502
use the new libuast; rewrite bindings using cpp layer of libuast
2788a1a
working bindings prototype
8e39632
fix string memory management
d3b6bf9
refactoring: NodeExtType->PyNodeExtType for consistency
bzz 6ce2b11
refactoring: NodeExt->PyNodeExt for consistency
bzz 7bac87f
refactoring: PyUastType->PyContextType for consistency
bzz 8b84e4a
refactoring: PyUast->PyContext for consistency
bzz 1fa1d0d
refactoring: fix comments + fmt after rebase
bzz 9e88733
apply review feedback
bzz 98b3ef8
fix replace
96abf64
Build fixes, comment out v1 things, some other adjustements
151e61c
Recover grpc sdk v1 protocol for some grpc objects
7f583ea
Forward port the aliases refactor by Vadim
6ba57fc
Forward port travis changes
24fd7b6
Merge branch 'master' into v3
juanjux a2ca471
fix pip install
e308038
update the client to use both protocols
0d675e1
Remove unused and broken import
91b798b
Compile the ext module from an static libuast object
acec219
enable building the client with static libuast
2fd570c
do not free the query string in filter, it seems to be borrowed
d05770c
improve the native Python wrappers and update the readme
272acc9
fix error handling in native extension
270445b
Explicit cast to char* to avoid nasty warning with latest G++
1f977e4
PEP8
20890e0
Renamed PyContext to PythonContext to avoid symbol conflict in 3.7+
2c983a9
Use same name for Windows an Linux static lib before the extension
0bcf223
Add several needed static libs for Windows
8401a1c
Several improvements (see desc)
bd8c2d5
Several Improvements (II)
f964c46
Make iterators great (and working) again
ea7d615
fix usage of parsed string arguments in filter
1c73766
properly deallocate python objects
7cb563a
free encoding buffer
cd1d90d
bump versions
a55abc4
Unittests and other fixes
d74a514
Merge branch 'master' into v3
juanjux 75170a6
Uncommented failed test
c4fd5be
Enabled unnitesting in travis
753efb4
Run docker and install python driver from travis
9876503
Commented out the node afected by SDK issue 340
7098328
Merge branch 'master' into v3
juanjux 7ad8c6f
Remove Python 3.5 from Travis
a2752b7
Use range for grpcio and grpciotools
a99f5be
Fixed some of @bzz feedback from review
b983ea2
add error checks for iterators and clarify comments
9e3f415
Fixed from @zurk review (thanks!)
988eb5e
Merge branch 'v3' of https://github.com/dennwc/client-python into v3
ba93944
Merge branch 'master' into v3
juanjux d485273
Fixes and improvements from @vmarkovtsev review
66ccfed
PEP8 fix
a020666
Changed ModeDict to a Modes enum-like class
9b094aa
Allow to create Clients with an instanced grpc channel as suggested b…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
__all__ = ["DESCRIPTOR", "Node", "Position", "ParseResponse", "NativeParseResponse", | ||
"ParseRequest", "NativeParseRequest", "VersionRequest", "ProtocolServiceStub"] | ||
|
||
import importlib | ||
|
||
from bblfsh.sdkversion import VERSION | ||
|
||
# "in" is a reserved keyword in Python thus can't be used as package name, so | ||
# we import by string | ||
uast_module = importlib.import_module( | ||
"bblfsh.gopkg.in.bblfsh.sdk.%s.uast.generated_pb2" % VERSION) | ||
protocol_module = importlib.import_module( | ||
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2" % VERSION) | ||
protocol_grpc_module = importlib.import_module( | ||
"bblfsh.gopkg.in.bblfsh.sdk.%s.protocol.generated_pb2_grpc" % VERSION) | ||
|
||
DESCRIPTOR = uast_module.DESCRIPTOR | ||
Node = uast_module.Node | ||
Position = uast_module.Position | ||
ParseResponse = protocol_module.ParseResponse | ||
NativeParseResponse = protocol_module.NativeParseResponse | ||
ParseRequest = protocol_module.ParseRequest | ||
NativeParseRequest = protocol_module.NativeParseRequest | ||
VersionRequest = protocol_module.VersionRequest | ||
SupportedLanguagesRequest = protocol_module.SupportedLanguagesRequest | ||
SupportedLanguagesResponse = protocol_module.SupportedLanguagesResponse | ||
ProtocolServiceStub = protocol_grpc_module.ProtocolServiceStub | ||
uast_v2_module = importlib.import_module("bblfsh.gopkg.in.bblfsh.sdk.v2.uast.generated_pb2") | ||
protocol_v2_module = importlib.import_module("bblfsh.gopkg.in.bblfsh.sdk.v2.protocol.generated_pb2") | ||
juanjux marked this conversation as resolved.
Show resolved
Hide resolved
|
||
protocol_grpc_v2_module = importlib.import_module("bblfsh.gopkg.in.bblfsh.sdk.v2.protocol.generated_pb2_grpc") | ||
protocol_v1_module = importlib.import_module("bblfsh.gopkg.in.bblfsh.sdk.v1.protocol.generated_pb2") | ||
protocol_grpc_v1_module = importlib.import_module("bblfsh.gopkg.in.bblfsh.sdk.v1.protocol.generated_pb2_grpc") | ||
|
||
# Node = importlib.import_module( | ||
# "bblfsh.gopkg.in.bblfsh.sdk.v2.uast.generated_pb2").Node | ||
|
||
DESCRIPTOR = uast_v2_module.DESCRIPTOR | ||
ParseRequest = protocol_v2_module.ParseRequest | ||
ParseResponse = protocol_v2_module.ParseResponse | ||
ParseError = protocol_v2_module.ParseError | ||
Mode = protocol_v2_module.Mode | ||
DriverStub = protocol_grpc_v2_module.DriverStub | ||
DriverServicer = protocol_grpc_v2_module.DriverServicer | ||
|
||
VersionRequest = protocol_v1_module.VersionRequest | ||
SupportedLanguagesRequest = protocol_v1_module.SupportedLanguagesRequest | ||
SupportedLanguagesResponse = protocol_v1_module.SupportedLanguagesResponse | ||
ProtocolServiceStub = protocol_grpc_v1_module.ProtocolServiceStub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.