falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.53k stars 945 forks source link

feat(static): support `Path` arg in `App.add_static_route()` #1970

Closed vgerak closed 3 years ago

vgerak commented 3 years ago

Summary of Changes

Minor py3.5 compatibility change, to allow pathlib.Path argument types to be provided in App.add_static_route()

Related Issues

Closes #1962

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

codecov[bot] commented 3 years ago

Codecov Report

Merging #1970 (d48cd9a) into master (9152c53) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1970   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         6621      6624    +3     
  Branches      1067      1068    +1     
=========================================
+ Hits          6621      6624    +3     
Impacted Files Coverage Δ
falcon/app.py 100.00% <ø> (ø)
falcon/routing/static.py 100.00% <100.00%> (ø)

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 9152c53...d48cd9a. Read the comment docs.

CaselIT commented 3 years ago

Well it's not a hot path so we could just do an isinstance(directory, Path) and convert to string there (also maybe adding a todo: remove once we drop py3.5

CaselIT commented 3 years ago

thanks for the update!