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.51k stars 937 forks source link

chore(tox): lower the barrier to contribution #2003

Closed vytas7 closed 2 years ago

vytas7 commented 2 years ago

Closes #1983

I was forced to add a handful of coverage # pragmas for CPython 3.10 due the bugs in coveragepy or (likely) the interpreter itself.

I added a new CI action that is triggered for master merges, but a successful prototype run is demonstrated here: https://github.com/falconry/falcon/runs/5260441852?check_suite_focus=true. This action simply runs tox with the default envlist, which has now been modernized to be fully sufficient on CPython 3.8 & 3.10 in lieu of the old tools/mintest.sh.

codecov[bot] commented 2 years ago

Codecov Report

Merging #2003 (949ec64) into master (9a7dc5d) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #2003   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         6714      6707    -7     
  Branches      1243      1238    -5     
=========================================
- Hits          6714      6707    -7     
Impacted Files Coverage Δ
falcon/asgi/app.py 100.00% <ø> (ø)
falcon/asgi/reader.py 100.00% <ø> (ø)
falcon/asgi/__init__.py 100.00% <100.00%> (ø)
falcon/constants.py 100.00% <100.00%> (ø)
falcon/routing/static.py 100.00% <100.00%> (ø)
falcon/util/__init__.py 100.00% <100.00%> (ø)
falcon/util/misc.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 9a7dc5d...949ec64. Read the comment docs.

vytas7 commented 2 years ago

Still in Draft as I'm trying to figure out what to do wrt https://github.com/nedbat/coveragepy/issues/1324. There are quite many missed branches, and I don't want to plop that many pragmas on those lines yet...

vytas7 commented 2 years ago

Hm, maybe I should add a newsfragment for this and call it an improvement?

vytas7 commented 2 years ago

@CaselIT it would be awesome if you could check out the branch and give it a spin on Windows CPython 3.8 or 3.10 (just run tox).

CaselIT commented 2 years ago

@CaselIT it would be awesome if you could check out the branch and give it a spin on Windows CPython 3.8 or 3.10 (just run tox).

trying on 3.9 (that's what in the env at the moment. will try the other

vytas7 commented 2 years ago

3.9 has too many bugs so you won't get full coverage, otherwise nice to check (described in CONTRIBUTING).

CaselIT commented 2 years ago

it's fine also on 3.10, but the coverage still fails with

falcon\routing\static.py                  110      1     48      1    99%   184
vytas7 commented 2 years ago

:thinking: It passes in Actions on 3.10.2... which micro version are you on with Conda?

Edit: nvm maybe it's something path related, like a normalized file path starts with C: or similar instead of / there...

Is that line the only one without coverage on Windows?

CaselIT commented 2 years ago

on 3.10, yes, that's the only one.

I can take a look

vytas7 commented 2 years ago

@CaselIT I have hopefully fixed that OS-specific discrepancy, could you please give it a spin again on 3.10 (or 3.8) on Windows?

CaselIT commented 2 years ago

coverage is now fine at falcon\routing\static.py 111 0 48 0 100%