-
Notifications
You must be signed in to change notification settings - Fork 28
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
Moving away from upcoming deprecated functionalities of web-poet==0.6.0 #89
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #89 +/- ##
==========================================
- Coverage 97.88% 97.78% -0.11%
==========================================
Files 12 10 -2
Lines 473 451 -22
==========================================
- Hits 463 441 -22
Misses 10 10
|
scrapy_poet/cache.py
Outdated
@@ -16,7 +16,8 @@ def __getitem__(self, fingerprint: str) -> Any: | |||
def __setitem__(self, fingerprint: str, value) -> None: | |||
pass | |||
|
|||
def close(self): | |||
@abc.abstractmethod |
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.
Why should it be an abstractmethod? Empty close seems like a good default, in case a backend doesn't need to close anything.
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.
Reverted it. 4a8807a
scrapy_poet/overrides.py
Outdated
|
||
logger = logging.getLogger(__name__) | ||
|
||
RuleAsTuple = Union[Tuple[str, Callable, Callable], List] | ||
RuleFromUser = Union[RuleAsTuple, OverrideRule] | ||
PageObject = Type[ItemPage] |
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.
It looks a bit confusing, with x: PageObject
annotation I'd expect x to be a page object instance, not a subclass of ItemPage. It seems that removing this shortcut (not even renaming it) can make the code easier to read.
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.
Updated in 4a8807a
tox.ini
Outdated
@@ -38,7 +38,7 @@ deps = | |||
|
|||
[testenv:mypy] | |||
deps = | |||
mypy==0.790 | |||
mypy==0.982 |
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.
would it make sense to update directly to the latest mypy version (0.991)?
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.
Good call, as the new version picked up some typing inconsistencies. 4881d6f
Thanks @BurnzZ! |
Migration away from the deprecated functionalities of web-poet as introduced in scrapinghub/web-poet#84.
This PR should not receive any
DeprecationWarning
from web-poet.TODO:
tox.ini
andsetup.py
with the new web-poet version in PyPI