GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Lint library code only with `ruff check` by roryyorke · Pull Request #1118 · python-control/python-control

Conversation

@roryyorke

@roryyorke roryyorke commented Feb 2, 2025

Copy link
Copy Markdown
Contributor

Make library code ruff check clean for pyflakes ("F" code) warnings, and checks this in a Github Action.

"Library code" is all non-test code in control/, so excludes tests, examples, and benchmarks. Making all of those ruff-check-clean too will take some time, and be a big change, so it seems worth getting this in first. This also gives an opportunity for reviewing the ruff configuration, and the overall approach, e.g., disabling import checks in __init__.py.

Besides making the other parts of the code pass lint, ruff can do more, and we can look at adding more checks later.

Partially addresses gh-1101.

You can see an example of a failing Github Action ruff check here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
roryyorke added 23 commits February 2, 2025 07:09
@roryyorke
Handle non-* unused import-related messages
dfc0ead
Mostly removing imports; in some cases, placate pyflakes with fake
evaluation of not-obviously-used name.
@roryyorke
Silence ruff warnings in __init__.py
eb70132
@roryyorke
Make flatsys/__init__.py ruff-clean
c135d2f
@roryyorke
Silence ruff warnings in matlab/__init__.py
c6dbe07
@roryyorke
Turn f-strings without format-parameters into normal strings (ruff)
9427eec
@roryyorke
Fix ruff warnings in robust.py
5ba2ad5
@roryyorke
Apply ruff pyflakes rules to control library only
67fa35d
@roryyorke
Import ControlArgument in flatsys.py, with test
44db126
@roryyorke
Fix ruff "unused value" warnings
7668d2c
@roryyorke
Fixed ruff unused argument warning in acker
ae5a702
@roryyorke
Fix ruff shadowed symbol warning in xferfcn.py
f9c5b3b
@roryyorke
Fix various ruff unknown symbol warnings
71ea2d7
@roryyorke
Change _RLSortRoots in rlocus.py to placate ruff
d1ac450
@roryyorke
Remove unused import
d8b8b2d
@roryyorke
Silence ruff warning in phaseplot.py
a032506
@roryyorke
Add ruff check Github Action workflow
5421a63
@roryyorke
Update docstring_test hashes
32ba227
@roryyorke
Fix comment wording
b4776c4
@roryyorke
Remove pyflakes weirdness, use noqa instead
bd705f2
@roryyorke
Merge main into lint-lib-only
76b2a34
@roryyorke
Update dlqe, lqe hashes in docstrings_test.py
ce13465
@roryyorke
Remove import of unused ControlDimension
b333298
@roryyorke
Import missing StateSpace
18d3d59
@coveralls

coveralls commented Feb 2, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

coverage: 94.667% (+0.006%) from 94.661%
when pulling 18d3d59 on roryyorke:lint-lib-only
into d2f9a9c on python-control:main.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@roryyorke

roryyorke commented Feb 2, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

failure in "Conda-based pytest / Py3.12; conda Slycot; conda Pandas; conda CVXOPT ; QtAgg", in step Install optional dependencies. Seem to be getting these often.

possibly relevant parts there:

warning  libmamba Could not parse mod/etag header
error    libmamba Error when extracting package: Could not stat info/recipe/parent/install-libstdc++-devel.sh
libgfortran-ng-14.2.0-h69a702a_1.conda extraction failed
Found incorrect download: libgfortran-ng. Aborting
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@murrayrm

murrayrm commented Feb 2, 2025

Copy link
Copy Markdown
Member

Thanks for putting this together @roryyorke!

These changes look good to me. I'll hold on merging in case others want to take a look, but will plan on merging in the next day or two.

I'll create an issue to discuss the sporadically failing CI tests. Very annoying to have to re-run them and it seems to be increasing in frequency.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@murrayrm murrayrm mentioned this pull request Feb 2, 2025
Sporadically failing CI tests #1119
Open
@murrayrm
murrayrm merged commit 1fc2c2d into python-control:main Feb 3, 2025
@murrayrm murrayrm mentioned this pull request Feb 3, 2025
pyflakes (pylint, ruff, ....) clean-up, CI? #1101
Open
@murrayrm murrayrm linked an issue Feb 3, 2025 that may be closed by this pull request
pyflakes (pylint, ruff, ....) clean-up, CI? #1101
Open
@murrayrm murrayrm added this to the 0.10.2 milestone Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.10.2

Development

Successfully merging this pull request may close these issues.

pyflakes (pylint, ruff, ....) clean-up, CI?

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@roryyorke @coveralls @murrayrm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.