agencyenterprise / neurotechdevkit

Neurotech Development Kit (NDK)
https://agencyenterprise.github.io/neurotechdevkit/
Apache License 2.0
115 stars 10 forks source link

Describe how to install `en_US` dictionary for `make spellcheck` #146

Closed charlesbmi closed 11 months ago

charlesbmi commented 1 year ago

Issue

Describe your proposed enhancement in detail. If you are requesting a new glossary term, please include a proposed definition.

As an NDK contributor, I would like to be able to run make locally to validate my PR quickly.

make spellcheck runs the following command:

poetry run pylint --disable all --enable spelling --spelling-dict en_US --spelling-private-dict-file=whitelist.txt src

On a clean macOS install, this generates the following error:

pylint: error: argument --spelling-dict: invalid choice: 'en_US' (choose from '')

I believe this gets installed with aspell with some option, and I did this once before, but it's not clear from the logs/quick Google search how to install this.

charlesbmi commented 1 year ago

One option: install the dictionary into the Docker image, then have people run make spellcheck from the Docker image, e.g. start the Docker shell:

docker run -it -p 8888:8888 -it ghcr.io/agencyenterprise/neurotechdevkit:latest /bin/bash  

Then run from the Docker shell

root@ba17a241f12b:/ndk/notebooks# cd ..
root@ba17a241f12b:/ndk# ls
Makefile  README.md  notebooks  poetry.lock  pyproject.toml  run_jupyter_server.sh  src  tests  venv
root@ba17a241f12b:/ndk# make spellcheck
poetry run pylint --disable all --enable spelling --spelling-dict en_US --spelling-private-dict-file=whitelist.txt src
Creating virtualenv neurotechdevkit-rJNCux70-py3.10 in /root/.cache/pypoetry/virtualenvs
usage: pylint [options]
pylint: error: argument --spelling-dict: invalid choice: 'en_US' (choose from '')
make: *** [Makefile:16: spellcheck] Error 2

As of now, the en_US dictionary is not included in the Docker image.

charlesbmi commented 11 months ago

Looks like this is an issue with pyenchant (the dictionary provider) on Mac M1: https://github.com/pyenchant/pyenchant/issues/265 . The workaround: export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.2.dylib