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

Miscelaneous changes #193

Merged
merged 5 commits into from
Jan 5, 2024
Merged

Miscelaneous changes #193

merged 5 commits into from
Jan 5, 2024

Conversation

joanise
Copy link
Member

@joanise joanise commented Jan 5, 2024

  • optimize the CLI and report its speed in PR comments
  • use the latest setup-ffmpeg action to get the latest ffmpeg in CI
  • minor style changes suggested by ruff, that black doesn't revert

ruff is a drop-in replacement for black, flake8 and isort, but runs
about 100 times faster.
Ref: https://github.com/astral-sh/ruff

On Studio, black accepts all the changes ruff makes.

This commit applies what ruff did, and removed a superfluous command in
test/run.py that ruff flagged, but does not change pre-commit or the dev
dependencies yet.
Also, revert this commit:
 2023-09-13 acd724e Eric Joanis ci: suppress redundant tests runs on PR and push
It turns out doing CI on review_requested is not great, because:
 - if you request 2 or 3 reviews, it triggers the action 2 or 3 times
 - when the branch needs a real merge, we do want the result of the merge
   tested in CI, so we lost important validation
Copy link

codecov bot commented Jan 5, 2024

Codecov Report

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

Comparison is base (51f1dce) 87.03% compared to head (2daf991) 87.04%.

Files Patch % Lines
readalongs/cli.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #193   +/-   ##
=======================================
  Coverage   87.03%   87.04%           
=======================================
  Files          21       21           
  Lines        1735     1744    +9     
  Branches      315      315           
=======================================
+ Hits         1510     1518    +8     
- Misses        188      189    +1     
  Partials       37       37           

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

Copy link
Contributor

github-actions bot commented Jan 5, 2024

CLI load time: 0:00.34
PR head 2daf991fe0fcd9476381370930d132b69126add8
Imports that take more than 0.1 s:
import time: self [us] | cumulative | imported package
import time:    234136 |     292983 | pkg_resources

@joanise
Copy link
Member Author

joanise commented Jan 5, 2024

Not sure where that pkg_resources comes from in the import analysis in CI, but I don't see that on my machine or on Linux. It's faster on Linux for me, at 0.13s. It was already OK before this PR, but I like this better. On Windows, it's slower: now at 0.9s, previously at 1.3s. I don't know why, but I would not be surprised if it had to do with NRC's security stack, and I expect there's little I can do about it. Still, 1s is fine, I don't mind it.

@dhdaines
Copy link
Collaborator

dhdaines commented Jan 5, 2024

Windows is just inherently slow at opening files and likely NRC's security stack (which probably has some hideous "antivirus" that runs on every. single. call. to. fopen.) isn't helping there. Guessing that pkg_resources is the acoustic model files that we include with readalongs.

Copy link
Collaborator

@dhdaines dhdaines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good to me, presume that it works since tests pass!

@joanise joanise merged commit 2daf991 into main Jan 5, 2024
6 checks passed
@joanise joanise deleted the dev.ci-ffmpeg branch January 5, 2024 20:04
@joanise
Copy link
Member Author

joanise commented Jan 5, 2024

Windows is just inherently slow at opening files and likely NRC's security stack (which probably has some hideous "antivirus" that runs on every. single. call. to. fopen.) isn't helping there.

Ouch, yes! Just tested on my personal machine. It's more recent by 3 years (I just bought it), but still, it runs these -h commands five times faster! Our security stack sucks. It's tempting to move my OSS work to my personal machine...

Guessing that pkg_resources is the acoustic model files that we include with readalongs.

Don't think so, that would appear in every scenario, and it's a top-level import from CI. Google tells me it's part of setuptools, maybe some things are installed differently on the CI image?

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