From 991ca5c29e31beb52e3ee4aebad1a92ade1542ed Mon Sep 17 00:00:00 2001 From: HenestrosaDev Date: Tue, 30 Jul 2024 19:55:28 +0200 Subject: [PATCH 1/5] Add `Code Quality` workflow --- .github/workflows/code-quality.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/code-quality.yml diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 0000000..9788b6e --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,30 @@ +name: Code Quality + +on: + pull_request: + branches: + - "*" + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.10] + steps: + - uses: actions/checkout@master + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt -r requirements-dev.txt + - name: Run pre-commit + run: | + pre-commit run --all-files --show-diff-on-failure From 6744818d0827ec7d62e11b76631feeef5d3c9a95 Mon Sep 17 00:00:00 2001 From: HenestrosaDev Date: Tue, 30 Jul 2024 19:56:25 +0200 Subject: [PATCH 2/5] Add "Set up a CI pipeline to apply the pre-commit hooks" to the Roadmap --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2a55242..37fd264 100644 --- a/README.md +++ b/README.md @@ -959,6 +959,7 @@ If you are using an API key that was created before you funded your account for - [x] Add `appearance_mode` to `config.ini`. - [x] Add support for **Whisper's API** ([#42](https://github.com/HenestrosaDev/audiotext/discussions/42)). - [x] Add pre-commit configuration for using `ruff` and `mypy`. +- [x] Set up a CI pipeline to apply the pre-commit hooks. - [ ] Change the `Generate transcription` button to `Cancel transcription` when a transcription is in progress. - [ ] Generate executables for macOS and Linux. - [ ] Add tests. From a3717116d2a6cbad4fcba15e0cb9e84c6db1ab40 Mon Sep 17 00:00:00 2001 From: HenestrosaDev Date: Tue, 30 Jul 2024 19:58:25 +0200 Subject: [PATCH 3/5] Fix value of `python-version` in `code-quality.yml` --- .github/workflows/code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 9788b6e..b3fb77d 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.10] + python-version: ["3.10"] steps: - uses: actions/checkout@master - name: Set up Python ${{ matrix.python-version }} From b1ac94f66f3f6e8429033f0cee33ed6725d806dd Mon Sep 17 00:00:00 2001 From: HenestrosaDev Date: Tue, 30 Jul 2024 20:04:40 +0200 Subject: [PATCH 4/5] Change encoding of `requirements.txt` to UTF-8 without BOM --- requirements.txt | Bin 539 -> 269 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/requirements.txt b/requirements.txt index df2a01735c314c4790ccff80c8fba9a205098ae3..37fd2f2ee2a276c17d94086d5a6f9d3ae7df3321 100644 GIT binary patch literal 269 zcmYk0OK!t33`F-jMK565vfvagz)Q3za3nS&>WG3Y`E&ayN*7(e0cRe&j*gt>j)SA4 zD`|Q2Imh+0@15*nk=a2!vn1<5(yib9(%Yg(t&}ZmmV5r?kSQTfFoITh*_h&qs9^x3 zBvP39N#+8BisxJ$3*zuRHkDnuHkxX;dc1_rNv5#97Ft-Y^uq_@1*$`RMjOM#udhH$kOjK}?RlH1tzo#*Sf$%wWKmJ$)PVMZ zyKYi;wG|ui=L^i<_BA$YOI@cNRv-B~vdli#Iy0@3^n%l8Fq~oPBhyo)Omw}~Bdj%Q z8+3PQI$0ML6&3gF1@4~A5PZ8i@jQ<+^0%}9IiB3%!eh#Ohn|xk$z$9z98S5N!c$x- z`}xjkJpqisHTV8ZO}xn&+n`ogNQ|sKG7q|Dc~nPuEoaSBaT?{^P!X+dVA{Ur^v_Vz HAd!9nVpCU< From 4fd00b13108a1ad876e8bf666011bd3acd058c78 Mon Sep 17 00:00:00 2001 From: HenestrosaDev Date: Tue, 30 Jul 2024 20:12:43 +0200 Subject: [PATCH 5/5] Add step in `code-quality.yml` to install PortAudio, necessary for PyAudio installation --- .github/workflows/code-quality.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index b3fb77d..4afd0a1 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -21,6 +21,10 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'pip' + - name: Install PortAudio to install PyAudio + run: | + sudo apt-get update + sudo apt-get install python3-pyaudio portaudio19-dev python3-dev - name: Install dependencies run: | python -m pip install --upgrade pip