-
Notifications
You must be signed in to change notification settings - Fork 10
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
Use Python APIs for linter dependencies #45
Conversation
It seems like calling the functions internally is maybe not respecting some specific |
@unmade a different workaround that leverages all the nice parts of the CLI tools would be something like:
what do you think about that approach? |
Here is a branch with the other approach. Passes all tests and lint: master...FrankPortman:thrift-pyi:executable |
Hey @FrankPortman Thanks In general I agree with you - using Looking at the current changes everything seems good, but please add |
Thanks for responding. After playing around with this a bit more, I am a bit nervous to use the internal APIs because they do not trivially respect whatever configuration is being set elsewhere - thus they will not be backwards compatible. E.G. in my current code it keeps trying to add an extra new line character after test imports, but the current I think this approach may be a happy middle ground where it still uses |
Hiya, just wanted to bump this up to see your thoughts on the other approach from my last message. Appreciate your time on this! |
I'm really sorry it took me so long to reply to you! I think the approach with One minor note - according to the docs |
Although
thrift-pyi
currently has pinned dependencies againstautoflake
andblack
, calling a CLI subprocess is not guaranteed to actually use those specific dependent packages in lieu of other system installed libraries. This is especially apparent in a Bazel monorepo where commands are executed in quarantined sandbox environments. I'm not sure ifvirtualenv
works ok with the current setup, but I think using the internal APIs may be safer in general, but I am curious to hear your opinions.