diff options
-rw-r--r-- | .github/workflows/deploy.yml | 5 | ||||
-rw-r--r-- | docs/advanced_usage.md | 4 | ||||
-rw-r--r-- | poetry.lock | 41 | ||||
-rw-r--r-- | pyproject.toml | 12 | ||||
-rw-r--r-- | tests/integration/base_cache_test.py | 4 |
5 files changed, 34 insertions, 32 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 65b2e71..8bdb89f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: python-version: [3.7] - requests-version: [2.17, 2.18, 2.19, 2.20.1, 2.21, 2.22, 2.23, 2.24, latest] + requests-version: [2.22, 2.23, 2.24, 2.25, latest] fail-fast: false services: nginx: @@ -69,12 +69,11 @@ jobs: poetry install -v -E all # Run unit + integration tests, with additional stress tests - # Skip test for streaming responses; requires requests >= 2.19 (tested on latest version in build.yml) - name: Run tests run: | source $VENV pytest --numprocesses=auto tests/unit - pytest tests/integration -k 'not test_response_decode' + pytest tests/integration STRESS_TEST_MULTIPLIER=5 pytest tests/integration/ -k 'multithreaded' # Deploy stable builds on tags only, and pre-release builds from manual trigger ("workflow_dispatch") diff --git a/docs/advanced_usage.md b/docs/advanced_usage.md index 433721b..2e89fc0 100644 --- a/docs/advanced_usage.md +++ b/docs/advanced_usage.md @@ -262,10 +262,6 @@ It can be used, for example, for request throttling: ::: ### Streaming Requests -:::{note} -This feature requires `requests >= 2.19` -::: - If you use [streaming requests](https://2.python-requests.org/en/master/user/advanced/#id9), you can use the same code to iterate over both cached and non-cached requests. A cached request will, of course, have already been read, but will use a file-like object containing the content: diff --git a/poetry.lock b/poetry.lock index 5367c31..2364d27 100644 --- a/poetry.lock +++ b/poetry.lock @@ -85,29 +85,35 @@ lxml = ["lxml"] [[package]] name = "boto3" -version = "1.16.63" +version = "1.18.21" description = "The AWS SDK for Python" category = "main" optional = true -python-versions = "*" +python-versions = ">= 3.6" [package.dependencies] -botocore = ">=1.19.63,<1.20.0" +botocore = ">=1.21.21,<1.22.0" jmespath = ">=0.7.1,<1.0.0" -s3transfer = ">=0.3.0,<0.4.0" +s3transfer = ">=0.5.0,<0.6.0" + +[package.extras] +crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.19.63" +version = "1.21.21" description = "Low-level, data-driven core of boto 3." category = "main" optional = true -python-versions = "*" +python-versions = ">= 3.6" [package.dependencies] jmespath = ">=0.7.1,<1.0.0" python-dateutil = ">=2.1,<3.0.0" -urllib3 = {version = ">=1.25.4,<1.27", markers = "python_version != \"3.4\""} +urllib3 = ">=1.25.4,<1.27" + +[package.extras] +crt = ["awscrt (==0.11.24)"] [[package]] name = "bson" @@ -814,15 +820,18 @@ jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"] [[package]] name = "s3transfer" -version = "0.3.7" +version = "0.5.0" description = "An Amazon S3 Transfer Manager" category = "main" optional = true -python-versions = "*" +python-versions = ">= 3.6" [package.dependencies] botocore = ">=1.12.36,<2.0a.0" +[package.extras] +crt = ["botocore[crt] (>=1.20.29,<2.0a.0)"] + [[package]] name = "six" version = "1.16.0" @@ -1158,7 +1167,7 @@ yaml = [] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "d766957ab49962cd19a270f70dcecba509dec7283eb54faeb264399b0f795530" +content-hash = "592264f6e0d84c2e283ee128bf9cc4747752860f72f864baed460a31373ce143" [metadata.files] alabaster = [ @@ -1191,12 +1200,12 @@ beautifulsoup4 = [ {file = "beautifulsoup4-4.9.3.tar.gz", hash = "sha256:84729e322ad1d5b4d25f805bfa05b902dd96450f43842c4e99067d5e1369eb25"}, ] boto3 = [ - {file = "boto3-1.16.63-py2.py3-none-any.whl", hash = "sha256:1c0003609e63e8cff51dee7a49e904bcdb20e140b5f7a10a03006289fd8c8dc1"}, - {file = "boto3-1.16.63.tar.gz", hash = "sha256:c919dac9773115025e1e2a7e462f60ca082e322bb6f4354247523e4226133b0b"}, + {file = "boto3-1.18.21-py3-none-any.whl", hash = "sha256:59b6e8e79b2114e21388288a06a004f2a9378b1e0fc58466a35da8fb74fe2dd8"}, + {file = "boto3-1.18.21.tar.gz", hash = "sha256:00748c760dc30be61c6db4b092718f6a9f8d27c767da0e232695a65adb75cde8"}, ] botocore = [ - {file = "botocore-1.19.63-py2.py3-none-any.whl", hash = "sha256:ad4adfcc195b5401d84b0c65d3a89e507c1d54c201879c8761ff10ef5c361e21"}, - {file = "botocore-1.19.63.tar.gz", hash = "sha256:d3694f6ef918def8082513e5ef309cd6cd83b612e9984e3a66e8adc98c650a92"}, + {file = "botocore-1.21.21-py3-none-any.whl", hash = "sha256:fa5ac13829d24fcdd385e82c3b6d78e22d93f427cca8dac38158cae84a8cc2f5"}, + {file = "botocore-1.21.21.tar.gz", hash = "sha256:12cfe74b0a5c44afb34bdd86c1f8ad74bc2ad9ec168eaed9040ef70cb3db944f"}, ] bson = [ {file = "bson-0.5.10.tar.gz", hash = "sha256:d6511b2ab051139a9123c184de1a04227262173ad593429d21e443d6462d6590"}, @@ -1680,8 +1689,8 @@ rich = [ {file = "rich-10.7.0.tar.gz", hash = "sha256:13ac80676e12cf528dc4228dc682c8402f82577c2aa67191e294350fa2c3c4e9"}, ] s3transfer = [ - {file = "s3transfer-0.3.7-py2.py3-none-any.whl", hash = "sha256:efa5bd92a897b6a8d5c1383828dca3d52d0790e0756d49740563a3fb6ed03246"}, - {file = "s3transfer-0.3.7.tar.gz", hash = "sha256:35627b86af8ff97e7ac27975fe0a98a312814b46c6333d8a6b889627bcd80994"}, + {file = "s3transfer-0.5.0-py3-none-any.whl", hash = "sha256:9c1dc369814391a6bda20ebbf4b70a0f34630592c9aa520856bf384916af2803"}, + {file = "s3transfer-0.5.0.tar.gz", hash = "sha256:50ed823e1dc5868ad40c8dc92072f757aa0e653a192845c94a3b676f4a62da4c"}, ] six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, diff --git a/pyproject.toml b/pyproject.toml index 9357d40..5145693 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,22 +23,24 @@ include = [ python = "^3.7" attrs = "^21.2" cattrs = "^1.8" -itsdangerous = ">=2.0" -requests = "^2.17" +itsdangerous = "^2.0" +requests = "^2.22" +urllib3 = "^1.25.4" url-normalize = "^1.4" # Optional serialization dependencies bson = {version = ">=0.5", optional = true} +pyyaml = {version = ">=5.4", optional = true} ujson = {version = ">=4.0", optional = true} # Optional backend dependencies -boto3 = { version = "~=1.16.0", optional = true } -botocore = { version = "~=1.19.0", optional = true } +boto3 = { version = "^1.15", optional = true } +botocore = { version = "^1.18", optional = true } pymongo = { version = "^3.0", optional = true } -pyyaml = {version = ">=5.4", optional = true} redis = { version = "^3.0", optional = true } # Documentation dependencies needed for Readthedocs builds (rtd doesn't support poetry.dev-dependencies) +# [tool.poetry.dev-dependencies] furo = {version = ">=2021.6.24-beta.37", optional = true} myst-parser = {version = "^0.15.1", optional = true} Sphinx = { version = "4.1.2", optional = true } diff --git a/tests/integration/base_cache_test.py b/tests/integration/base_cache_test.py index 0243201..14292c2 100644 --- a/tests/integration/base_cache_test.py +++ b/tests/integration/base_cache_test.py @@ -8,7 +8,6 @@ from typing import Dict, Type from urllib.parse import parse_qs, urlparse import pytest -import requests from requests.models import PreparedRequest from requests_cache import ALL_METHODS, CachedResponse, CachedSession @@ -26,8 +25,6 @@ from tests.conftest import ( httpbin, ) -REQUESTS_VERSION = tuple([int(v) for v in requests.__version__.split('.')]) - # Handle optional dependencies if they're not installed; if so, skips will be shown in pytest output TEST_SERIALIZERS = SERIALIZERS.copy() try: @@ -154,7 +151,6 @@ class BaseCacheTest: else: assert_delta_approx_equal(now, response.expires, expected_expiration) - @pytest.mark.skipif(REQUESTS_VERSION < (2, 19), reason='Streaming requests require requests 2.19+') @pytest.mark.parametrize('stream', [True, False]) def test_response_decode(self, stream): """Test that gzip-compressed raw responses (including streamed responses) can be manually |