You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on this, but maybe need some help from @craigcitro . The bits of apitools we need to do the upload / download still have dependencies on protorpc, even outside code generation / generated code:
apitools.base.py.base_api
defines two classes derived from protorpc.messages.Message
uses protorpc.messages.ValidationError and protorpc.messages.MessageFields classes for error handling / validation.
Its _LoadClass uses the protorpc.message_types module for "simple" / scalar types.
apitools.base.py.encoding
depends heavily on protorpc.messages.Message (its whole raison-d'etre is marshalling JSON using messages as schema).
uses the protorpc.message_types module, but in only one place (and the usage is somewhat odd, excluding "normal" marshalling of protorpc.message_types.DateTimeField)
uses the protorpc.protorpc.ProtoJson class to do a "deep copy", and has a helper class derived from it (used from MessageToJson() and JsonToMessage().
apitools.base.py.extra_types
depends heavily on protorpc.messages.Message.
re-exports protorpc.message_types.DateTimeMessage
adds custom marshalling for protorpc.message_types.DateTimeField.
uses the protorpc.protorpc.ProtoJson class in its cusoom marshlling of protorpc.message_types.DateTimeField.
For us to use apitools, we really need either a version of google-protorpc that supports our desired Python versions, or else we need to fork the needed bits of both into our codebase. Note that the protorpc modules we use (unlike most of the rest) don't pull in a dependency on GAE, so maybe we should be pulling them out somehow.
It is hard to estimate, given that running the tests is an unknown quantity. I've done some work today on adding tox support, but the tests don't all pass in the absence of the not-explicitly-depended-on GAE / protobuf code. I will post a gist showing the modernize results (after cleaning it up a bit).
RE: "residual memories" I never got tests running outside of Google's BUILD environment, so I am in the same boat as @tseaver.
As for the usefulness of protorpc, I am not sold on it if we are only using it in generated code.
The value in user-land was that people could create protorpc.Message objects which behaved "exactly" like a typed object (something obviously not supported in Python).
@silvolu looks like we could: that would use http_wrapper, exceptions, and util as well, and none of those import anything from protorpc. We still can't ship with a dependency on protorpc if it doesn't support the versions we want: I guess we could just fork those four modules (they don't have tests) into a "vendored" sub-package for now.
@silvolu@craigcitro I'm not sure we can make use of apitools.base.py.transfer directly without the support of the stuff in apitools.base.py.base_api. In particular, transfer.Upload.InitializeUpload() and transfer.Download.InitializeDownload() APIs expect to be handed http_request and client arguments which are set up inside base_api.BaseApiService._RunMethod(), which has lots more hair than we should be replicating.
Activity
tseaver commentedon Nov 20, 2014
I'm working on this, but maybe need some help from @craigcitro . The bits of apitools we need to do the upload / download still have dependencies on protorpc, even outside code generation / generated code:
apitools.base.py.base_apiprotorpc.messages.Messageprotorpc.messages.ValidationErrorandprotorpc.messages.MessageFieldsclasses for error handling / validation._LoadClassuses theprotorpc.message_typesmodule for "simple" / scalar types.apitools.base.py.encodingprotorpc.messages.Message(its whole raison-d'etre is marshalling JSON using messages as schema).protorpc.message_typesmodule, but in only one place (and the usage is somewhat odd, excluding "normal" marshalling ofprotorpc.message_types.DateTimeField)protorpc.protorpc.ProtoJsonclass to do a "deep copy", and has a helper class derived from it (used fromMessageToJson()andJsonToMessage().apitools.base.py.extra_typesprotorpc.messages.Message.protorpc.message_types.DateTimeMessageprotorpc.message_types.DateTimeField.protorpc.protorpc.ProtoJsonclass in its cusoom marshlling ofprotorpc.message_types.DateTimeField.For us to use
apitools, we really need either a version ofgoogle-protorpcthat supports our desired Python versions, or else we need to fork the needed bits of both into our codebase. Note that theprotorpcmodules we use (unlike most of the rest) don't pull in a dependency on GAE, so maybe we should be pulling them out somehow.tseaver commentedon Nov 20, 2014
@dhermes you've got some residual memories of
protorpc-- maybe you can suggest something?craigcitro commentedon Nov 20, 2014
I'm actively working on getting the
protorpcfixes pushed through -- it's going well, i've just got a few too many balls in the air right now.how far away is protorpc for python3 support? (you'd think i would know, but haven't looked yet.)
tseaver commentedon Nov 20, 2014
It is hard to estimate, given that running the tests is an unknown quantity. I've done some work today on adding
toxsupport, but the tests don't all pass in the absence of the not-explicitly-depended-on GAE / protobuf code. I will post a gist showing themodernizeresults (after cleaning it up a bit).dhermes commentedon Nov 20, 2014
RE: "residual memories" I never got tests running outside of Google's BUILD environment, so I am in the same boat as @tseaver.
As for the usefulness of
protorpc, I am not sold on it if we are only using it in generated code.The value in user-land was that people could create
protorpc.Messageobjects which behaved "exactly" like a typed object (something obviously not supported in Python).We could write something much simpler given a JSON schema:
https://gist.github.com/dhermes/2cbf4352146239e1aca1
I don't know if @craigcitro has feelings on this, but I'd guess he's thought about it more than I have.
tseaver commentedon Nov 20, 2014
We use a fairly narrow slice of it in non-generated code (see above).
tseaver commentedon Nov 20, 2014
@craigcitro here is the gist I promised (I'd be glad to kick this in as another Hg branch):
https://gist.github.com/tseaver/6d28ef139b2a0dcb2eea
silvolu commentedon Nov 20, 2014
Couldn't we just use
transfer.pyfor uploads and downloads?There shouldn't be no need for protorpc in that case.
tseaver commentedon Nov 20, 2014
@silvolu looks like we could: that would use
http_wrapper,exceptions, andutilas well, and none of those import anything fromprotorpc. We still can't ship with a dependency onprotorpcif it doesn't support the versions we want: I guess we could just fork those four modules (they don't have tests) into a "vendored" sub-package for now.silvolu commentedon Nov 20, 2014
Yeah, that's the plan B mentioned in the doc I sent along.
tseaver commentedon Nov 25, 2014
@silvolu @craigcitro I'm not sure we can make use of
apitools.base.py.transferdirectly without the support of the stuff inapitools.base.py.base_api. In particular,transfer.Upload.InitializeUpload()andtransfer.Download.InitializeDownload()APIs expect to be handedhttp_requestandclientarguments which are set up insidebase_api.BaseApiService._RunMethod(), which has lots more hair than we should be replicating.40 remaining items
chore: move docs check from kokoro to GH actions (#334)
chore: reference main branch of google-cloud-python (#334)
feat: Add read_time support for get and query (#334)
feat: Add Support for Layout Parser Documents (#334)
fix: bump minimum versions for google-api-core and proto-plus (#334)
chore: release 2.1.1 (#341)
feat: add always_use_jwt_access (#334)
chore: release 2.6.0 (#337)
feat: add always_use_jwt_access (#334)
chore: release 2.6.0 (#337)
chore(deps): update dependency avro to v1.10.2 (#334)
django: fix crash when using F expression on TimeField
chore: change owner to harshachinta (#334)
tests: pre-scrub old HMAC keys before testing creation (#467)
feat!: Bump minimum version to 3.10 (#334)