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

Add ubuntu-images extension #46

Merged
merged 12 commits into from
Mar 11, 2025
Merged

Conversation

waveform80
Copy link
Member

Split out from the ubuntu-boards-documentation. Tests included as doctest. To run, from a venv with the extensions installed:

python3 -m doctest canonical-sphinx-extensions/ubuntu-images/__init__.py

Being doctest, no output and zero exit code means tests have passed. If you have coverage installed:

coverage run -m doctest canonical-sphinx-extensions/ubuntu-image/__init__.py
coverage report

P.S. Please let me split up the README on the front of the repo :)

And is too dumb to deal with data associated with a class being closely
spaced next to the class
pylint picked this up ... flake8 didn't
@waveform80
Copy link
Member Author

flake8's still complaining about line-lengths, but most of these are either:

  • difficult to correct (e.g. doctest expected output which includes intentional whitespace and formatting)
  • simple to correct but doing so would obscure the intention (the test case generating the release file)
  • not worth correcting (e.g. one or two characters over and splitting the line would make it less readable)

Personally I'd recommend just disabling the E501 test (or weakening it considerably). Actually I'd recommend switching the test to pylint (which tends to pick up more useful stuff and has much more descriptive and flexible disable comments), but that would probably be more painful.

waveform80 and others added 8 commits November 5, 2024 12:32
Always represent the range (even a degenerate singleton range) as a
tuple instead of having branches for singletons and multi-item ranges
Some complaints about unused variable names (personally I think it's
better to indicate what elements we're decoding but ignored, but
whatever), and "f" for a float is fine, but "n" for a number is not.
Apparently.
To be clear: this doesn't improve quality. In several cases it makes the
code objectively worse, and weakens one test to the point it's no longer
testing all it should. But "computer says no" otherwise...
We don't actually use it here (unlike in the rpi-imager refresh script
that this class was copied from), and this brings us back within
pylint's recommended maximum number of local vars in get_images
handle_data may be called multiple times for CDATA within an element.
Admittedly this is incredibly unlikely for the input, but it's still the
correct thing to do here.
@SecondSkoll SecondSkoll merged commit 8a760b0 into canonical:main Mar 11, 2025
1 check passed
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