iterative / dvclive

📈 Log and track ML metrics, parameters, models with Git and/or DVC
https://dvc.org/doc/dvclive
Apache License 2.0
161 stars 33 forks source link

revert dropping of noqa #784

Closed dberenbaum closed 5 months ago

dberenbaum commented 5 months ago

Missed this failure in #783.

AlexandreKempf commented 5 months ago

My editor with ruff installed from the pyproject.toml and the pre-commit didn't complain. Are you sure you don't have an outdated version of ruff? If you're sure then I don't know why it is a problem on your side and not mine. It is curious.

If you want to merge I have nothing against it.

codecov-commenter commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (aba8807) 95.55% compared to head (9409f9f) 95.55%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #784 +/- ## ======================================= Coverage 95.55% 95.55% ======================================= Files 55 55 Lines 3532 3532 Branches 314 314 ======================================= Hits 3375 3375 Misses 110 110 Partials 47 47 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dberenbaum commented 5 months ago

The failure comes from CI, not local, so we would need to check the ruff version there.

dberenbaum commented 5 months ago

The version in the pre-commit does fail:

https://github.com/iterative/dvclive/blob/b0a88a76d3ecb254a0f332aff7f5af9a29c5376d/.pre-commit-config.yaml#L31-L36

$ pre-commit run --show-diff-on-failure --color=always --all-files
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check docstring is first.................................................Passed
check that executables have shebangs.................(no files to check)Skipped
check json...............................................................Passed
check for merge conflicts................................................Passed
check toml...............................................................Passed
check yaml...............................................................Passed
debug statements (python)................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
sort simple yaml files...............................(no files to check)Skipped
trim trailing whitespace.................................................Passed
codespell................................................................Passed
ruff.....................................................................Failed
- hook id: ruff
- exit code: 1

src/dvclive/live.py:341:9: A003 Class attribute `dir` is shadowing a Python builtin
Found 1 error.

ruff-format..............................................................Passed
Pretty format TOML.......................................................Passed
Pretty format YAML.......................................................Passed
dberenbaum commented 5 months ago

Although the version from the py-template is 0.1.13 which reports the opposite:

$ ruff check src/dvclive/live.py
src/dvclive/live.py:341:28: RUF100 [*] Unused `noqa` directive (unused: `A003`)
Found 1 error.

So maybe we are better off updating the ruff version?

AlexandreKempf commented 5 months ago

https://github.com/iterative/dvclive/pull/786