-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow passing arguments when entry points are used as functions #5613
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
Allow passing arguments when entry points are used as functions #5613
Conversation
7bd580c
to
05622ab
Compare
Oops, I based on the wrong branch. This should be better! |
Pull Request Test Coverage Report for Build 1638542036
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ! I think a changelog would be bice, if only to advertise the feature. I'll approve either way.
How do we call this? "When invoking pylint, symilar or pyreverse programatically you can now pass an arguments keyword"? I'm really not sure... |
Maybe : "The API of pylint, symilar and pyreverse now do not rely exclusively on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌 You're doing so much lately, you're carrying 2.13.0 on your back 😄
|
||
from pylint.__pkginfo__ import __version__ | ||
|
||
# pylint: disable=import-outside-toplevel | ||
|
||
|
||
def run_pylint(): | ||
def run_pylint(*, arguments: Optional[List[str]] = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably a bit late on this one.
I would suggest using args
or argv
instead, without the keyword requirement. This is what I usually see in these cases.
def main(argv: Optional[Sequence[str]] = None):
argv = argv or sys.argv[1:]
...
Keyword only isn't really necessary here, it's just one argument. Even with more, the first will likely always be args
/ argv
. More detail (optional) once can always be keyword only later, although even then not strictly necessary.
Type of Changes
Description
@Pierre-Sassoulas I'm not sure if this warrants a changelog entry? I haven't added one.
I'll do a follow-up for
epylint
, as it requires some additional changes to itsRun
class.Closes #5320