Skip to content

Commit 6cbff40

Browse files
committed
Version 3.10.2rc0
1 parent 1ae6988 commit 6cbff40

34 files changed

+804
-618
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.10.1
2+
current_version = 3.10.2rc0
33
message = Release {new_version}
44
parse = ^
55
(?P<major>\d+)

CHANGELOG.rst

+57-1
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,69 @@ can check out the `wish list <https://github.com/mborsetti/webchanges/blob/main/
3131
Internals, for changes that don't affect users. [triggers a minor patch]
3232
3333
34+
Version 3.10.2rc0
35+
===================
36+
Unreleased
37+
38+
⚠ Breaking Changes
39+
------------------
40+
* Due to a fix to the ``html2text`` filter (see below), the first time you run this new version **you may get a change
41+
report with deletions and additions of lines that look identical. This will happen one time only**.
42+
43+
Added
44+
-----
45+
* You can now run the command line argument ``--test`` without specifying a JOB to check the config and job files for
46+
syntax errors.
47+
* Improved error messages for url jobs failing due to HTTP reason codes of 400 and higher, to include any text returned
48+
by the website (e.g. "Rate exceeded.", "upstream request timeout", etc.). Not implemented in jobs with
49+
``use_browser: true`` due to limitations in Playwright.
50+
* New command line argument ``--check-new`` to check if a new version is available.
51+
52+
Changed
53+
-------
54+
* On Linux and macOS systems, for security reasons we now check that the hooks file **and** the directory it is located
55+
in are **owned** and **writeable** by **only** the user who is running the job (and not by its group or by other
56+
users), identical to what we do with the jobs file if any job uses the ``shellpipe`` filter. An ImportWarning message
57+
will be issued if the permissions are not correct and the hooks module is therefore not imported.
58+
* The command line argument ``-v`` or ``--verbose`` has reduced verbose output while the new ``-vv`` has full verbosity.
59+
60+
Fixed
61+
-----
62+
* The ``html2text`` filter is no longer retaining any eventual spaces found in the HTML after *the end of the text* on
63+
a line, which are not displayed in HTML and therefore a bug in the conversion library used. This was causing a change
64+
report to be issued whenever the number of such invisible spaces changed.
65+
* For job with ``browser: true``, the ``cookies`` directive did not add cookies correctly to the header.
66+
* Configuration file entries relating to job kinds declared in custom JobBase classes in the hooks file no longer issue
67+
the warning of being unrecognized and potential typos.
68+
* For filters ``execute`` and ``shellpipe`` and for reporter ``run_command`` the message of the FileNotFoundError
69+
exception is more descriptive and helpful.
70+
* The ``wait_for_timeout`` job directive was not accepting integers (only floats). Reported by `Markus Weimar
71+
<https://github.com/Markus00000>`__ in `#39 <https://github.com/mborsetti/webchanges/issues/39>`__.
72+
* Fixed an issue in the parser used by the ``xpath`` ``filter`` that under specific conditions caused more html than
73+
expected to be returned.
74+
* Fixed how we determine if a new version has been released due to a change in the data received from PyPi.
75+
76+
Internals
77+
---------
78+
* ``urllib3`` is now an explicit dependency due to the refactoring of the requests package (we previously used
79+
``requests.packages.urllib3``). Has no effect since ``urllib3`` is already being installed as a dependency of
80+
``requests``.
81+
* Updated the vendored version of ``packaging.version.parse()`` to 21.3, released on 2021-11-27.
82+
* Changed the import logic so if packaging is found to be installed, its ``packaging.version.parse()`` function will be
83+
used instead of the vendored one.
84+
* Changed loading logic so that with ``-vv`` registration of internal classes shows up in the logs.
85+
* Improved execution speed of certain command line arguments.
86+
* Added typed.py file to implement `PEP 561 <https://peps.python.org/pep-0561/>`__.
87+
88+
89+
3490
Version 3.10.1
3591
===================
3692
20220503
3793

3894
Fixed
3995
-----
40-
* ``KeyError: 'indent' error`` when using ``beautify`` filter. Reported by `César de Tassis Filho
96+
* ``KeyError: 'indent'`` error when using ``beautify`` filter. Reported by `César de Tassis Filho
4197
<https://github.com/CTassisF>`__ in `#37 <https://github.com/mborsetti/webchanges/issues/37>`__.
4298

4399

LICENSE

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2727

2828
This software redistributes source code of release 2.21 of urlwatch
2929
https://github.com/thp/urlwatch/tree/346b25914b0418342ffe2fb0529bed702fddc01f
30-
which is subject to the following license, hereby retained with the source code,
31-
of which this file is part of:
30+
which is subject to the following copyright notice and license from
31+
https://raw.githubusercontent.com/thp/urlwatch/346b25914b0418342ffe2fb0529bed702fddc01f/COPYING
32+
hereby retained and redistributed with the source code (of which this license
33+
file is part of), in binary form, and in the documentation. The appearance of
34+
the name of the author below does not constitute an endorsement or promotion of
35+
this software by such author.
3236

3337
Copyright (c) 2008-2020 Thomas Perl <[email protected]>
3438
All rights reserved.

README.rst

+16-13
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
webchanges
1010
==========
1111

12+
|downloads|
1213
**webchanges** checks web content and notifies you via e-mail (or one of many other supported services) if a change is
1314
detected. **webchanges** can also check the output of local commands. The notification includes the changed URL or
1415
command and a summary of what has changed.
@@ -28,10 +29,11 @@ only the latest bug and security fix version (3.x.y) is supported.
2829

2930
Installation
3031
============
31-
Install **webchanges** |pypi_version| |format| |status| with::
32+
Install **webchanges** |pypi_version| |format| |status| with:
3233

33-
pip install webchanges
34+
.. code-block:: bash
3435
36+
pip install webchanges
3537
3638
3739
Documentation
@@ -90,10 +92,10 @@ The code and issues tracker are hosted on `GitHub <https://github.com/mborsetti/
9092

9193
Contributing
9294
============
93-
We welcome any contribution, e.g. documentation, bug reports, new features, etc., as both pull requests and
94-
`issue reports <https://github.com/mborsetti/webchanges/issues>`__.
95+
We welcome any contribution no matter how small as both pull requests and `issue reports
96+
<https://github.com/mborsetti/webchanges/issues>`__.
9597

96-
More information for developers and documentation editors is `here
98+
More information for developers and documentation contributors is `here
9799
<https://github.com/mborsetti/webchanges/blob/main/CONTRIBUTING.rst>`__, and our wishlist is `here
98100
<https://github.com/mborsetti/webchanges/blob/main/WISHLIST.md>`__.
99101

@@ -102,16 +104,17 @@ License
102104
=======
103105
|license|
104106

105-
Released under the `MIT License <https://opensource.org/licenses/MIT>`__, but including
106-
`code <https://github.com/thp/urlwatch/tree/346b25914b0418342ffe2fb0529bed702fddc01f>`__ licensed under the
107-
`BSD 3-Clause License <https://opensource.org/licenses/BSD-3-Clause>`__. See the full license `here
108-
<https://github.com/mborsetti/webchanges/blob/main/LICENSE>`__.
107+
Released under the `MIT License <https://opensource.org/licenses/MIT>`__ but redistributing modified source code from
108+
`urlwatch 2.21 <https://github.com/thp/urlwatch/tree/346b25914b0418342ffe2fb0529bed702fddc01f>`__ licensed under a
109+
`BSD 3-Clause License
110+
<https://raw.githubusercontent.com/thp/urlwatch/346b25914b0418342ffe2fb0529bed702fddc01f/COPYING>`__. See the complete
111+
license `here <https://github.com/mborsetti/webchanges/blob/main/LICENSE>`__.
109112

110113

111114
Compatibility with **urlwatch**
112115
================================
113116

114-
This project is based on code of`urlwatch <https://github.com/thp/urlwatch>`__ 2.21. You can easily upgrade from
117+
This project is based on `urlwatch <https://github.com/thp/urlwatch>`__ 2.21. You can easily upgrade from
115118
**urlwatch** 2.25 (see `here <https://webchanges.readthedocs.io/en/stable/migration.html>`__) using the same job and
116119
configuration files and benefit from many HTML-focused improvements, including:
117120

@@ -153,9 +156,9 @@ Examples:
153156
.. |format| image:: https://img.shields.io/pypi/format/webchanges.svg
154157
:target: https://pypi.org/project/webchanges/
155158
:alt: Kit format
156-
.. |downloads| image:: https://img.shields.io/pypi/dw/webchanges.svg
157-
:target: https://pypi.org/project/webchanges/
158-
:alt: Weekly PyPI downloads
159+
.. |downloads| image:: https://pepy.tech/badge/requests
160+
:target: https://pepy.tech/badge/webchanges
161+
:alt: PyPI downloads
159162
.. |license| image:: https://img.shields.io/pypi/l/webchanges.svg
160163
:target: https://pypi.org/project/webchanges/
161164
:alt: License at https://pypi.org/project/webchanges/

RELEASE.rst

+47-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,49 @@
1+
⚠ Breaking Changes
2+
------------------
3+
* Due to a fix to the ``html2text`` filter (see below), the first time you run this new version **you may get a change
4+
report with deletions and additions of lines that look identical. This will happen one time only**.
5+
6+
Added
7+
-----
8+
* You can now run the command line argument ``--test`` without specifying a JOB to check the config and job files for
9+
syntax errors.
10+
* Improved error messages for url jobs failing due to HTTP reason codes of 400 and higher, to include any text returned
11+
by the website (e.g. "Rate exceeded.", "upstream request timeout", etc.). Not implemented in jobs with
12+
``use_browser: true`` due to limitations in Playwright.
13+
* New command line argument ``--check-new`` to check if a new version is available.
14+
15+
Changed
16+
-------
17+
* On Linux and macOS systems, for security reasons we now check that the hooks file **and** the directory it is located
18+
in are **owned** and **writeable** by **only** the user who is running the job (and not by its group or by other
19+
users), identical to what we do with the jobs file if any job uses the ``shellpipe`` filter. An ImportWarning message
20+
will be issued if the permissions are not correct and the hooks module is therefore not imported.
21+
* The command line argument ``-v`` or ``--verbose`` has reduced verbose output while the new ``-vv`` has full verbosity.
22+
123
Fixed
224
-----
3-
* ``KeyError: 'indent' error`` when using ``beautify`` filter. Reported by `César de Tassis Filho
4-
<https://github.com/CTassisF>`__ in `#37 <https://github.com/mborsetti/webchanges/issues/37>`__.
25+
* The ``html2text`` filter is no longer retaining any eventual spaces found in the HTML after *the end of the text* on
26+
a line, which are not displayed in HTML and therefore a bug in the conversion library used. This was causing a change
27+
report to be issued whenever the number of such invisible spaces changed.
28+
* For job with ``browser: true``, the ``cookies`` directive did not add cookies correctly to the header.
29+
* Configuration file entries relating to job kinds declared in custom JobBase classes in the hooks file no longer issue
30+
the warning of being unrecognized and potential typos.
31+
* For filters ``execute`` and ``shellpipe`` and for reporter ``run_command`` the message of the FileNotFoundError
32+
exception is more descriptive and helpful.
33+
* The ``wait_for_timeout`` job directive was not accepting integers (only floats). Reported by `Markus Weimar
34+
<https://github.com/Markus00000>`__ in `#39 <https://github.com/mborsetti/webchanges/issues/39>`__.
35+
* Fixed an issue in the parser used by the ``xpath`` ``filter`` that under specific conditions caused more html than
36+
expected to be returned.
37+
* Fixed how we determine if a new version has been released due to a change in the data received from PyPi.
38+
39+
Internals
40+
---------
41+
* ``urllib3`` is now an explicit dependency due to the refactoring of the requests package (we previously used
42+
``requests.packages.urllib3``). Has no effect since ``urllib3`` is already being installed as a dependency of
43+
``requests``.
44+
* Updated the vendored version of ``packaging.version.parse()`` to 21.3, released on 2021-11-27.
45+
* Changed the import logic so if packaging is found to be installed, its ``packaging.version.parse()`` function will be
46+
used instead of the vendored one.
47+
* Changed loading logic so that with ``-vv`` registration of internal classes shows up in the logs.
48+
* Improved execution speed of certain command line arguments.
49+
* Added typed.py file to implement `PEP 561 <https://peps.python.org/pep-0561/>`__.

docs/cli.rst

+30-19
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Command line arguments
1212
positional arguments:
1313
JOB job(s) to run (by index as per --list) (default: run all jobs)
1414
15-
optional arguments:
15+
options:
1616
-h, --help show this help message and exit
1717
-V, --version show program's version number and exit
18-
-v, --verbose show logging output
18+
-v, --verbose show logging output; use -vv for maximum verbosity
1919
2020
override file defaults:
2121
--jobs FILE, --urls FILE
@@ -27,17 +27,18 @@ Command line arguments
2727
job management:
2828
--list list jobs and their index number
2929
--errors list jobs with errors or no data captured
30-
--test JOB, --test-filter JOB
31-
test a job (by index or URL/command) and show filtered output
30+
--test [JOB], --test-filter [JOB]
31+
test a job (by index or URL/command) and show filtered output; if no JOB,
32+
check config and job files
3233
--no-headless turn off browser headless mode (for jobs using a browser)
3334
--test-diff JOB, --test-diff-filter JOB
3435
test and show diff using existing saved snapshots of a job (by index or
3536
URL/command)
3637
--dump-history JOB print all saved snapshot history for a job (by index or URL/command)
37-
--add JOB add job (key1=value1,key2=value2,...). WARNING: all remarks are deleted from
38-
jobs file; use --edit instead!
39-
--delete JOB delete job by URL/command or index number. WARNING: all remarks are deleted
40-
from jobs file; use --edit instead!
38+
39+
backward compatibility (WARNING: all remarks are deleted from jobs file; use --edit instead):
40+
--add JOB add a job (key1=value1,key2=value2,...) [use --edit instead]
41+
--delete JOB delete a job (by index or URL/command) [use --edit instead]
4142
4243
reporters:
4344
--test-reporter REPORTER
@@ -59,17 +60,16 @@ Command line arguments
5960
--rollback-cache TIMESTAMP
6061
delete recent snapshots since TIMESTAMP (backup the database before using!)
6162
--delete-snapshot JOB
62-
delete the last saved snapshot of job (URL/command)
63+
delete the last saved snapshot of job (index or URL/command)
6364
--database-engine {sqlite3,redis,minidb,textfiles}
6465
database engine to use (default: sqlite3, unless redis URI in --cache)
6566
--max-snapshots NUM_SNAPSHOTS
66-
maximum number of snapshots to retain in sqlite3 database (default: 4)
67+
sqlite3 only: maximum number of snapshots to retain in database (default: 4)
6768
6869
miscellaneous:
69-
--install-chrome install or update Google Chrome browser for use with 'use_browser: true' jobs
70-
--features list supported job types, filters and reporters
71-
--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
72-
level of logging output when -v is selected (default: DEBUG)
70+
--check-new check if new release is available
71+
--install-chrome install or update Google Chrome browser (for jobs using a browser)
72+
--features list supported job types, filters and reporters (including those loaded by hooks)
7373
7474
.. _job_subset:
7575

@@ -92,21 +92,32 @@ be monitoring resources as expected. No snapshots are saved from this run.
9292

9393
.. _test:
9494

95-
Test run a job
96-
--------------
95+
Test run a job or check config and job files for errors
96+
-------------------------------------------------------
9797
You can test a job and its filter by using the command line argument ``--test`` followed by the job index number
9898
(from ``--list``) or its URL/command; :program:`webchanges` will display the filtered output. This allows to easily
9999
test changes in filters. Use a negative index number to select a job from the bottom of your job list (i.e. -1 is the
100100
last job, -2 is the second to last job, etc.). Combine ``--test`` with ``--verbose`` to get more information, for
101-
example the text returned from a website with a 4xx (client error) status code::
101+
example the text returned from a website with a 4xx (client error) status code:
102+
103+
.. code-block:: bash
102104
103105
webchanges --verbose --test 1
104106
105107
Please note that ``max_tries`` will be ignored by ``--test``.
106108

109+
To only check the config and job files for errors, specify --test without a JOB:
110+
111+
.. code-block:: bash
112+
113+
webchanges --test
114+
115+
107116
.. versionchanged:: 3.8
108117
Accepts negative indices.
109118

119+
.. versionchanged:: 3.10.2
120+
JOB no longer required (will only check the config and job files for errors).
110121

111122
.. _test-diff:
112123

@@ -140,9 +151,9 @@ Test a reporter
140151
---------------
141152
You can test a reporter by using the command line argument ``--test-reporter`` followed by the reporter name;
142153
:program:`webchanges` will create a dummy report and send it through the selected reporter. This will help in
143-
debugging issues, especially when used in conjunction with ``--verbose``::
154+
debugging issues, especially when used in conjunction with ``-vv``::
144155

145-
webchanges --verbose --test-reporter telegram
156+
webchanges -vv --test-reporter telegram
146157

147158

148159
.. versionchanged:: 3.9

docs/examples.rst

+12-8
Original file line numberDiff line numberDiff line change
@@ -254,23 +254,27 @@ or ignore all HTTP errors if you like by using :ref:`ignore_http_error_codes`
254254
ignore_http_error_codes: 4xx, 5xx
255255
256256
257-
Only receive short notifications containing the URL
257+
Receive short notifications only containing the URL
258258
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
259-
When using a reporter that uses text, the report -> text -> details setting can be set to false to avoid details and
260-
report just a summary. You can also set report -> text -> footer to false to make the report even shorter. You can also
261-
use the directive ``user_visible_url`` to customize the URL that is reported visible (e.g. watching a REST API
262-
endpoint, but wanting to show the "web-visible" URL in the report).
259+
If you only want to be alerted that there is a change without any information about the change itself, you can use a
260+
a reporter that uses text and set report -> text -> details to false to avoid details being sent; you can also set
261+
report -> text -> footer to false to make the report even shorter.
262+
263+
Don't forget that you can also use the directive :ref:`user_visible_url` to customize the URL that is reported visible
264+
(e.g. watching a REST API endpoint, but wanting to show the "web-visible" URL in the report).
265+
266+
If you want the alert for one job only (of many), consider using the :ref:`sha1sum` filter instead.
263267

264268
For example, for email set these in the configuration file (``webchanges --edit-config``):
265269

266270
.. code-block:: yaml
267271
268272
report:
269-
...
273+
# ...
270274
text:
271275
details: false
272276
footer: false
273-
...
277+
# ...
274278
email:
275279
html: false
276-
...
280+
# ...

docs/filters.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ detail, or saving large snapshots of data.
756756

757757
.. code-block:: yaml
758758
759-
name: "Calculate SHA-1 hash test"
759+
name: "Calculate SHA-1 hash"
760760
url: https://example.com/sha.html
761761
filter:
762762
- sha1sum:
@@ -1160,16 +1160,15 @@ Example:
11601160
filter:
11611161
- shellpipe: echo TEST
11621162
1163-
.. warning::
1164-
On Linux and macOS systems, due to security reasons the ``shellpipe`` filter will not run unless **both** the config
1165-
directory **and** the jobs file are both **owned** and **writeable** by **only** the user who is running the job
1166-
(and not by its group or by other users). To set this up:
1163+
.. important:: On Linux and macOS systems, due to security reasons the ``shellpipe`` filter will not run unless **both**
1164+
the jobs file **and** the directory it is located in are **owned** and **writeable** by **only** the user who is
1165+
running the job (and not by its group or by other users). To set this up:
11671166

11681167
.. code-block:: bash
11691168
11701169
cd ~/.config/webchanges # could be different
1171-
sudo chown $USER:$(id -g -n) *.yaml
1172-
sudo chmod go-w *.yaml
1170+
sudo chown $USER:$(id -g -n) . *.yaml
1171+
sudo chmod go-w . *.yaml
11731172
11741173
* ``sudo`` may or may not be required;
11751174
* If making the change from a different account than the one you run :program:`webchanges` from, replace

0 commit comments

Comments
 (0)