Skip to content
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

Normalize default dictionary location as $PREFIX/share/hunspell? #12

Open
bollwyvl opened this issue Mar 26, 2024 · 9 comments
Open

Normalize default dictionary location as $PREFIX/share/hunspell? #12

bollwyvl opened this issue Mar 26, 2024 · 9 comments
Labels

Comments

@bollwyvl
Copy link

Comment:

It appears that the semi-arbitrary ${PREFIX}/share/hunspell_dictionaries doesn't line up with other tools like enchant (as noted on conda-forge/pyenchant-feedstock#1), which expects ${PREFIX}/share/hunspell, nor does DICPATH support a delimited list of search paths.

Making this change here would lead to breakage in a number of downstream feedstocks:

Of note (namely the ones I don't personally co-maintain):

  • @conda-forge/pyhunspell
    • would probably simplify the setup considerably
  • @conda-forge/rstudio
    • no idea what's going on here, but apparently only build-time, so less worried
@bollwyvl bollwyvl changed the title Normalize location as $PREFIX/share/hunspell? Normalize default dictionary location as $PREFIX/share/hunspell? Mar 26, 2024
@asmeurer
Copy link
Member

No idea where I got that path from conda-archive/conda-recipes@5a34409. I probably copied it from another package manager, but I might have also just made it up.

@bollwyvl
Copy link
Author

bollwyvl commented Mar 26, 2024 via email

@asmeurer
Copy link
Member

If we're worried about breakage we could add a symlink. Might be good to check what path Linux package managers use.

@asmeurer
Copy link
Member

I guess rereading the comment I probably just made it up. But why are other packages using hunspell? Did upstream hunspell get changed since the original recipe?

Also, assuming it hasn't, maybe it would be better to patch hunspell to add the path to the built-in list of paths rather than using the wrapper. The wrapper will break if someone wants to set a DICPATH of their own.

@bollwyvl
Copy link
Author

why are other packages using hunspell

pyenchant will use hunspell as a backend.

other packages that want to work with hunspell put their dictionaries where hunspell-feedstock will find them.

symlink

Yes, that would work, as we don't have a windows build yet. This was verified over on conda-forge/pyenchant-feedstock#1 (comment)

patch hunspell to add the path to the built-in list of paths

if you see a clear path to supporting both that won't break downstreams, i'd say go for it!

@asmeurer
Copy link
Member

Sorry, I mean why is enchant using ${PREFIX}/share/hunspell? Is that already standardized from somewhere else?

@bollwyvl
Copy link
Author

why is enchant using

Dunno, but:

verified over on conda-forge/pyenchant-feedstock#1 (comment)

@asmeurer
Copy link
Member

Well I think making this change (with a symlink for backwards compatibility) is a good idea. The symlink might break other builds that are also making that same symlink, but that will be easy to fix.

Longer term we should probably also try to update the package as I suggested here #12 (comment), or even upstream a fix to hunspell.

@bradbell
Copy link

bradbell commented Apr 3, 2024

Here is what works for me with using the current install of pyenchant:

podman pull continuumio/miniconda3
podman run -it continuumio/miniconda3 bash
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install -y pyenchant
ln -s \
    $CONDA_PREFIX/share/hunspell_dictionaries  \
    $CONDA_PREFIX/share/enchant/hunspell
python 
import enchant
d = enchant.Dict("en_US")
ok = d.check("hello")
print( f'ok = {ok}' )

I have a package that can use pyenchant. Do you suggest that I make the install of my package change the CONDA_PREFIX directory by adding the soft link above ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants