Skip to content
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

handle_urls decorator using a new PageObjectRegistry #16

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a5a8f42
meta module
ivanprado Nov 29, 2021
ec80b69
CMD for listing overrides
ivanprado Nov 29, 2021
308bd1d
Refactoring with better names and structures and meta inclusion
ivanprado Nov 30, 2021
aa8000d
docstring
ivanprado Nov 30, 2021
a2d5cb6
Fix url_matcher dep
ivanprado Nov 30, 2021
1f1f410
Fix CI tests
ivanprado Nov 30, 2021
bdb8987
Make mypy happy again
ivanprado Nov 30, 2021
a3e3eea
Documentation fixed
ivanprado Nov 30, 2021
ef9945b
Minor changes
ivanprado Nov 30, 2021
f6fdac4
url-matcher has now been released.
ivanprado Dec 1, 2021
b050d01
Merge branch 'master' into handle_urls
BurnzZ Dec 20, 2021
ba52ce0
add entry point for CLI command
BurnzZ Dec 20, 2021
ba61626
fix import which fails tests
BurnzZ Dec 20, 2021
f5cffef
refactor namespace to be classes instead
BurnzZ Dec 20, 2021
c3579b9
fix failing mypy tests after refactoring
BurnzZ Dec 20, 2021
234b8d9
Merge branch 'master' of github.com:scrapinghub/web-poet into handle_…
BurnzZ Dec 21, 2021
531752f
update tests to improve coverage
BurnzZ Dec 21, 2021
7495b58
add missing import for find_page_object_overrides
BurnzZ Dec 21, 2021
0a0ee12
add docs for overrides
BurnzZ Dec 21, 2021
46d40e7
refactor by removing the need for find_page_object_overrides()
BurnzZ Dec 22, 2021
495642b
add docs about using multiple PageObjectRegistries
BurnzZ Dec 23, 2021
75593ed
add docs regarding organizing Page Object Overrides
BurnzZ Jan 4, 2022
0a2d779
update override docs to showcase url-matcher patterns
BurnzZ Jan 6, 2022
c000cbc
rename get_overrides_from_module into get_overrides_from
BurnzZ Jan 6, 2022
10dff5b
fix bug where module substring paths are not filtered out correctly
BurnzZ Jan 6, 2022
daa3ff9
create consume_modules() to properly load annotations in get_overrides()
BurnzZ Jan 6, 2022
3b05c07
update get_overrides_from to accept an arbitrary number of str inputs
BurnzZ Jan 6, 2022
f626efc
add more warning docs to get_overrides() to use consume_modules()
BurnzZ Jan 6, 2022
bd3a88e
enable ease of combining external Page Object packages
BurnzZ Jan 7, 2022
0cbeb0b
refactor get_overrides() to have a simpler interface with consume_mod…
BurnzZ Jan 12, 2022
de5563a
introduce concept of 'registry_pool' to access all PageObjectRegistry…
BurnzZ Jan 13, 2022
e7cca69
implement __hash__() in OverrideRule to easily identify uniqueness
BurnzZ Jan 13, 2022
eab277a
polish documentation with better examples and discussion
BurnzZ Jan 17, 2022
38e56cd
add more tests when PageObjectRegistry is instantiated
BurnzZ Jan 18, 2022
bf0b3e5
update PageObjectRegistry API for manipulating rules from different r…
BurnzZ Jan 20, 2022
d5a5d75
update OverrideRule __hash__() implementation after url-matcher==0.2.…
BurnzZ Feb 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ Changelog
TBR
------------------

* added a ``PageObjectRegistry`` class which has the ``handle_urls`` decorator
to write override rules.
* new CLI tool for displaying all available Page Objects: ``web_poet <module>``
* removed support for Python 3.6
* added support for Python 3.10


0.1.1 (2021-06-02)
------------------

Expand Down
14 changes: 14 additions & 0 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _`api-reference`:

=============
API Reference
=============
Expand Down Expand Up @@ -45,3 +47,15 @@ Mixins
.. autoclass:: web_poet.mixins.ResponseShortcutsMixin
:members:
:no-special-members:


.. _`api-overrides`:

Overrides
=========

.. autofunction:: web_poet.handle_urls

.. automodule:: web_poet.overrides
:members:
:exclude-members: handle_urls
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,5 @@
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None, ),
'scrapy': ('https://docs.scrapy.org/en/latest', None, ),
'url-matcher': ('https://url-matcher.readthedocs.io/en/stable/', None, ),
}
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ and the motivation behind ``web-poet``, start with :ref:`from-ground-up`.

intro/tutorial
intro/from-ground-up
intro/overrides

.. toctree::
:caption: Reference
Expand Down
Loading