-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
[MRG+1] Update project.py removed one 'hack', seems irrelevant. #3910
Conversation
As mentioned by @Gallaecio in issue #3871, the 'hack' is cleared. I also double checked whether the environment variable "SCRAPY_PICKLED_SETTINGS_TO_OVERRIDE" was ever set in our codebase and it turns out we didn't set it or used it anywhere else.So I guess the 'hack' was not used in the current version. Also the name of this environment variable rather doesn't suggest it was a boolean(it is used in an 'if' condition which has perplexed me )
@@ -68,10 +68,7 @@ def get_project_settings(): | |||
settings.setmodule(settings_module_path, priority='project') | |||
|
|||
# XXX: remove this hack |
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 think that # XXX: remove this hack
should be removed as well.
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.
The code actually has 2 hacks,so thought it won't matter. Anyway I am doing what you suggested. Thank you.
Codecov Report
@@ Coverage Diff @@
## master #3910 +/- ##
==========================================
- Coverage 85.47% 84.89% -0.58%
==========================================
Files 165 165
Lines 9624 9621 -3
Branches 1446 1445 -1
==========================================
- Hits 8226 8168 -58
- Misses 1145 1192 +47
- Partials 253 261 +8
|
Codecov Report
@@ Coverage Diff @@
## master #3910 +/- ##
=======================================
Coverage 85.47% 85.47%
=======================================
Files 165 165
Lines 9624 9624
Branches 1446 1446
=======================================
Hits 8226 8226
Misses 1145 1145
Partials 253 253
|
I think we should to first deprecate the variable, logging a deprecation warning when it’s defined, and actually drop it at a latter version. |
I would like to handle that. I have currently implemented a warning instead of dropping the whole thing.Please review and suggest changes if any. |
How about this?
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’ve left a couple of additional nitpicks, but I think this can be merged as is. Thanks!
Co-Authored-By: Adrián Chaves <adrian@chaves.io>
Co-Authored-By: Adrián Chaves <adrian@chaves.io>
scrapy/utils/project.py
Outdated
@@ -1,6 +1,7 @@ | |||
import os | |||
from six.moves import cPickle as pickle | |||
import warnings | |||
from scrapy.exceptions import ScrapyDeprecationWarning |
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.
one more nitpick: could you please move this import to another scrapy.exceptions import below? According to pep8, imports should be grouped in 3 groups: stdlib imports, third-party imports, project imports; this one should be in the last group.
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.
@kmike missed that one thanks for the suggestion. I have made the changes accordingly.
Thanks @sbs2001 for a fix, and everyone else for feedback! |
As mentioned by @Gallaecio in issue #3871, the 'hack' is cleared. I also double checked whether the environment variable "SCRAPY_PICKLED_SETTINGS_TO_OVERRIDE" was ever set in our codebase and it turns out we didn't set it or used it anywhere else.So I guess the 'hack' was not used in the current version.