]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
CI: add black to CI and document editable installs now need --no-use-pep517 584/head
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Fri, 18 Dec 2020 15:25:31 +0000 (16:25 +0100)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Sat, 19 Dec 2020 15:49:35 +0000 (16:49 +0100)
.github/workflows/ci-unit-test.yml
README.md

index 475ec38f603656e9babe1ae9935a1b45394e6b57..5d19e36f70d56c084401107b2c47e03d03694ac8 100644 (file)
@@ -15,7 +15,10 @@ jobs:
     - uses: actions/checkout@v2
 
     - name: Install
-      run: python3 -m pip install pytest mypy
+      run: python3 -m pip install pytest mypy black
+
+    - name: Check formatting
+      run: python3 -m black --check mkosi/ tests/
 
     - name: Type Checking
       run: python3 -m mypy mkosi
@@ -49,13 +52,13 @@ jobs:
 
     - name: Test editable user installation
       run: |
-        python3 -m pip install --user --editable .
+        python3 -m pip install --user --no-use-pep517 --editable .
         $HOME/.local/bin/mkosi -h
         python3 -m pip uninstall --yes mkosi
 
     - name: Test editable user installation (sudo call)
       run: |
-        python3 -m pip install --user --editable .
+        python3 -m pip install --user --no-use-pep517 --editable .
         sudo $HOME/.local/bin/mkosi -h
         python3 -m pip uninstall --yes mkosi
 
index 38c68cd8d8187486c392a4a9cf80b80ae14a4255..29a59b4d587c5aabc8ed2b90f0073abbf114f7ed 100644 (file)
--- a/README.md
+++ b/README.md
@@ -23,14 +23,16 @@ If you want to hack on mkosi do
 # clone either this repository or your fork of it
 git clone https://github.com/systemd/mkosi/
 cd mkosi
-python3 -m pip install --user --editable .
+python3 -m pip install --user --no-use-pep517 --editable .
 ```
 This will install mkosi in editable mode to `~/.local/bin/mkosi`, allowing you
 to use your own changes right away.
 
-For development you optionally also need [mypy](https://github.com/python/mypy)
-and [pytest](https://github.com/pytest-dev/pytest). We check tests and typing in
-CI (see `.github/workflows`), but you can run the tests locally as well.
+For development you also need [mypy](https://github.com/python/mypy), for type
+checking, [pytest](https://github.com/pytest-dev/pytest), to run tests, and
+[black](https://github.com/psf/black), for code formatting. We check tests,
+typing and code formatting in CI (see `.github/workflows`), but you can run the
+tests locally as well.
 
 ## zipapp