Index | Thread | Search

From:
Stuart Henderson <stu@spacehopper.org>
Subject:
py-vcrpy update
To:
Pamela Mosiejczuk <pamela@openbsd.org>
Cc:
ports <ports@openbsd.org>
Date:
Fri, 22 Nov 2024 15:03:59 +0000

Download raw body.

Thread
  • Stuart Henderson:

    py-vcrpy update

[oops, resending with a Subject line.]

Here's an update to py-vcrpy, it's on the path to updating aiohttp, but can
be updated before too.

Tests aren't squeaky clean but it feels like most issues could be on the
pytest-httpbin side rather than the client here. There's also one which
is a file missing in the sdist (.editorconfig). But overall it looks
pretty good, 11 failed, 361 passed, 24 skipped, 84 deselected in 23.72s

Fewer failures than the version in tree.

I removed the patches to disable online tests; there are many other than
those that haven't been disabled, it's helpful to be able to run them
by allowing them through PF - and the errors are pretty easy to spot.
I disabled https tests in bulk with "-k 'not https'" because they're
resulting in SSLCertVerificationError so are just causing noise.

Breaking changes in changelog are not particularly scary, I don't think
we need to worry about them.

Requires devel/py-test-aiohttp from
https://marc.info/?l=openbsd-ports&m=173228642920154&w=2
$ ftp -o /tmp/aiohttp-deps.tgz 'https://marc.info/?l=openbsd-ports&m=173228642920154&q=p3'

OK for when py-test-aiohttp is imported?

v6.0.2
    Ensure body is consumed only once (#846) - thanks @sathieu
    Permit urllib3 2.x for non-PyPy Python >=3.10
    Fix typos in test commands - thanks @chuckwondo
    Several test and workflow improvements - thanks @hartwork and @graingert

v6.0.1
    Bugfix with to Tornado cassette generator (thanks @graingert)

v6.0.0
    BREAKING: Fix issue with httpx support (thanks @parkerhancock) in #784. NOTE: You may have to recreate some of your cassettes produced in previous releases due to the binary format being saved incorrectly in previous releases
    BREAKING: Drop support for boto (vcrpy still supports boto3, but is dropping the deprecated boto support in this release. (thanks @jairhenrique)
    Fix compatibility issue with Python 3.12 (thanks @hartwork)
    Drop simplejson (fixes some compatibility issues) (thanks @jairhenrique)
    Run CI on Python 3.12 and PyPy 3.9-3.10 (thanks @mgorny)
    Various linting and docs improvements (thanks @jairhenrique)
    Tornado fixes (thanks @graingert)

v5.1.0
    Use ruff for linting (instead of current flake8/isort/pyflakes) - thanks @jairhenrique
    Enable rule B (flake8-bugbear) on ruff - thanks @jairhenrique
    Configure read the docs V2 - thanks @jairhenrique
    Fix typo in docs - thanks @quasimik
    Make json.loads of Python >=3.6 decode bytes by itself - thanks @hartwork
    Fix body matcher for chunked requests (fixes #734) - thanks @hartwork
    Fix query param filter for aiohttp (fixes #517) - thanks @hartwork and @salomvary
    Remove unnecessary dependency on six. - thanks @charettes
    build(deps): update sphinx requirement from <7 to <8 - thanks @jairhenrique
    Add action to validate docs - thanks @jairhenrique
    Add editorconfig file - thanks @jairhenrique
    Drop iscoroutinefunction fallback function for unsupported python thanks @jairhenrique

v5.0.0
    BREAKING CHANGE: Drop support for Python 3.7. 3.7 is EOL as of 6/27/23 Thanks @jairhenrique
    BREAKING CHANGE: Custom Cassette persisters no longer catch ValueError. If you have implemented a custom persister (has anyone implemented a custom persister? Let us know!) then you will need to throw a CassetteNotFoundError when unable to find a cassette. See #681 for discussion and reason for this change. Thanks @amosjyng for the PR and the review from @hartwork

v4.4.0
    HUGE thanks to @hartwork for all the work done on this release!
    Bring vcr/unittest in to vcrpy as a full feature of vcr instead of a separate library. Big thanks to @hartwork for doing this and to @agriffis for originally creating the library
    Make decompression robust towards already decompressed input (thanks @hartwork)
    Bugfix: Add read1 method (fixes compatibilitywith biopython), thanks @mghantous
    Bugfix: Prevent filters from corrupting request (thanks @abramclark)
    Bugfix: Add support for response.raw.stream() to fix urllib v2 compat
    Bugfix: Replace assert with raise AssertionError: fixes support for PYTHONOPTIMIZE=1
    Add pytest.mark.online to run test suite offline, thanks @jspricke
    use python3 and pip3 binaries to ease debian packaging (thanks @hartwork)
    Add codespell (thanks @mghantous)

v4.3.1
    Support urllib3 v1 and v2. NOTE: there is an issue running urllib3 v2 on Python older than 3.10, so this is currently blocked in the requirements.
    Hopefully we can resolve this situation in the future. Thanks to @shifqu, @hartwork, @jairhenrique, @pquentin, and @vEpiphyte for your work on this.

v4.3.0
    Add support for Python 3.11 (Thanks @evgeni)
    Drop support for botocore <1.11.0 and requests <2.16.2 (thanks @hartwork)
    Bugfix: decode_compressed_response raises exception on empty responses. Thanks @CharString
    Don't save requests from decorated tests if decorated test fails (thanks @dan-passaro)
    Fix not calling all the exit stack when record_on_exception is False (thanks @Terseus)
    Various CI, documentation, testing, and formatting improvements (Thanks @jairhenrique, @dan-passaro, @hartwork, and Terseus)



Index: Makefile
===================================================================
RCS file: /cvs/ports/www/py-vcrpy/Makefile,v
diff -u -p -r1.10 Makefile
--- Makefile	6 May 2024 12:24:16 -0000	1.10
+++ Makefile	22 Nov 2024 14:49:21 -0000
@@ -1,9 +1,8 @@
 COMMENT =		automatically mock HTTP interactions to speed testing
 
-MODPY_EGG_VERSION =	4.2.1
+MODPY_EGG_VERSION =	6.0.2
 DISTNAME =		vcrpy-${MODPY_EGG_VERSION}
 PKGNAME =		py-vcrpy-${MODPY_EGG_VERSION}
-REVISION =		0
 
 CATEGORIES =		www
 
@@ -21,12 +20,24 @@ MODPY_PI =		Yes
 FLAVORS =		python3
 FLAVOR =		python3
 
-RUN_DEPENDS =		devel/py-six${MODPY_FLAVOR} \
-			devel/py-wrapt${MODPY_FLAVOR} \
+RUN_DEPENDS =		devel/py-wrapt${MODPY_FLAVOR} \
 			textproc/py-yaml${MODPY_FLAVOR} \
+			www/py-urllib3${MODPY_FLAVOR} \
 			www/py-yarl${MODPY_FLAVOR}
 
+# these fail with ssl errors
+MODPY_PYTEST_ARGS =	-k 'not https'
+
 TEST_DEPENDS =		devel/py-mock${MODPY_FLAVOR} \
-			devel/py-test-httpbin${MODPY_FLAVOR}
+			devel/py-test-aiohttp${MODPY_FLAVOR} \
+			devel/py-test-asyncio${MODPY_FLAVOR} \
+			devel/py-test-cov${MODPY_FLAVOR} \
+			devel/py-test-httpbin${MODPY_FLAVOR} \
+			net/py-boto3${MODPY_FLAVOR} \
+			www/py-aiohttp${MODPY_FLAVOR} \
+			www/py-httplib2${MODPY_FLAVOR} \
+			www/py-httpx${MODPY_FLAVOR} \
+			www/py-requests${MODPY_FLAVOR} \
+			www/py-tornado${MODPY_FLAVOR}
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/www/py-vcrpy/distinfo,v
diff -u -p -r1.2 distinfo
--- distinfo	12 Jan 2023 13:14:43 -0000	1.2
+++ distinfo	22 Nov 2024 14:49:21 -0000
@@ -1,2 +1,2 @@
-SHA256 (vcrpy-4.2.1.tar.gz) = fNPoGixJLgHCgfGAvMKoa1ILFz0rZWy12J2ZR1Qj4BM=
-SIZE (vcrpy-4.2.1.tar.gz) = 78895
+SHA256 (vcrpy-6.0.2.tar.gz) = iOE9kRGEZ0WJhBHbx0p1zoWHCvlt0yDXXx7jMVit3Ak=
+SIZE (vcrpy-6.0.2.tar.gz) = 85472
Index: patches/patch-tests_integration_test_urllib2_py
===================================================================
RCS file: patches/patch-tests_integration_test_urllib2_py
diff -N patches/patch-tests_integration_test_urllib2_py
--- patches/patch-tests_integration_test_urllib2_py	12 Jan 2023 13:14:43 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-_pbuild user is blocked from accessing the Internet
-
-Index: tests/integration/test_urllib2.py
---- tests/integration/test_urllib2.py.orig
-+++ tests/integration/test_urllib2.py
-@@ -56,16 +56,16 @@ def test_response_headers(httpbin_both, tmpdir):
-         assert sorted(open1) == sorted(open2)
- 
- 
--def test_effective_url(tmpdir):
--    """Ensure that the effective_url is captured"""
--    url = "http://mockbin.org/redirect/301"
--
--    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
--        effective_url = urlopen_with_cafile(url).geturl()
--        assert effective_url == "http://mockbin.org/redirect/301/0"
--
--    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
--        assert effective_url == urlopen_with_cafile(url).geturl()
-+#def test_effective_url(tmpdir):
-+#    """Ensure that the effective_url is captured"""
-+#    url = "http://mockbin.org/redirect/301"
-+#
-+#    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
-+#        effective_url = urlopen_with_cafile(url).geturl()
-+#        assert effective_url == "http://mockbin.org/redirect/301/0"
-+#
-+#    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
-+#        assert effective_url == urlopen_with_cafile(url).geturl()
- 
- 
- def test_multiple_requests(httpbin_both, tmpdir):
Index: patches/patch-tests_unit_test_stubs_py
===================================================================
RCS file: patches/patch-tests_unit_test_stubs_py
diff -N patches/patch-tests_unit_test_stubs_py
--- patches/patch-tests_unit_test_stubs_py	12 Jan 2023 13:14:43 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-_pbuild user is blocked from accessing the Internet
-
-Index: tests/unit/test_stubs.py
---- tests/unit/test_stubs.py.orig
-+++ tests/unit/test_stubs.py
-@@ -11,9 +11,9 @@ class TestVCRConnection:
-         vcr_connection.ssl_version = "example_ssl_version"
-         assert vcr_connection.real_connection.ssl_version == "example_ssl_version"
- 
--    @mock.patch("vcr.cassette.Cassette.can_play_response_for", return_value=False)
--    def testing_connect(*args):
--        vcr_connection = VCRHTTPSConnection("www.google.com")
--        vcr_connection.cassette = Cassette("test", record_mode=mode.ALL)
--        vcr_connection.real_connection.connect()
--        assert vcr_connection.real_connection.sock is not None
-+    #@mock.patch("vcr.cassette.Cassette.can_play_response_for", return_value=False)
-+    #def testing_connect(*args):
-+    #    vcr_connection = VCRHTTPSConnection("www.google.com")
-+    #    vcr_connection.cassette = Cassette("test", record_mode=mode.ALL)
-+    #    vcr_connection.real_connection.connect()
-+    #    assert vcr_connection.real_connection.sock is not None
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/www/py-vcrpy/pkg/PLIST,v
diff -u -p -r1.5 PLIST
--- pkg/PLIST	12 Jan 2023 13:14:43 -0000	1.5
+++ pkg/PLIST	22 Nov 2024 14:49:21 -0000
@@ -26,6 +26,8 @@ lib/python${MODPY_VERSION}/site-packages
 lib/python${MODPY_VERSION}/site-packages/vcr/${MODPY_PYCACHE}request.${MODPY_PYC_MAGIC_TAG}pyc
 lib/python${MODPY_VERSION}/site-packages/vcr/${MODPY_PYCACHE}serialize.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 lib/python${MODPY_VERSION}/site-packages/vcr/${MODPY_PYCACHE}serialize.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/vcr/${MODPY_PYCACHE}unittest.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
+lib/python${MODPY_VERSION}/site-packages/vcr/${MODPY_PYCACHE}unittest.${MODPY_PYC_MAGIC_TAG}pyc
 lib/python${MODPY_VERSION}/site-packages/vcr/${MODPY_PYCACHE}util.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 lib/python${MODPY_VERSION}/site-packages/vcr/${MODPY_PYCACHE}util.${MODPY_PYC_MAGIC_TAG}pyc
 ${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/vcr/_handle_coroutine.py
@@ -70,8 +72,6 @@ lib/python${MODPY_VERSION}/site-packages
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/${MODPY_PYCACHE}aiohttp_stubs.${MODPY_PYC_MAGIC_TAG}pyc
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/${MODPY_PYCACHE}boto3_stubs.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/${MODPY_PYCACHE}boto3_stubs.${MODPY_PYC_MAGIC_TAG}pyc
-lib/python${MODPY_VERSION}/site-packages/vcr/stubs/${MODPY_PYCACHE}boto_stubs.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
-lib/python${MODPY_VERSION}/site-packages/vcr/stubs/${MODPY_PYCACHE}boto_stubs.${MODPY_PYC_MAGIC_TAG}pyc
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/${MODPY_PYCACHE}compat.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/${MODPY_PYCACHE}compat.${MODPY_PYC_MAGIC_TAG}pyc
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/${MODPY_PYCACHE}httplib2_stubs.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
@@ -86,13 +86,13 @@ lib/python${MODPY_VERSION}/site-packages
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/${MODPY_PYCACHE}urllib3_stubs.${MODPY_PYC_MAGIC_TAG}pyc
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/aiohttp_stubs.py
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/boto3_stubs.py
-lib/python${MODPY_VERSION}/site-packages/vcr/stubs/boto_stubs.py
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/compat.py
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/httplib2_stubs.py
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/httpx_stubs.py
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/requests_stubs.py
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/tornado_stubs.py
 lib/python${MODPY_VERSION}/site-packages/vcr/stubs/urllib3_stubs.py
+lib/python${MODPY_VERSION}/site-packages/vcr/unittest.py
 lib/python${MODPY_VERSION}/site-packages/vcr/util.py
 lib/python${MODPY_VERSION}/site-packages/vcrpy-${MODPY_EGG_VERSION}.dist-info/
 lib/python${MODPY_VERSION}/site-packages/vcrpy-${MODPY_EGG_VERSION}.dist-info/LICENSE.txt

----- End forwarded message -----