From 1459710509f92983b8ce42c410354e1b75526d96 Mon Sep 17 00:00:00 2001 From: Joerg Behrmann Date: Fri, 18 Dec 2020 16:25:31 +0100 Subject: [PATCH] CI: add black to CI and document editable installs now need --no-use-pep517 --- .github/workflows/ci-unit-test.yml | 9 ++++++--- README.md | 10 ++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-unit-test.yml b/.github/workflows/ci-unit-test.yml index 475ec38f6..5d19e36f7 100644 --- a/.github/workflows/ci-unit-test.yml +++ b/.github/workflows/ci-unit-test.yml @@ -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 diff --git a/README.md b/README.md index 38c68cd8d..29a59b4d5 100644 --- 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 -- 2.47.2