Skip to content

Commit 23fb6ea

Browse files
authored
Update Contributing guide with Mac spellcheck (#962)
1 parent be94eee commit 23fb6ea

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

CONTRIBUTING.md

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**We appreciate all kinds of help, so thank you!**
44

5-
First please read the overall project contributing guidelines. These are
5+
First, please read the overall project contributing guidelines. These are
66
included in the Qiskit documentation here:
77

88
https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md
@@ -58,40 +58,64 @@ please ensure that:
5858
make html
5959
```
6060
from the root of the Machine Learning repository clone. You might also like to check the html output
61-
to see the changes formatted output is as expected. You will find an index.html
62-
file in docs\_build\html and you can navigate from there.
61+
to see the changes formatted output is as expected. You will find an `index.html`
62+
file in `docs\_build\html` and you can navigate from there.
6363

64-
Please note that a spell check is run in CI, on the docstrings.
64+
3. Please note that a spell check is run in CI, on the docstrings.
6565

66-
You can run `make spell` locally to check spelling though you would need to
66+
You can run
67+
```shell script
68+
make spell
69+
```
70+
locally to check spelling though you would need to
6771
[install pyenchant](https://pyenchant.github.io/pyenchant/install.html) and be using
6872
hunspell-en-us as is used by the CI.
6973

7074
For some words, such as names, technical terms, referring to parameters of the method etc.,
7175
that are not in the en-us dictionary and get flagged as being misspelled, despite being correct,
7276
there is a [.pylintdict](./.pylintdict) custom word list file, in the root of the Machine Learning repo,
7377
where such words can be added, in alphabetic order, as needed.
74-
75-
3. If it makes sense for your change that you have added new tests that
78+
79+
> [!NOTE]
80+
> When running PyEnchant on Apple Silicon M1(/2/3) hardware in a virtual environment, you may
81+
> encounter an error like:
82+
> ```text
83+
> ImportError: The ‘enchant’ C library was not found and maybe needs to be installed.
84+
> ```
85+
> This happens because the Arm-based `brew install` command places the library files
86+
> (libenchant-2 and dylib) in a non-standard location that PyEnchant doesn’t look into by
87+
> default. A convenient workaround (originally documented in the Plone documentation toolchain
88+
> and discussed in the PyEnchant issue tracker) is to point PyEnchant at the Homebrew library
89+
> _before_ launching your Python tool. On an Apple Silicon MacOS you can run
90+
> ```bash
91+
> export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.dylib
92+
> ```
93+
> in your shell session, and then invoke your script or REPL as usual. This forces PyEnchant to
94+
> load the correct C library, eliminating the import error.
95+
> See the docs contribution guide for context on how they use PyEnchant in their toolchain
96+
> (https://github.com/plone/documentation/pull/1242) and the related discussion in the
97+
> PyEnchant issue tracker (https://github.com/pyenchant/pyenchant/issues/265#issuecomment-1126415843).
98+
99+
4. If it makes sense for your change that you have added new tests that
76100
cover the changes and any new function.
77101
78-
4. Ensure that if your change has an end user facing impact (new feature,
102+
5. Ensure that if your change has an end user facing impact (new feature,
79103
deprecation, removal etc) that you have added a reno release note for
80104
that change and that the PR is tagged for the changelog.
81105
82-
5. Ensure all code, including unit tests, has the copyright header. The copyright
106+
6. Ensure all code, including unit tests, has the copyright header. The copyright
83107
date will be checked by CI build. The format of the date(s) is _year of creation,
84108
last year changed_. So for example:
85109
86-
> \# (C) Copyright IBM 2018, 2021.
110+
> \# (C) Copyright IBM 2018, 2025.
87111
88112
If the _year of creation_ is the same as _last year changed_ then only
89113
one date is needed, for example:
90114
91-
> \# (C) Copyright IBM 2021.
115+
> \# (C) Copyright IBM 2025.
92116
93117
If code is changed in a file make sure the copyright includes the current year.
94-
If there is just one date and it's a prior year then add the current year as the 2nd date,
118+
If there is just one date, and it's a prior year then add the current year as the 2nd date,
95119
otherwise simply change the 2nd date to the current year. The _year of creation_ date is
96120
never changed.
97121

0 commit comments

Comments
 (0)