Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: flask import of _endpoint_from_view_func - issue #567 #572

Merged
merged 7 commits into from
Dec 10, 2023

Conversation

Ryu-CZ
Copy link
Contributor

@Ryu-CZ Ryu-CZ commented Oct 4, 2023

Due to repeated accident of import error #567 I added helper method import_check_view_func . With fallback to last known implementation which stayed the same in all flask versions.

I submit new pull request with new branch name flask-scaffold_567 on same commit, because in original pull request #568 I used master branch in contrary to guidelines.

@peter-doggart
Copy link
Contributor

Thanks for doing this @Ryu-CZ

I'm assuming this is held up by the pytest-flask issue?

@Ryu-CZ
Copy link
Contributor Author

Ryu-CZ commented Oct 6, 2023

@peter-doggart yes, tests are not passing because pytest-flask issue 167

@Ryu-CZ
Copy link
Contributor Author

Ryu-CZ commented Oct 6, 2023

I forgot to add my method into utils.__all__ so here is small patch to fix it. This should prevent static syntax analyses to show weak warning about Importing method not listed in all.

@peter-doggart
Copy link
Contributor

Still waiting on the pytest fixes, but it looks like they are working on getting that project updated. :)

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (3ea4ce1) 96.45% compared to head (81dd9f4) 96.15%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #572      +/-   ##
==========================================
- Coverage   96.45%   96.15%   -0.30%     
==========================================
  Files          20       20              
  Lines        2733     2755      +22     
==========================================
+ Hits         2636     2649      +13     
- Misses         97      106       +9     
Files Coverage Δ
flask_restx/api.py 96.53% <100.00%> (-0.03%) ⬇️
flask_restx/utils.py 83.87% <64.00%> (-13.43%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Ryu-CZ
Copy link
Contributor Author

Ryu-CZ commented Oct 26, 2023

I forget to mention the new method import_check_view_func to get _endpoint_from_view_func is compatible with flask reasonable versions 1, 2, 3.

@peter-doggart peter-doggart merged commit b7d1ded into python-restx:master Dec 10, 2023
8 of 10 checks passed
@Ryu-CZ Ryu-CZ deleted the flask-scaffold_567 branch December 13, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants