https://pantsbuild.org/ logo
#general
Title
# general
p

plain-orange-45099

12/22/2022, 4:41 PM
Hey all 👋 I'm a recent
pants
convert 😅 Looking at taking my existing
pylint
flow over to
pants
, and I'm getting stuck with my
[SPELLING]
configuration. Currently, running
./pants lint ::
will error with
optparse.OptionValueError: option spelling-dict: invalid value: 'en_US', should be in ['']
despite having the
enchant
library installed through
brew
👖 1
FWIW, I'm running on an M1 macbook, in case that makes a difference
This works with my local
pylint
, but when trying to run with
./pants lint
, it doesn't seem to be able to find the dictionary
e

enough-analyst-54434

12/22/2022, 4:43 PM
Pants tries very very hard to ignore your environment. Just because you have brewed something, you can be sure someone else working on the project will not.
So, you need to get Pants involved with enchant
p

plain-orange-45099

12/22/2022, 4:43 PM
Which is exactly the problem I'm trying avoid! And one of the great reasons I love
pants
😄
e

enough-analyst-54434

12/22/2022, 4:44 PM
So what the heck is an enchant?
😆 1
p

plain-orange-45099

12/22/2022, 4:44 PM
So, Pants needs to natively support enchant? Or can I "hack it in" through one of the
pylint
configuration options? https://www.pantsbuild.org/docs/reference-pylint
It's just a spelling dictionary...it lets
pylint
perform spellchecks in my code
e

enough-analyst-54434

12/22/2022, 4:48 PM
See that there?: http://pyenchant.github.io/pyenchant/install.html#apple-silicon-related-errors That's alot of M1 advice that involves env vars. Like all else isolationist, Pants will try to ignore your env vars. You need to poke holes for the critical ones so Pants subprocesses can see them.
Pants doesn't currently support
.env
files for injecting env variance. That would be useful here - m1 people need these env vars, others do not. That's coming but just not available quite yet; so you'll need to poke this hole for all users 😕
p

plain-orange-45099

12/22/2022, 4:51 PM
Thank you 🙏 It definitely sounds like I need to play around with this some more, but it sounds like...with enough fiddling...I might get this to work 😉
e

enough-analyst-54434

12/22/2022, 4:52 PM
Yeah, just stick to the theme of understanding exactly how the thing you want works - the details - and almost always the answer is the details need to be explained to Pants to open up its hermeticity jails.
2 Views