Conversation
|
Thanks for contributing! Could you split the PR between the streamlined installation changes and black and ruff changes? Want to consider those changes separately. Also I think we should ignore linting custom_speech_recognition since its just a copy of the existing SpeechRecognition library with some modifications. Probably a better way to maintain that I haven't considered how. |
I see, I didn't realize it was a copy of an existing SpeechRecognition library. In that case, I will ignore it in regards to linting and formatting. Would it make sense to do something like this - where the library is its own git repo? Example from: https://github.com/foundry-rs/foundry-rust-template/tree/master/contracts/lib |
| 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 | ||
|
|
||
| install: | ||
| pip install -r requirements.txt No newline at end of file |
There was a problem hiding this comment.
These are the streamlined installation changes, let me know if it is necessary to split the PR.
|
|
||
| ### Installation | ||
|
|
||
| 1. `make venv` | ||
| 2. Activate the venv: `ecout_venv` | ||
| 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.
These are the streamlined installation changes, let me know if it is necessary to split the PR.
There was a problem hiding this comment.
Oh Sry! Got confused with the Installation section above.
Makefile
Outdated
| make format | ||
|
|
||
| venv: | ||
| python3 -m venv ecout_env |
There was a problem hiding this comment.
I think python3 is preferred since we are working with Python 3.x.x
There was a problem hiding this comment.
Could somehow use either? For me I don't have python3 alias only python in my PATH.
There was a problem hiding this comment.
Yeah, I can change it to python instead of python3.
| black . | ||
|
|
||
| precommit: | ||
| make lint |
There was a problem hiding this comment.
Should probably have instructions to install 'make' as well, chocolatey seems easiest
There was a problem hiding this comment.
I believe it's built-in on MacOS and Linux, not sure about Windows.
There was a problem hiding this comment.
Windows you have to install it
installing choco with the commad in README and using
choco install make
would be good enough for instructions
README.md
Outdated
| ### Installation | ||
|
|
||
| 1. `make venv` | ||
| 2. Activate the venv: `ecout_venv` |
There was a problem hiding this comment.
I see, I'll add one script for MacOS and one for Windows.
There was a problem hiding this comment.
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 source ecout_env/bin/activate
Hmm, I'm not sure. Maybe the way black behaves is different on windows. Can you try modifying a python file to contain single quotes for a string, instead of double quotes, and see if you get the same message. Perhaps it's behaving normally? |
| #### Windows | ||
|
|
||
| 1. Install make on your Windows machine. | ||
|
|
||
| ```shell | ||
| choco install make | ||
| ``` | ||
|
|
||
| 2. Create a virtual environment: | ||
|
|
||
| ```shell | ||
| make venv | ||
| ``` | ||
|
|
||
| 3. Activate the virtual environment: | ||
|
|
||
| ```shell | ||
| .\ecout_venv\Scripts\activate | ||
| ``` | ||
|
|
||
| 4. Install the required packages: | ||
|
|
||
| ```shell | ||
| make install | ||
| ``` |
There was a problem hiding this comment.
Please confirm these steps work.
|
I think this is good to go. If you get a chance to review + merge, I would appreciate it. Thanks! |



I added black and ruff to maintain code quality and implemented a Makefile streamline the execution of common commands.
I also tried to add poetry as the dependency manager, but it was not compatible with the dependency
openai-whisper. It seemed to consistently fail on the installation oftritton.For reference, this is as far as I was able to get:
It fails with this error (there was another one for tritton, but I seemed to have lost it somewhere in my console):
I noticed another developer had a similar issue: https://github.com/orgs/python-poetry/discussions/7199