Package Details: python-requests-cache 1.2.0-1

Git Clone URL: https://aur.archlinux.org/python-requests-cache.git (read-only, click to copy)
Package Base: python-requests-cache
Description: A persistent cache for python requests
Upstream URL: https://github.com/requests-cache/requests-cache
Keywords: cache dynamodb http mongodb performance redis requests sqlite web webscraping
Licenses: custom:BSD-2-clause
Submitter: Shibumi
Maintainer: carlosal1015 (JWCook, flying-sheep, AutoUpdateBot)
Last Packager: AutoUpdateBot
Votes: 30
Popularity: 0.002846
First Submitted: 2015-09-21 13:55 (UTC)
Last Updated: 2024-02-18 07:57 (UTC)

Dependencies (24)

Sources (1)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 9 Next › Last »

bpierre commented on 2022-06-29 17:51 (UTC)

Using python-bson does not work for me:

cannot import name 'DEFAULT_CODEC_OPTIONS' from 'bson' (/usr/lib/python3.10/site-packages/bson/__init__.py)

(followed by the same nonsensical ImportError exception as before)

But with python-pymongo installed, everything works fine.

carlosal1015 commented on 2022-06-29 17:47 (UTC) (edited on 2022-06-29 17:48 (UTC) by carlosal1015)

Thank you for precise, I found

:: python-pymongo and python-bson are in conflict. Remove python-bson? [y/N]

When I have installed actually all optional dependencies, but I tested all combinations and the same error at check() function. I follow the suggestion to disable the tests and tell the problem to python-requests-cache upstream.

From my side, when install python-pymongo the error still happening.

bpierre commented on 2022-06-29 17:44 (UTC)

Just to be clear: the tests work fine once the missing dependency is present (python-pymongo). There's no need for the patched cattrs, as the problem is with some exception handling code when failing to import a dependency.

bpierre commented on 2022-06-29 16:27 (UTC)

IMHO that code in requests_cache/__init__.py that unconditionally ignore import errors, only showing a warning, is problematic: https://github.com/requests-cache/requests-cache/blob/main/requests_cache/__init__.py

bpierre commented on 2022-06-29 16:22 (UTC)

OK, so the issue goes away once python-pymongo is available, so there's no need for the patched cattrs (which is a fix related to exception handling).

bpierre commented on 2022-06-29 16:17 (UTC)

Scratch that last comment about bson, it's provided by python-pymongo, and now necessary, along with python-ujson, for running the tests (even when ignoring the integration tests).

carlosal1015 commented on 2022-06-29 16:13 (UTC) (edited on 2022-06-29 16:14 (UTC) by carlosal1015)

Thanks @bpierre for quick response.

Should python-cattrs add this patch or change something here? If we write something like import cattrs; cattrs.foo() that shows an unexpected behavior will be appreciated.

I will try adding python-bson as checkdependency as first but it is unusual since that is not required in the past. Thank you very much for the hint.

bpierre commented on 2022-06-29 16:01 (UTC)

The initial exception occurs in cattr:

    from cattr import GenConverter
  File "/usr/lib/python3.10/site-packages/cattr/__init__.py", line 1, in <module>
    from .converters import Converter, GenConverter, UnstructureStrategy
  File "/usr/lib/python3.10/site-packages/cattr/converters.py", line 1, in <module>
    from cattrs.converters import Converter, GenConverter, UnstructureStrategy
  File "/usr/lib/python3.10/site-packages/cattrs/__init__.py", line 1, in <module>
    from cattr import converters, disambiguators, dispatch, errors, gen, preconf
  File "/usr/lib/python3.10/site-packages/cattr/disambiguators.py", line 15, in <module>
    from cattrs._compat import get_origin
  File "/usr/lib/python3.10/site-packages/cattrs/_compat.py", line 38, in <module>
    from exceptiongroup import ExceptionGroup
ModuleNotFoundError: No module named 'exceptiongroup'

It's fixed in main, but no released yet: https://github.com/python-attrs/cattrs/commit/4f0840c8e48ce0123fc742148859155499fc502b

It looks like you're also missing a dependency on bson.

carlosal1015 commented on 2022-06-29 15:40 (UTC) (edited on 2022-06-29 15:51 (UTC) by carlosal1015)

Hi, I have the following message error

==> Starting check()...
No module named 'exceptiongroup'
ImportError while loading conftest '/tmp/makepkg/python-requests-cache/src/requests-cache-0.9.4/tests/conftest.py'.
tests/conftest.py:24: in <module>
    from requests_cache import ALL_METHODS, CachedSession, install_cache, uninstall_cache
E   ImportError: cannot import name 'ALL_METHODS' from 'requests_cache' (/tmp/makepkg/python-requests-cache/src/requests-cache-0.9.4/requests_cache/__init__.py)
==> ERROR: A failure occurred in check().

if someone understand this message or suggest solution, please explain above.

See more here.

carlosal1015 commented on 2022-03-22 13:35 (UTC)

Hi @kIERO, I can confirm some differences when we install with python-install and python-installer in skimpy (not working with python-installer if we mix commands install or installer). I will look more, but for requests-cache is working with both ways.