1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-12 19:09:56 +03:00
Commit graph

23 commits

Author SHA1 Message Date
Oliver Smith
3eff3ff39e
pyproject.toml: fix tests getting installed
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
2025-02-27 01:07:19 +01:00
Stefan Hansson
5f8d0141d7
pyproject.toml: Remove ignore for F401 in __init__.py files (MR 2545)
This is no longer necessary to pass checks, and it allows further unused
import analysis.
2025-02-23 11:40:44 +01:00
Newbyte
131b9d2762
pyproject.toml: Enable all N checks (MR 2537) 2025-02-02 22:48:51 +01:00
Newbyte
2bde70d5da
pyproject.toml: Enable all PIE checks (MR 2537) 2025-02-02 22:48:51 +01:00
Newbyte
c3b7a5f39e
pyproject.toml: Enable most RUF checks (MR 2525)
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.
2025-01-15 22:35:02 +01:00
Newbyte
c401555fb8
pyproject.toml: Enable Ruff preview (MR 2516)
We need this to check for copyright headers being absent (CPY001). In
the future, once that rule makes it out of preview, we can revert this
commit.
2025-01-02 16:45:03 +01:00
Newbyte
426dbec794
pyproject.toml: Add CPY001 to Ruff linting (MR 2516)
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
2025-01-02 16:45:03 +01:00
Newbyte
a828303398
pyproject.toml: Set disallow_untyped_calls = true (MR 2514)
We pass this check now, might as well.
2024-12-20 16:45:49 +01:00
Newbyte
d81de1f61c
pyproject.toml: Set disallow_untyped_defs = true (MR 2514)
Woo-hoo!
2024-12-20 16:29:44 +01:00
Newbyte
511d490015
pyproject.toml: Set disallow_untyped_decorators = true (MR 2464)
We pass this too, so might as well ensure we don't regress.
2024-10-30 12:39:45 +01:00
Newbyte
f24b6e7c9b
pyproject.toml: Set disallow_incomplete_defs = true (MR 2464)
We pass this check now.
2024-10-30 12:39:45 +01:00
Newbyte
f65eb27453
pyproject.toml: Add tool.mypy section (MR 2464)
And remove --check-untyped-defs from mypy.sh script to avoid
duplication.
2024-10-29 12:53:00 +01:00
Oliver Smith
9fd45fb334
Bump minimum python3 version to 3.10 (MR 2357) 2024-07-16 00:26:35 +02:00
Hugo Osvaldo Barrera
61cb4f4abb
Enable the UP family of lints (MR 2327)
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.
2024-06-23 19:13:57 +02:00
Hugo Osvaldo Barrera
fa2a7c502d
Remove exception for lint (MR 2328)
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.
2024-06-23 17:44:24 +02:00
Hugo Osvaldo Barrera
8398bc1218
Do not use bare except (MR 2325)
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.
2024-06-23 15:40:13 +02:00
Hugo Osvaldo Barrera
5a8e2c6cad
Converge supported Python onto 3.9 (MR 2326)
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>
2024-06-23 15:37:19 +02:00
Caleb Connolly
139c205424
ruff: enable docstring format and set target version (MR 2252)
Allow automatic formatting of docstrings.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:41 +02:00
Caleb Connolly
ff86792fb6
test: add pytest and test config load/migrate (MR 2252)
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>
2024-06-23 12:38:40 +02:00
Robert Eckelmann
e7c8b2d5dc
pyproject.toml: add docs to the parts to be excluded (MR 2312)
as reported in #2355 pmmbootstrap wheel installs files to /usr/lib/python3.12/site-packages/docs
2024-05-18 18:21:04 +02:00
Newbyte
85f777073e
pyproject.toml: Fix deprecation warning (MR 2262)
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'
2024-03-10 16:18:23 +00:00
Pablo Correa Gómez
d895f4a465
Migrate from setup.py to pyproject.toml (MR 2265)
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
2024-02-29 00:47:33 +01:00
Hugo Osvaldo Barrera
27618d5ffd
Use ruff for linting
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
2023-06-04 10:56:22 +02:00