Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mypy changes, CI and pre-commit hooks for v2.3.0 #53

Merged
merged 85 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
9a53c3c
Add `config.ini` and `.env` files to the `datas` variable of `audiote…
HenestrosaDev Jul 26, 2024
6aee0ef
Add missing documentation about Whisper API and the`.env` file to the…
HenestrosaDev Jul 26, 2024
928dd88
Add missing __init__ files
HenestrosaDev Jul 28, 2024
2210a02
Add the `mypy` package to the `requirements-dev.txt` file
HenestrosaDev Jul 28, 2024
d843b85
Add the `pyproject.toml` file to disable the `import-untyped` error d…
HenestrosaDev Jul 28, 2024
eeca1e3
Add typing and documentation to `find_key_by_value`
HenestrosaDev Jul 28, 2024
d26e988
Add missing return type annotation to `save_audio_data`
HenestrosaDev Jul 28, 2024
fd15f00
Parse the return type of the `value_type` methods to string and add m…
HenestrosaDev Jul 28, 2024
ae0f876
Fix `No overload variant of get of dict matches argument types Key, N…
HenestrosaDev Jul 28, 2024
1b56eb7
Add missing type parameters for generic type `tuple`
HenestrosaDev Jul 28, 2024
f6ec434
Add missing return type annotations to `CTkInputDialog`
HenestrosaDev Jul 28, 2024
98c3639
Update `CTkScrollableDropdown`
HenestrosaDev Jul 28, 2024
e4359fd
Ignore mypy errors from the `ctk_scrollable_dropdown` module
HenestrosaDev Jul 28, 2024
04e34a7
Change the `section` and `key` parameter types of the `_on_config_cha…
HenestrosaDev Jul 28, 2024
109abcb
Fix mypy errors in `WhisperXHandler`
HenestrosaDev Jul 28, 2024
b633b0a
Add missing return statement to the `download_audio_from_video` metho…
HenestrosaDev Jul 28, 2024
f9b12d4
Add missing optional type hint to `Transcription`
HenestrosaDev Jul 28, 2024
02403e4
Add missing type annotation for the `transcription_func` parameter of…
HenestrosaDev Jul 28, 2024
8f54582
Add missing return type annotation to the `load_audio_file` method of…
HenestrosaDev Jul 28, 2024
09b2fda
Add missing return type annotation to the `load_audio_file` method of…
HenestrosaDev Jul 28, 2024
cc2ae98
Add missing typing to the `process_audio_chunks` method of `AudioHand…
HenestrosaDev Jul 28, 2024
04fb557
Add missing typing to the `cleanup` method of `AudioHandler`
HenestrosaDev Jul 28, 2024
88243b6
Add missing typing to the `load_audio_file` method of `AudioHandler`
HenestrosaDev Jul 28, 2024
92eb02f
Explicitly parse the return value of `recognize_google` to string in …
HenestrosaDev Jul 29, 2024
ae96837
Add type annotation to the `MainController` constructor
HenestrosaDev Jul 29, 2024
7ea2248
Add missing return type annotation to the methods of `MainController`
HenestrosaDev Jul 29, 2024
2f97c65
Add missing documentation and return type annotations to the methods…
HenestrosaDev Jul 29, 2024
47c7b36
Fix `Module views.custom_widgets.ctk_scrollable_dropdown does not exp…
HenestrosaDev Jul 29, 2024
e1c4b96
Silence `Class cannot subclass CTk (has type Any)` error because `cus…
HenestrosaDev Jul 29, 2024
1bace80
Add missing return type annotation to the `__init__` of `App`
HenestrosaDev Jul 29, 2024
6871681
Ensure that `self.transcription.output_file_types` is not empty or No…
HenestrosaDev Jul 29, 2024
f405323
Ensure that `self.transcription.text` is not empty or None in the `sa…
HenestrosaDev Jul 29, 2024
bb8271f
Ensure that `self.transcription.audio_source_path` is not empty or No…
HenestrosaDev Jul 29, 2024
c041ce4
Pass the YouTube video URL as a parameter to `_prepare_for_youtube_vi…
HenestrosaDev Jul 29, 2024
7415030
Ensure that `self.transcription.output_file_types` is not empty or No…
HenestrosaDev Jul 29, 2024
1b8be92
Modify logic to initialize `is_one_output_file_type` in the `_get_sav…
HenestrosaDev Jul 29, 2024
c39dee2
Ignore `Class cannot subclass CTkFrame (has type Any)` error
HenestrosaDev Jul 29, 2024
ae1f96e
Add `Any` type to the `parent` parameter of the constructor of `MainW…
HenestrosaDev Jul 29, 2024
5dbc05c
Add type annotation for `self._controller` of `MainWindow`
HenestrosaDev Jul 29, 2024
2a34e29
Remove type annotation on `view` to avoid circular imports
HenestrosaDev Jul 29, 2024
c7d4ed4
Move `_get_transcription_properties` after widgets initialization
HenestrosaDev Jul 29, 2024
0775c32
Change the parameter type annotations of `section` and `key` of `_se…
HenestrosaDev Jul 29, 2024
36efb12
Use `Callable` from `typing` instead of `callable` for type annotatio…
HenestrosaDev Jul 29, 2024
212692d
Add `_on_highlight_words_change` to fix the `Cannot determine type of…
HenestrosaDev Jul 29, 2024
7b2df17
Use the `args` tuple to get the value of the option menus inside the …
HenestrosaDev Jul 29, 2024
8a958a6
Add `_on_use_cpu_change` to fix the `Cannot determine type of chk_use…
HenestrosaDev Jul 29, 2024
4baee99
Add `_on_overwrite_files_change` to fix the `Cannot determine type of…
HenestrosaDev Jul 29, 2024
4022691
Add type annotation to the `text` parameter of the `display_method` o…
HenestrosaDev Jul 29, 2024
ee68f13
Ignore `Missing type parameters for generic type tuple` for `*unused`
HenestrosaDev Jul 29, 2024
9e32559
Assert that `self._controller` has a value when accessing its methods…
HenestrosaDev Jul 29, 2024
4dee0b4
Ensure that `transcription.language_code` has a value in the `transcr…
HenestrosaDev Jul 29, 2024
d43c4aa
Type annotate `response_format` as `Literal[json, text, srt, verbose_…
HenestrosaDev Jul 29, 2024
6ba788b
Remove optional return type annotation from the method `value_type` o…
HenestrosaDev Jul 30, 2024
e54587c
Change `TEXT` to `TXT` in `WhisperXFileFormats`
HenestrosaDev Jul 30, 2024
f8cbb89
Ignore `Unsupported target for indexed assignment` for `self._whisper…
HenestrosaDev Jul 30, 2024
8952366
Add type to `_whisperx_result`
HenestrosaDev Jul 30, 2024
a116813
Remove unnecessary None check in the `save_transcription` method of `…
HenestrosaDev Jul 30, 2024
bba15fd
Check that `transcription.output_file_types` has a value in the `tran…
HenestrosaDev Jul 30, 2024
dd55ac7
Format parameters of the `transcribe_file` method of `WhisperXHandler`
HenestrosaDev Jul 30, 2024
84d7ff7
Add `list` converter to `ConfigParser`
HenestrosaDev Jul 30, 2024
604cece
Change the return type annotation of `read_config` to `ConfigParser` …
HenestrosaDev Jul 30, 2024
5905f63
Add missing documentation to `get_value` and `modify_value`
HenestrosaDev Jul 30, 2024
55357bf
Parse `section_name` and `key_name` to prevent mypy type error
HenestrosaDev Jul 30, 2024
7fbf1e5
Ignore the type of the results of the `get_value` method of `ConfigMa…
HenestrosaDev Jul 30, 2024
a1240c2
Add `TimestampGranularitiesType`
HenestrosaDev Jul 30, 2024
e982a43
Modify the logic of `_on_output_file_types_change` to match `_on_time…
HenestrosaDev Jul 30, 2024
cd125bf
Only pass `timestamp_granularities` as a parameter to `client.audio.t…
HenestrosaDev Jul 30, 2024
5ad2e92
Add missing `OutputFileTypes` to the `config_whisper_x` file
HenestrosaDev Jul 30, 2024
601d096
Merge pull request #50 from HenestrosaDev/mypy
HenestrosaDev Jul 30, 2024
678c194
Add `pre-commit` package to `requirements-dev.txt`
HenestrosaDev Jul 30, 2024
9f17db2
Add `.pre-commit-config.yaml` file
HenestrosaDev Jul 30, 2024
9e29bee
Add the pre-commit.ci status badge to the `README` and mark the pre-c…
HenestrosaDev Jul 30, 2024
c5a9852
Add steps to the "Setting Up the Project Locally" section to set up t…
HenestrosaDev Jul 30, 2024
f9152f9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2024
279dbee
Add `additional_dependencies` to the `mypy` hook to avoid `import-not…
HenestrosaDev Jul 30, 2024
e838b96
Merge branch 'pre-commit-hooks' of github.com:HenestrosaDev/audiotext…
HenestrosaDev Jul 30, 2024
b5cdc34
Run `mypy` from local installation instead of from the remote repo
HenestrosaDev Jul 30, 2024
e068ef9
Remove the pre-commit.ci status badge from the `README`
HenestrosaDev Jul 30, 2024
fccdfab
Merge pull request #51 from HenestrosaDev/pre-commit-hooks
HenestrosaDev Jul 30, 2024
991ca5c
Add `Code Quality` workflow
HenestrosaDev Jul 30, 2024
6744818
Add "Set up a CI pipeline to apply the pre-commit hooks" to the Roadmap
HenestrosaDev Jul 30, 2024
a371711
Fix value of `python-version` in `code-quality.yml`
HenestrosaDev Jul 30, 2024
b1ac94f
Change encoding of `requirements.txt` to UTF-8 without BOM
HenestrosaDev Jul 30, 2024
4fd00b1
Add step in `code-quality.yml` to install PortAudio, necessary for Py…
HenestrosaDev Jul 30, 2024
a110963
Merge pull request #52 from HenestrosaDev/ci
HenestrosaDev Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GOOGLE_API_KEY=
OPENAI_API_KEY=
OPENAI_API_KEY=
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ This section guides you through submitting an enhancement suggestion for audiote
<!-- omit in toc -->
#### How Do I Submit a Good Enhancement Suggestion?

Enhancement suggestions are tracked as [GitHub issues](https://github.com/HenestrosaConH/audiotext/issues). This is the [issue template](https://github.com/HenestrosaConH/audiotext/tree/main/.github/workflows/ISSUE_TEMPLATE.md).
Enhancement suggestions are tracked as [GitHub issues](https://github.com/HenestrosaConH/audiotext/issues). This is the [issue template](https://github.com/HenestrosaConH/audiotext/tree/main/.github/workflows/ISSUE_TEMPLATE.md).

Don't forget to follow these principles:
Don't forget to follow these principles:

- Use a **clear and descriptive title** for the issue to identify the suggestion.
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ko_fi: henestrosadev
ko_fi: henestrosadev
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Bug Report
name: Bug Report
about: Create a report to help us improve
title: "[Bug] "
labels: ''
Expand Down Expand Up @@ -34,7 +34,7 @@ System information

- **System**: (For example, "Ubuntu 20.04 LTS x64", "Windows 11 x64", or "macOS Monterey")
- **System language**: (Please, indicate the region as well)
- **Audiotext version**:
- **Audiotext version**:


Code To Duplicate
Expand All @@ -55,4 +55,4 @@ Screenshot, Sketch, or Drawing

Optional. Feel free to provide an image if you think it adds more useful information to the issue.

You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Overview
In this section, provide a brief overview of the enhancement you are proposing.


Motivation
Motivation
------------------

In this section, describe the motivation behind the enhancement. What problem are you trying to solve? How will this enhancement benefit users of the project?
Expand All @@ -37,4 +37,4 @@ Next Steps

In this section, outline the next steps for implementing the enhancement. This could include assigning the enhancement to a specific team member, setting a timeline for implementation, or opening a pull request for review.

An enhancement template provides a clear and structured approach for proposing enhancements to a project, which can help ensure that proposals are well-thought-out and considered by the project's maintainers.
An enhancement template provides a clear and structured approach for proposing enhancements to a project, which can help ensure that proposals are well-thought-out and considered by the project's maintainers.
3 changes: 0 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ Put an x in the boxes that apply.

## Additional Notes
Please provide any additional information or context about your changes here.



34 changes: 34 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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 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
pip install -r requirements.txt -r requirements-dev.txt
- name: Run pre-commit
run: |
pre-commit run --all-files --show-diff-on-failure
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

audio-chunks/
audio-chunks/
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: debug-statements
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: no-commit-to-branch
args: [ --branch, main ]
- id: trailing-whitespace
- repo: local
hooks:
- id: mypy-local
name: Run mypy with all dev dependencies present
language: system
types:
- python
entry: mypy --strict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
10 changes: 5 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading
Loading