-
Notifications
You must be signed in to change notification settings - Fork 12
feat: add Actor exit_process
option
#424
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
Conversation
Hi @honzajavorek, what were your suggestions for utilizing the Scrapy's |
Is this really necessary? I would rather keep the same naming as in the JS version. I recall this argument from another PR, where @janbuchar disagreed with the shadowing being necessary? |
Not strictly necessary, just good practice and keeping the linter happy. However, the built-in exit is primarily for interactive use, so it's not that big deal, and keeping argument names consistent is a good argument (although the |
I am leaning towards |
In general, I'm pro-shadowing and will always argue in favor of shadowing obscure Python builtins 😁 However, |
I can't help myself, but the |
I have no problem changing to e.g. |
Let's go with |
call_exit
optionexit_process
option
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.
LGTM
LGTM. My idea was to use This change detects Scrapy by checking whether it's installed, which might not be perfect (perhaps I could use something from Scrapy, but not the whole thing? how many scrapers like that exists? probably not many 🤔 ), but the most important change is that if I realize the SDK doesn't do a great job in detecting my particular use case, I can now explicitly say "please do not call sys.exit()", no bizarre hacks needed. Thanks! This closes #389 as well. |
Thanks, @honzajavorek. I tried using |
Description
exit_process
option for the Actor class.exit_process
(instead ofexit
) to avoid shadowing Python's built-in names.False
for IPython, Pytest, and Scrapy environments, andTrue
for all other cases.test_actor_logs_messages_correctly
test accordingly.Issues
sys.exit
handling for tests inActor
#396Tests