Skip to content

Commit

Permalink
s/READER_USE_SYSTEM_FEEDPARSER/READER_NO_VENDORED_FEEDPARSER/. #350
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon24 committed Oct 14, 2024
1 parent d016913 commit e762eb3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Unreleased
:attr:`~.RetrievedFeed.caching_info`).
* The ``HTTPAcceptParserType`` was renamed to :class:`.AcceptParserType`.

* Allow :ref:`using the system-installed feedparser <use-system-feedparser>`
* Allow :ref:`using the installed feedparser <no-vendored-feedparser>`
instead of the one vendored by *reader*.
This is useful for working around issues in the vendored feedparser,
like the libxml2 <=2.13.3 incompatibility reported in :issue:`350`;
Expand Down
6 changes: 3 additions & 3 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ These packages will be installed automatically when installing *reader*:
(at least SQLite 3.18 with the `JSON1`_ and `FTS5`_ extensions).


.. _use-system-feedparser:
.. _no-vendored-feedparser:

.. note::

Because `feedparser`_ makes PyPI releases at a lower cadence,
*reader* uses a vendored version of feedparser's `develop`_ branch
by default since :ref:`version 2.9`.
To opt out of this behavior, and make *reader* use
the system-installed ``feedparser`` package,
set the ``READER_USE_SYSTEM_FEEDPARSER`` environment variable to ``1``.
the installed ``feedparser`` package,
set the ``READER_NO_VENDORED_FEEDPARSER`` environment variable to ``1``.

.. _develop: https://github.com/kurtmckee/feedparser

Expand Down
2 changes: 1 addition & 1 deletion src/reader/_parser/feedparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ._http_utils import unparse_accept_header


if os.environ.get('READER_USE_SYSTEM_FEEDPARSER', '') not in ('', '0'):
if os.environ.get('READER_NO_VENDORED_FEEDPARSER', '') not in ('', '0'):
import feedparser # type: ignore
else:
from .._vendor import feedparser
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ def test_reader_use_system_feedparser(monkeypatch, reload_module):
import reader._parser.feedparser
import reader._vendor.feedparser

name = 'READER_USE_SYSTEM_FEEDPARSER'
name = 'READER_NO_VENDORED_FEEDPARSER'

monkeypatch.delenv(name, raising=False)
reload_module(reader._parser.feedparser)
Expand Down

0 comments on commit e762eb3

Please sign in to comment.