janezpodhostnik / flow-py-sdk

Unofficial flow blockchain python sdk
MIT License
35 stars 26 forks source link

python SDK - milestone 1,2 #29

Closed Cuttlas90 closed 2 years ago

Cuttlas90 commented 2 years ago

python SDK: adding example & docs - milestone 1,2

codecov-commenter commented 2 years ago

Codecov Report

Merging #29 (a3f8029) into master (716c169) will decrease coverage by 1.06%. The diff coverage is 31.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
- Coverage   80.98%   79.92%   -1.07%     
==========================================
  Files          26       26              
  Lines        1478     1514      +36     
  Branches       89       93       +4     
==========================================
+ Hits         1197     1210      +13     
- Misses        265      288      +23     
  Partials       16       16              
Flag Coverage Δ
unittests 79.92% <31.25%> (-1.07%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flow_py_sdk/client/client.py 35.53% <0.00%> (ø)
flow_py_sdk/tx.py 54.79% <23.07%> (-3.35%) :arrow_down:
flow_py_sdk/account_key.py 74.41% <31.25%> (-25.59%) :arrow_down:
flow_py_sdk/templates.py 52.94% <100.00%> (+14.47%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 716c169...a3f8029. Read the comment docs.

janezpodhostnik commented 2 years ago

Nice progress! Thank you very much.

I need to check if the docs will still auto-generate if there are .mdx. If they don't we might have to switch to a different doc generator :).

Have you considered adding assertions to the end of each example. To assert that the expected result was actually returned. Just adding that would turn the examples into integration tests.

kerrywei commented 2 years ago

@barekati great progress! I'm Kerry from the flow team would you want to give the newly proposed documentation template a shot? https://github.com/onflow/sdks/blob/main/templates/documentation/template.md -- it should pre-document a lot of contents for SDK maintainers 😄

Cuttlas90 commented 2 years ago

@barekati great progress! I'm Kerry from the flow team would you want to give the newly proposed documentation template a shot? https://github.com/onflow/sdks/blob/main/templates/documentation/template.md -- it should pre-document a lot of contents for SDK maintainers 😄

great @kerrywei , it propose to gather all document in one or split it for different contents? which one is better?

kerrywei commented 2 years ago

@barekati I would recommend to follow the one-file with all examples like the template suggested. What do you think?

Cuttlas90 commented 2 years ago

@barekati I would recommend to follow the one-file with all examples like the template suggested. What do you think?

idk, my style, I split my book by chapters before exams 😅. but we can have both I think, do you agree?

kerrywei commented 2 years ago

One downside of having both is that when we change any samples in the future, we need to update two places (the one-pager + split ones). Perhaps we can start with just one doc?

Cuttlas90 commented 2 years ago

One downside of having both is that when we change any samples in the future, we need to update two places (the one-pager + split ones). Perhaps we can start with just one doc?

Ok

Cuttlas90 commented 2 years ago

One downside of having both is that when we change any samples in the future, we need to update two places (the one-pager + split ones). Perhaps we can start with just one doc?

Ok

in template, for each section, we should put an output example. I get a random response and write it down? for example for block section, i get a response and write the response in output section?

Cuttlas90 commented 2 years ago

One downside of having both is that when we change any samples in the future, we need to update two places (the one-pager + split ones). Perhaps we can start with just one doc?

Ok

in template, for each section, we should put an output example. I get a random response and write it down? for example for block section, i get a response and write the response in output section?

also there are some "try it" buttons, they should link to example files?

kerrywei commented 2 years ago

@barekati yeah, regarding non-deterministic output, I think we can just put something in the output section based on result from any execution you get locally; and yes, that try-it button should link to the actual file with the sample code

Cuttlas90 commented 2 years ago

Hey @barekati , no other comments for now. Please let me know once this PR adopts the SDK documentation template. Meanwhile, feel free to include the extra samples/sections you have in this PR that are not included in the SDK template :)

I send a new pr, let me know your opinions @janezpodhostnik @kerrywei

janezpodhostnik commented 2 years ago

The new code changes look good to me. 👍