Commit Graph

11 Commits

Author SHA1 Message Date
Oliver Smith c734b2c523
CI: add codespell
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230706211537.10438-3-ollieparanoid@postmarketos.org%3E
2023-07-13 10:07:53 +02:00
Luca Weiss 1e3eea7087
CI: enable eval-annotations for vermin
It has happened more than once that Python 3.9+ type annotation have
slipped into the code and broken earlier Python versions. Enable the
eval-annotations flag in vermin to catch that.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230625193650.528651-2-luca@z3ntu.xyz%3E
2023-07-05 10:02:28 +02: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
Oliver Smith 3113f354b8
Bump min. required Python version to 3.7
Increase it as 3.6 is EOL.

Related: https://en.wikipedia.org/wiki/History_of_Python#Table_of_versions
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230326164931.2390-2-ollieparanoid@postmarketos.org%3E
2023-04-04 09:13:09 +02:00
Oliver Smith f296dc62e5
ci/pytest.sh: check if pmaports dir is clean
Verify that the pmaports dir is clean before starting the testsuite, as
some tests will fail if it is not. It's annoying when this is the reason
that you have to restart the testsuite run after it already spent some
time, so rather check for it beforehand.

Ideally the testsuite wouldn't depend on the state of pmaports, see
issue 2105 for that.

Reviewed-by: Clayton Craft <clayton@craftyguy.net>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230226184731.6989-1-ollieparanoid@postmarketos.org%3E
2023-02-27 08:35:20 +01:00
Oliver Smith aeeeb826fb
CI: fix typo in pmOS CI url 2022-11-20 16:38:59 +01:00
Oliver Smith 57359bfd51
CI: flake8: remove ignore for W605
This was for 'invalid escape sequence' (even though the comment has W604
instead of W605). After removing it, flake8 runs through fine. We
probably fixed whatever invalid escape squence we had earlier while
doing f-string related refactoring.

Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20221028074119.3309-1-ollieparanoid@postmarketos.org%3E
2022-11-02 21:09:27 +01:00
Oliver Smith 81f0d669c8
CI: add note about running scripts locally 2022-10-25 20:31:19 +02:00
Oliver Smith 4b8a0db5bc
CI: replace gitlab CI with sourcehut CI
Replace .gitlab-ci.yml with a minimal .build.yml that runs a script in
the .ci dir for each task. Each of these scripts runs as root first,
installs dependencies, and then drops rights to the testuser and runs
the actual test. I went with this design, so we can add a
'pmbootstrap ci' command in following patches that run these in a
pmbootstrap chroot (see pmaports#2169).

Looking at flake8, we currently ignore W504 and W604. Would be nice to
fix these instead, but let's do that in another patch.

I've added a minver package to Alpine, so we don't need to install it
form pip anymore. Use minver's new --lint argument to simplify the
script, and as recommended by minver itself, use --no-parse-comments as
speed optimization since we don't have minver specific comments.

Using doas instead of sudo in build.yml would be nice, but this doesn't
work out of the box. Can be changed in the future.

Add a note to the pytest script, that 'pmbootstrap log' can be used to
follow the log while tests are running.
2022-10-25 20:31:19 +02:00
Oliver Smith 6c2b72ca13
CI: .gitlab/vermin.sh -> .ci/vermin.sh (MR 2080) 2021-07-04 22:51:53 +02:00
Oliver Smith d38bd6be2b
CI: drop support for cached venv + ci runner (MR 2080)
CI started failing with:
/builds/ollieparanoid/pmbootstrap/venv/bin/python3: No module named pytest

I've briefly tried to fix this with the existing scripts. However,
instead of investing more time into that, do the long overdue
refactoring of the scripts that involve dropping the venv logic and
support for a custon gitlab-ci-runner using some python docker image as
base. This configuration hasn't been used for a long time and is
probably broken anyway.

Refactor the logic to skip the qemu test case in gitlab CI by using
pytest markers. The new script is now similar to bpo's .ci/pytest.py.
2021-07-04 22:51:53 +02:00