From e5320e3ccd56f6009eb4113894df033090ced87c Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 9 Aug 2023 22:56:01 +0100 Subject: [PATCH 1/6] Update README --- README.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0c51107..924dbcb 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,13 @@ An experimental implementation of a LabThings server using fastapi. This is currently an incomplete implementation of the WoT specification, and will gradually grow as required to support the OpenFlexure server. -## installation +## Installation -This is for my reference, until it's properly packaged: +You can install this repository with `pip`, either clone it and run `pip install -e .[dev]` to work on it, or just `pip install https://gitlab.com/rwb27/labthings-fastapi.git`. -``` -git clone git@github.com:rwb27/labthings-fastapi.git -cd labthings-fastapi -python --version -python -m venv .venv --prompt="LabThings-FastAPI" -source .venv/bin/activate # Windows: .venv/Scripts/activate -pip install -e . -``` +## Developer notes + +The code is linted with `ruff .`, type checked with `mypy src`, and tested with `pytest`. These all run in CI with GitHub Actions. The codebase is not even `v0.0.1` yet so it's still subject to summary rearrangement. ## Demo From 0be31846b9d34d6eb12f4f878468effda676f605 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 9 Aug 2023 22:56:18 +0100 Subject: [PATCH 2/6] check CI error --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8257d31..09dce46 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,9 @@ jobs: - name: Install Dependencies run: pip install -e .[dev] + - name: List directory + run: ls -la + - name: Lint with Ruff run: ruff --format=github check . From d66f4c6f89fbe2d93c34b20abf7703957fb33c2e Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 9 Aug 2023 22:59:35 +0100 Subject: [PATCH 3/6] Fix ruff command --- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8ea7639..44ed726 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,7 @@ jobs: run: pip install -e .[dev] - name: Lint with Ruff - run: ruff check . + run: ruff check --format=github . - name: Analyse with MyPy run: mypy src diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09dce46..e05cc75 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,11 +24,8 @@ jobs: - name: Install Dependencies run: pip install -e .[dev] - - name: List directory - run: ls -la - - name: Lint with Ruff - run: ruff --format=github check . + run: ruff check --format=github . - name: Analyse with MyPy run: mypy src From 155b6437104f8c8be20418f5266914c8c90c26fd Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 9 Aug 2023 23:02:16 +0100 Subject: [PATCH 4/6] Add devdependency for pytest-cov --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index a841c32..5db6f7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ dependencies = [ [project.optional-dependencies] dev = [ "pytest>=7.4.0, <8", + "pytest-cov", "mypy>=0.812", "ruff>=0.0.283", "types-jsonschema", From cc73f00b7c9db52b30e9ad594ccf18d645d7c472 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 9 Aug 2023 23:06:13 +0100 Subject: [PATCH 5/6] bump codecov version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e05cc75..4b29c7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: run: pytest --cov=src --cov-report=xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: file: ./coverage.xml flags: unittests From ac771e44b344839033b9daa6a55faadb1455aa13 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 9 Aug 2023 23:11:51 +0100 Subject: [PATCH 6/6] Add codecov secret --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b29c7c..023baa4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,3 +40,5 @@ jobs: flags: unittests name: codecov-umbrella-${{ matrix.python }} fail_ci_if_error: false + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}