From c6731c98d4b7b3d25886a71baaec08cd4634b2e8 Mon Sep 17 00:00:00 2001 From: mikedarcy Date: Mon, 27 Sep 2021 16:05:31 -0700 Subject: [PATCH] Fix bug in `bdbag_api.validate()` where underlying `BagError` exceptions were not being propagated correctly. Add an environment marker to `setup.py` for the `python-requests` dependency. This marker specifies that no greater than `requests-2.25.1` be used with `Python3.5` environments, due to underlying incompatibilities with `requests` dependency chain and `Python3.5` after `requests-2.26.0`. Update CHANGELOG.md. Update Pipfile.lock. Bump version. --- CHANGELOG.md | 7 +++++ Pipfile.lock | 70 ++++++++++++++++------------------------------ bdbag/__init__.py | 2 +- bdbag/bdbag_api.py | 2 +- setup.py | 1 + 5 files changed, 34 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5708e88..59d164d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGE LOG +## 1.6.3 +* Fix bug in `bdbag_api.validate()` where underlying `BagError` exceptions were not being propagated correctly. +* Add an environment marker to `setup.py` for the `python-requests` dependency. This marker specifies that no greater +than `requests-2.25.1` be used with `Python3.5` environments, due to underlying incompatibilities with `requests` dependency +chain and `Python3.5` after `requests-2.26.0`. Reported in issue [#47](https://github.com/fair-research/bdbag/issues/47). +Note that `bdbag` support for `Python3.5` is planned to be dropped in the `1.7.0` release. + ## 1.6.2 * Set "User-Agent" header for HTTP fetch handler (via `python-requests`) to `"bdbag/{version} (requests/{version})"`. * Added `sha1` support for `bdbag_utils` function `create-rfm-from-url-list`. See PR [#46](https://github.com/fair-research/bdbag/pull/46). diff --git a/Pipfile.lock b/Pipfile.lock index 952ef91..e479d15 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -16,11 +16,11 @@ "default": { "awscli": { "hashes": [ - "sha256:7e2bd6acbf8ea35420cc8554290480181197951e31dfc69ee7b5dedfb0e4f6a1", - "sha256:8d6dd12d84e5d9e071e25389776d5539a642dfe232caefacfcdb649ba4234fd6" + "sha256:321b4c712ec88570167f2bedfc24ab20a5f0570afc3efa83abe1754dced9873f", + "sha256:e307c0d96dbd4a49ce86225872129144d6c7eb196876196af83741535462fede" ], "markers": "python_version >= '3.6'", - "version": "==1.20.34" + "version": "==1.20.49" }, "bagit": { "hashes": [ @@ -47,19 +47,19 @@ }, "boto3": { "hashes": [ - "sha256:5116e9bdec19adcc5531a9b7b535be77d5314eef092aaf7033ace48a9be65036", - "sha256:658ddf4ba552f654fd4d48335fa95ff4e3e1a4e82f90021a1a1d3de4a5428ba4" + "sha256:1a2908d2829268f1b2355bad3a96bfdc8e41523629b5d958bcedfc35d2d232dd", + "sha256:e520655c9caf2f21853644d88b59b1c32bc44ccd58b20574883b25eb6256d938" ], "markers": "python_version >= '3.6'", - "version": "==1.18.34" + "version": "==1.18.49" }, "botocore": { "hashes": [ - "sha256:1b4999fb0e1a4c050c4d9118ebdaac8d83761ef32c3c0f13a25f9204045998fe", - "sha256:ec2cdf1c8ed64a7f392f352125d248c76103fa9d137b275b7c76836776cedf56" + "sha256:0161c3b64e34315928aae7fdbce49e684c9c2cfad2435cb22023b7ad87306f12", + "sha256:eab89183f7d94cabacde79a266060bb9429249e33a39b7ba4c1b15c965095477" ], "markers": "python_version >= '3.6'", - "version": "==1.21.34" + "version": "==1.21.49" }, "certifi": { "hashes": [ @@ -120,11 +120,11 @@ }, "charset-normalizer": { "hashes": [ - "sha256:0c8911edd15d19223366a194a513099a302055a962bca2cec0f54b8b63175d8b", - "sha256:f23667ebe1084be45f6ae0538e4a5a865206544097e4e8bbcacf42cd02a348f3" + "sha256:5d209c0a931f215cee683b6445e2d77677e7e75e159f78def0db09d68fafcaa6", + "sha256:5ec46d183433dcbd0ab716f2d7f29d8dee50505b3fdb40c6b985c7c4f5a3591f" ], "markers": "python_version >= '3'", - "version": "==2.0.4" + "version": "==2.0.6" }, "colorama": { "hashes": [ @@ -141,8 +141,10 @@ "sha256:21ca464b3a4b8d8e86ba0ee5045e103a1fcfac3b39319727bc0fc58c09c6aff7", "sha256:34dae04a0dce5730d8eb7894eab617d8a70d0c97da76b905de9efb7128ad7085", "sha256:3520667fda779eb788ea00080124875be18f2d8f0848ec00733c0ec3bb8219fc", + "sha256:3c4129fc3fdc0fa8e40861b5ac0c673315b3c902bbdc05fc176764815b43dd1d", "sha256:3fa3a7ccf96e826affdf1a0a9432be74dc73423125c8f96a909e3835a5ef194a", "sha256:5b0fbfae7ff7febdb74b574055c7466da334a5371f253732d7e2e7525d570498", + "sha256:695104a9223a7239d155d7627ad912953b540929ef97ae0c34c7b8bf30857e89", "sha256:8695456444f277af73a4877db9fc979849cd3ee74c198d04fc0776ebc3db52b9", "sha256:94cc5ed4ceaefcbe5bf38c8fba6a21fc1d365bb8fb826ea1688e3370b2e24a1c", "sha256:94fff993ee9bc1b2440d3b7243d488c6a3d9724cc2b09cdb297f6a886d040ef7", @@ -167,11 +169,11 @@ }, "globus-sdk": { "hashes": [ - "sha256:73bc2f0cbde92fa505eda40e7f131d749f55c0d4f6459151e421ab617a5011c8", - "sha256:94225982da7596f5bc8cd3dc30a4746014bf1f501cc8b23fe4dfd230114ae7e6" + "sha256:a715475779a8397b85f2c789f33666e92d81f567df15e285040ef400a98edd1d", + "sha256:d1bfbc2fa211524673ce693078e67f3270cef68d7dad564e767f04ec0af45356" ], "markers": "python_version >= '3.6'", - "version": "==2.0.1" + "version": "==3.0.1" }, "idna": { "hashes": [ @@ -220,10 +222,11 @@ "crypto" ], "hashes": [ - "sha256:5c6eca3c2940464d106b99ba83b00c6add741c9becaec087fb7ccdefea71350e", - "sha256:8d59a976fb773f3e6a39c85636357c4f0e242707394cadadd9814f5cbaa20e96" + "sha256:934d73fbba91b0483d3857d1aff50e96b2a892384ee2c17417ed3203f173fca1", + "sha256:fba44e7898bbca160a2b2b501f492824fc8382485d3a6f11ba5d0c1937ce6130" ], - "version": "==1.7.1" + "markers": "python_version >= '3.6'", + "version": "==2.1.0" }, "python-dateutil": { "hashes": [ @@ -330,11 +333,11 @@ }, "urllib3": { "hashes": [ - "sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4", - "sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f" + "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", + "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.6" + "version": "==1.26.7" } }, "develop": { @@ -404,14 +407,6 @@ "index": "pypi", "version": "==3.9.2" }, - "importlib-metadata": { - "hashes": [ - "sha256:b618b6d2d5ffa2f16add5697cf57a46c76a56229b0ed1c438322e4e95645bd15", - "sha256:f284b3e11256ad1e5d03ab86bb2ccd6f5339688ff17a4d797a0fe7df326f23b1" - ], - "markers": "python_version < '3.8'", - "version": "==4.8.1" - }, "mccabe": { "hashes": [ "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", @@ -442,23 +437,6 @@ ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.3.1" - }, - "typing-extensions": { - "hashes": [ - "sha256:49f75d16ff11f1cd258e1b988ccff82a3ca5570217d7ad8c5f48205dd99a677e", - "sha256:d8226d10bc02a29bcc81df19a26e56a9647f8b0a6d4a83924139f4a8b01f17b7", - "sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34" - ], - "markers": "python_version < '3.8'", - "version": "==3.10.0.2" - }, - "zipp": { - "hashes": [ - "sha256:957cfda87797e389580cb8b9e3870841ca991e2125350677b2ca83a0e99390a3", - "sha256:f5812b1e007e48cff63449a5e9f4e7ebea716b4111f9c4f9a645f91d579bf0c4" - ], - "markers": "python_version >= '3.6'", - "version": "==3.5.0" } } } diff --git a/bdbag/__init__.py b/bdbag/__init__.py index 1a6bba3..7985a8b 100644 --- a/bdbag/__init__.py +++ b/bdbag/__init__.py @@ -25,7 +25,7 @@ from distutils.util import strtobool from pkg_resources import parse_version, get_distribution, DistributionNotFound -__version__ = "1.6.2" +__version__ = "1.6.3" __bagit_version__ = "1.8.1" __bagit_profile_version__ = "1.3.1" diff --git a/bdbag/bdbag_api.py b/bdbag/bdbag_api.py index c74e355..1ff6ac9 100644 --- a/bdbag/bdbag_api.py +++ b/bdbag/bdbag_api.py @@ -413,7 +413,7 @@ def validate_bag(bag_path, fast=False, callback=None, config_file=None): "remote file references from a fetch.txt file. In this case the bag is incomplete but not " "necessarily invalid. Resolve remote file references (if any) and re-validate.") raise e - except bdbagit.BaggingInterruptedError as e: + except (bdbagit.BagError, bdbagit.BaggingInterruptedError) as e: logger.warning(get_typed_exception(e)) raise e except Exception as e: # pragma: no cover diff --git a/setup.py b/setup.py index eac61a2..40cdd6e 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,7 @@ install_requires=['pytz', 'tzlocal==2.1', 'certifi', + 'requests>=2.7.0,<=2.25.1; python_version == "3.5"', 'requests>=2.7.0', 'setuptools_scm<6.0', # for bagit which does not properly include it in install_requires 'bagit==1.8.1',