File | Status |
---|---|
CLI load time: 0:00.26
Pull Request HEAD: 65418307b7e88ec269384ed0cb620a67ed53e7ff
Imports that take more than 0.1 s:
import time: self [us] | cumulative | imported package
import time: 1027 | 102326 | typer.main
import time: 289 | 121148 | typer
import time: 7655 | 198155 | everyvoice.cli
Attention: Patch coverage is 92.85714%
with 17 lines
in your changes missing coverage. Please review.
Project coverage is 76.77%. Comparing base (
fc0dc20
) to head (6541830
).
Report is 4 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
everyvoice/wizard/tour.py | 92.70% | 11 Missing and 6 partials ⚠️ |
@@ Coverage Diff @@
## main #615 +/- ##
==========================================
+ Coverage 76.74% 76.77% +0.02%
==========================================
Files 46 47 +1
Lines 3445 3449 +4
Branches 470 470
==========================================
+ Hits 2644 2648 +4
Misses 700 700
Partials 101 101
☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.
Nice - thanks Eric! I agree it makes sense to move stuff out of the init module. Moving things to tour.py makes sense to me. This PR looks good, and does seem to speed things up. Thanks!
Login to write a write a comment.
PR Goal?
On the login node on GPSC-C, the CLI can take 4 or 5 seconds to respond to a
<tab>
because it's loading a lot of stuff. The biggest culprits are typer, rich, and other things required to actually provide CLI help and autocompletion, but I noticed the wizard is doing some imports we can defer too, so I refactored it.This results in a 15% or so speed up of
everyvoice -h
once already loaded from cache, and I'm not sure how much on a first try when not in disk cache yet (that's harder to measure!). Not the big difference I was hoping for, but still worth committing and pushing.Plus, the refactored code is a little cleaner than the original imho.
Feedback sought?
Regular review
The diff will look huge, but it's not: stuff removed from
wizard/__init__.py
has been moved verbatim towizard/tour.py
.Priority?
low
Tests added?
was already covered, adjusted where needed
How to test?
run
everyvoice test cli
and maybeeveryvoice new-project
and see no failures.Confidence?
high: this is just moving definitions from one file to another, using VSCode's refactoring tools and then testing and adjusting the few little bits it didn't handle.
Note: I thought of having the Step classes in
step.py
and the Tour class intour.py
, but doing so created circular imports since each uses the other for typing hints, and therefore I decided it made most sense to keep them all together intour.py
.Version change?
no
Related PRs?