Instead of automatic python package discovery that for some reason still
picks up the test module even though it should be excluded, specify the
"pmb" module manually to be installed.
Follow-up to MR 2551.
Fixes: issue 2541
These seem pretty useful to me. I ignored RUF021 since it seems a bit
silly to me and I didn't see the point in fixing the one violation of it
that we have in the code, but if you're reading this in the future and
want to do so be my guest, I don't really care either way.
This lints copyright headers to ensure we don't forget them.
Unfortunately, it is only available in Ruff preview right now, so the
following commit will enable that for the Ruff CI check. However, this
could be reverted in the future once this check makes it into Ruff "not
preview".
Closes https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2526
These are based on the originally from pyupgrade. They replace older
syntax with newer (and more concise) syntax. Some of the replaced syntax
is deprecated.
There are no violations of this lint any more. This lint only checks
that an import is the beginning of a block; it will not be a problem if
a test needs to include an import.
A bare except catches things like ctrl+c (KeyboardInterrupt). If don't
want to catch this exception. Remove the bare except and restore the
default lint.
Python 3.9 was required in pmb/__init__.py already, but some references
still said 3.8 and 3.7.
Co-Developed-By: Oliver Smith <ollieparanoid@postmarketos.org>
re-introduce pytest, add a conftest.py with some useful fixtures and
basic tests for config loading.
This just checks that we can load the config and migrate it from the old
2.3.x format to the new 3.0 format with the new mirrors section.
Testing anything that requires args or Context should probably wait
until we can properly model state (since global state like in
get_context() really doesn't jive with pytest).
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Fixes this warning:
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
- 'ignore' -> 'lint.ignore'
In the process, drop the list of required python packages. This is
only needed for pip, as pmbootstrap checks by itself. This way we
avoid duplicating the minimum required version.
We also don't install the helpers anymore, as modern tooling does not
support installing things outside the python package dir
Use ruff instead of flake8. Aside from being substantially faster, ruff
includes a lot of flake's plug-ins built-in, some of which may be useful
to enable as a follow-up.
Also move the relevant configuration out of the script in .ci/ and into
the project-wide settings. A side effect of this is that IDEs should
detect these settings, and ignore the same rules as CI, avoiding false
positives while developing locally.
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230529203448.18656-1-hugo@whynothugo.nl%3E