Skip to content

Feature request: pytest-pylyzer #84

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

Open
nils-werner opened this issue Apr 18, 2024 · 2 comments
Open

Feature request: pytest-pylyzer #84

nils-werner opened this issue Apr 18, 2024 · 2 comments
Labels

Comments

@nils-werner
Copy link

Hey, congratulations on this really impressive and interesting project. I haven't used it yet, but I'll start playing around with it in the next few weeks.

I've noticed one thing that would be nice to have: a pytest plugin, so that I can integrate pylyzer into my test pipeline and make sure I never miss to run it. :-)

Thanks!

Copy link

github-actions bot commented Feb 8, 2025

This issue is stale because it has been open for 60 days with no activity.

@github-actions github-actions bot added the stale label Feb 8, 2025
@LoicRiegel
Copy link
Contributor

Hi @nils-werner , I also thought that it was a good idea, so I tried to do it. I've published the first version here: https://pypi.org/project/pytest-pylyzer/. This package is inspired a lot by pytest-ruff.

It's the first time I'm publishing a package, so I'm open for feedback. Tell me what you think if you can try it out.

One thing I already noticed is that is it's slow. On my 5 year-old laptop, it took 35s to run pylyzer against 55 files... not great. I tried to do some benchmarking, tried to compare it with other tools like pytest-ruff for instance, but I don't know if there is an explanation other than the fact that running ruff on a single file takes way less time than pylyzer.

> hyperfine "pylyzer tmp/bad.py" "ruff check tmp/bad.py" -i --runs 30 --warmup 3
Benchmark 1: pylyzer tmp/bad.py
  Time (mean ± σ):     426.6 ms ±  35.6 ms    [User: 70.1 ms, System: 19.6 ms]
  Range (min … max):   410.1 ms … 587.6 ms    30 runs

Benchmark 2: ruff check tmp/bad.py
  Time (mean ± σ):      50.0 ms ±  18.3 ms    [User: 4.4 ms, System: 5.9 ms]
  Range (min … max):    35.9 ms …  95.5 ms    30 runs

Summary
  ruff check tmp/bad.py ran
    8.54 ± 3.21 times faster than pylyzer tmp/bad.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants