adriangb / xpresso

A composable Python ASGI web framework
https://xpresso-api.dev/
MIT License
178 stars 4 forks source link

chore(dev): Improve low Code and Refactor Functions #65

Closed yezz123 closed 2 years ago

yezz123 commented 2 years ago

Hello @adriangb It's been a long time we talk about the projects, I just find the right time to do some improvement in code may be related to styling and improving code to use the last Pythonic ways, that's why!

I guess you will find most of the refactor functions are:

And other ones, also sorry for this Big Pull request 😅

codecov-commenter commented 2 years ago

Codecov Report

Merging #65 (0d3ee5a) into main (bba3161) will increase coverage by 0.09%. The diff coverage is 91.17%.

@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
+ Coverage   97.39%   97.48%   +0.09%     
==========================================
  Files         141      141              
  Lines        4562     4532      -30     
  Branches      590      580      -10     
==========================================
- Hits         4443     4418      -25     
+ Misses         75       71       -4     
+ Partials       44       43       -1     
Impacted Files Coverage Δ
xpresso/openapi/_responses.py 67.27% <76.92%> (+2.86%) :arrow_up:
xpresso/_utils/media_type_validator.py 83.33% <100.00%> (-1.86%) :arrow_down:
xpresso/applications.py 97.39% <100.00%> (-0.03%) :arrow_down:
xpresso/binders/_body/extractors/field.py 100.00% <100.00%> (ø)
xpresso/binders/_body/extractors/form_field.py 100.00% <100.00%> (ø)
xpresso/binders/_body/extractors/json.py 100.00% <100.00%> (ø)
xpresso/binders/_body/openapi/discriminated.py 85.36% <100.00%> (+3.97%) :arrow_up:
xpresso/binders/_body/openapi/field.py 100.00% <100.00%> (ø)
xpresso/binders/_body/openapi/file.py 100.00% <100.00%> (ø)
xpresso/binders/_body/openapi/form.py 98.24% <100.00%> (-0.06%) :arrow_down:
... and 3 more
yezz123 commented 2 years ago

Hello @adriangb, Thank you for the fast response, I really enjoy looking into the codebase and trying different thing with the framework, I really enjoy it in the structure while its look similar to FastAPI somehow.

I fix all the things that's not compatible with your requirements

adriangb commented 2 years ago

Awesome, thank you.

So my plan for this project (at least for now, not sure if it will work out long term since I haven't seen this done anywhere else) is to release early and release often, the goal is that every change is a PR and every PR results in a release. So to make this happen I'm requiring every PR to bump the project version. Could you go into pyproject.toml and do a patch bump (or run poetry version patch)?

There's also a couple minor listing issues 😄

Thanks!

yezz123 commented 2 years ago

Awesome, thank you.

So my plan for this project (at least for now, not sure if it will work out long term since I haven't seen this done anywhere else) is to release early and release often, the goal is that every change is a PR and every PR results in a release. So to make this happen I'm requiring every PR to bump the project version. Could you go into pyproject.toml and do a patch bump (or run poetry version patch)?

There's also a couple minor listing issues 😄

Thanks!

Yes I checked the release phase, it looks good, I just push the fix, and also the fix of mypy