-
Notifications
You must be signed in to change notification settings - Fork 815
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
feat(code quality): add black and ruff #56
base: main
Are you sure you want to change the base?
Changes from 4 commits
0c5be21
6bf88b5
fff9765
eb9d6ac
36162bd
4a27ea1
eadc4ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
__pycache__/ | ||
*.wav | ||
keys.py | ||
.venv/ | ||
.venv/ | ||
.DS_Store | ||
ecout_env |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
lint: | ||
@echo | ||
ruff . | ||
@echo | ||
black --check --diff --color . | ||
@echo | ||
pip-audit | ||
|
||
format: | ||
ruff --silent --exit-zero --fix . | ||
black . | ||
|
||
precommit: | ||
make lint | ||
make format | ||
|
||
venv: | ||
python3 -m venv ecout_env | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. python or python3? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think python3 is preferred since we are working with Python 3.x.x There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could somehow use either? For me I don't have python3 alias only python in my PATH. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I can change it to python instead of python3. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
||
install: | ||
pip install -r requirements.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are the streamlined installation changes, let me know if it is necessary to split the PR. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ Ecoute is a live transcription tool that provides real-time transcripts for both | |
|
||
## 📖 Demo | ||
|
||
https://github.com/SevaSk/ecoute/assets/50382291/8ac48927-8a26-49fd-80e9-48f980986208 | ||
<https://github.com/SevaSk/ecoute/assets/50382291/8ac48927-8a26-49fd-80e9-48f980986208> | ||
|
||
Ecoute is designed to help users in their conversations by providing live transcriptions and generating contextually relevant responses. By leveraging the power of OpenAI's GPT-3.5, Ecoute aims to make communication more efficient and enjoyable. | ||
|
||
|
@@ -18,18 +18,22 @@ Follow these steps to set up and run Ecoute on your local machine. | |
- Python >=3.8.0 | ||
- An OpenAI API key | ||
- Windows OS (Not tested on others) | ||
- FFmpeg | ||
- FFmpeg | ||
|
||
If FFmpeg is not installed in your system, you can follow the steps below to install it. | ||
|
||
First, you need to install Chocolatey, a package manager for Windows. Open your PowerShell as Administrator and run the following command: | ||
|
||
``` | ||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | ||
``` | ||
|
||
Once Chocolatey is installed, you can install FFmpeg by running the following command in your PowerShell: | ||
|
||
``` | ||
choco install ffmpeg-full | ||
``` | ||
|
||
Please ensure that you run these commands in a PowerShell window with administrator privileges. If you face any issues during the installation, you can visit the official Chocolatey and FFmpeg websites for troubleshooting. | ||
|
||
### 🔧 Installation | ||
|
@@ -51,7 +55,7 @@ Please ensure that you run these commands in a PowerShell window with administra | |
``` | ||
pip install -r requirements.txt | ||
``` | ||
|
||
4. Create a `keys.py` file in the ecoute directory and add your OpenAI API key: | ||
|
||
- Option 1: You can utilize a command on your command prompt. Run the following command, ensuring to replace "API KEY" with your actual OpenAI API key: | ||
|
@@ -61,10 +65,11 @@ Please ensure that you run these commands in a PowerShell window with administra | |
``` | ||
|
||
- Option 2: You can create the keys.py file manually. Open up your text editor of choice and enter the following content: | ||
|
||
``` | ||
OPENAI_API_KEY="API KEY" | ||
``` | ||
|
||
Replace "API KEY" with your actual OpenAI API key. Save this file as keys.py within the ecoute directory. | ||
|
||
### 🎬 Running Ecoute | ||
|
@@ -102,3 +107,16 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file | |
## 🤝 Contributing | ||
|
||
Contributions are welcome! Feel free to open issues or submit pull requests to improve Ecoute. | ||
|
||
### Installation | ||
|
||
1. `make venv` | ||
2. Activate the venv: `ecout_venv` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ecout_env\Scripts\activate ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, I'll add one script for MacOS and one for Windows. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, sorry. I tried adding a script, but it's not possible to activate the venv with a make command. I'll add both options to the README: for MacOS it's |
||
3. `make install` | ||
|
||
### Code quality | ||
|
||
Before submitting a pull request run `make precommit` and resolve any issues. Additionally, here are some useful commands: | ||
|
||
- `make lint` | ||
- `make format` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are the streamlined installation changes, let me know if it is necessary to split the PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh Sry! Got confused with the Installation section above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably have instructions to install 'make' as well, chocolatey seems easiest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's built-in on MacOS and Linux, not sure about Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows you have to install it
installing choco with the commad in README and using
would be good enough for instructions