Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Conversation

@leynier
Copy link
Contributor

@leynier leynier commented Aug 21, 2022

This pull request is to sync the current implementation (maintaining a Pythonic approach) with the gotrue-js implementation to get both libraries to have feature parity.

We also want to do as much testing as possible to get as high testing coverage as possible (the main difficulty with testing is in methods where mobile phone service is used).

Finally, if the objectives of this pull request are achieved, move the version to v1 and consider this library stable (as much as possible).

@leynier leynier added the enhancement New feature or request label Aug 21, 2022
@leynier leynier self-assigned this Aug 21, 2022
@codecov
Copy link

codecov bot commented Aug 21, 2022

Codecov Report

Base: 84.46% // Head: 37.60% // Decreases project coverage by -46.87% ⚠️

Coverage data is based on head (66f3f3a) compared to base (52d4c8d).
Patch coverage: 57.02% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #148       +/-   ##
===========================================
- Coverage   84.46%   37.60%   -46.87%     
===========================================
  Files          14       25       +11     
  Lines        1056     2284     +1228     
===========================================
- Hits          892      859       -33     
- Misses        164     1425     +1261     
Impacted Files Coverage Δ
gotrue/_sync/api.py 0.00% <0.00%> (-70.00%) ⬇️
gotrue/_sync/client.py 0.00% <ø> (-89.50%) ⬇️
gotrue/timer.py 27.58% <27.58%> (ø)
gotrue/_async/gotrue_client.py 30.10% <30.10%> (ø)
gotrue/_sync/gotrue_client.py 30.10% <30.10%> (ø)
gotrue/errors.py 72.54% <72.54%> (ø)
gotrue/helpers.py 80.00% <79.06%> (-20.00%) ⬇️
gotrue/_async/gotrue_base_api.py 93.02% <93.02%> (ø)
gotrue/_sync/gotrue_base_api.py 93.02% <93.02%> (ø)
gotrue/_async/gotrue_admin_api.py 93.93% <93.93%> (ø)
... and 15 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@leynier leynier marked this pull request as draft August 21, 2022 20:39
@odiseo0
Copy link
Contributor

odiseo0 commented Aug 23, 2022

What are the parts that are not covered by tests?

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 9, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 20.57%.

Quality metrics Before After Change
Complexity 1.87 ⭐ 1.80 ⭐ -0.07 👍
Method Length 53.39 ⭐ 65.79 🙂 12.40 👎
Working memory 4.98 ⭐ 13.74 😞 8.76 👎
Quality 81.87% 61.30% 🙂 -20.57% 👎
Other metrics Before After Change
Lines 3108 1925 -1183
Changed files Quality Before Quality After Quality Change
gotrue/__init__.py 88.24% ⭐ 90.29% ⭐ 2.05% 👍
gotrue/constants.py 90.76% ⭐ 95.36% ⭐ 4.60% 👍
gotrue/helpers.py 97.50% ⭐ 85.38% ⭐ -12.12% 👎
gotrue/types.py 78.52% ⭐ 38.79% 😞 -39.73% 👎
gotrue/_sync/api.py 80.85% ⭐ 80.72% ⭐ -0.13% 👎
gotrue/_sync/client.py 72.17% 🙂 72.17% 🙂 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
gotrue/_sync/client.py SyncGoTrueClient.get_session_from_url 15 🙂 250 ⛔ 13 😞 36.01% 😞 Try splitting into smaller methods. Extract out complex expressions
gotrue/_sync/client.py SyncGoTrueClient.sign_in 11 🙂 140 😞 13 😞 48.19% 😞 Try splitting into smaller methods. Extract out complex expressions
gotrue/_sync/client.py SyncGoTrueClient.__init__ 3 ⭐ 111 🙂 17 ⛔ 54.55% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

Co-authored-by: Sourcery AI <>
@J0 J0 marked this pull request as ready for review January 29, 2023 11:11
@J0 J0 self-requested a review January 29, 2023 11:11
@J0
Copy link
Contributor

J0 commented Jan 29, 2023

Hey @leynier,

Thanks for putting this together! 🚀 Going to go ahead and merge this one in first but feel free to sound off if you have strong opinions about it please lmk and I'll revert. Think this would be really helpful for the general for the general public even without the desired test coverage

@J0 J0 merged commit b79e2a8 into main Jan 29, 2023
@leynier leynier deleted the next branch January 29, 2023 12:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants