Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,24 @@ Once all three versions are installed, you can set an application-specific pyenv
pyenv local 3.7.12 3.8.12 3.9.10
```

## Pyenchant linter errors on Apple Silicons

If you are using an M1 Mac to run tox, there is currently [an issue with pyenchant](https://github.com/pyenchant/pyenchant/issues/265) that you would run into while running `linters`.
This happens because python distributions installed by `pyenv` are in the default M1 architecture (aarch64), and can't find a compatible enchant library.
As a workaround, you can follow the steps below:

Install enchant with Homebrew
```shell
brew install enchant
```
Set environment variable `PYENCHANT_LIBRARY_PATH` to point to the installed enchant library before running `tox`.
```shell
export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.dylib
```
You can set this environment variable in your `~/.zshrc` or in your IDE to avoid doing it everytime.
```shell
echo 'export PYENCHANT_LIBRARY_PATH="/opt/homebrew/lib/libenchant-2.dylib"' >> ~/.zshrc
```

## Get in Touch
- [Iceberg community](https://iceberg.apache.org/community/)
4 changes: 4 additions & 0 deletions python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ deps =
setenv =
COVERAGE_FILE = test-reports/{envname}/.coverage
PYTEST_ADDOPTS = --junitxml=test-reports/{envname}/junit.xml -vv
passenv =
# Workaround for pyenchant on Apple Silicons
# Ref: https://github.com/pyenchant/pyenchant/issues/265
PYENCHANT_LIBRARY_PATH
commands =
coverage run --source src --parallel-mode -m pytest {posargs}
coverage combine
Expand Down