Bound urllib3<2 for consistent CPython3.X behaviour #1062
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This addresses some bugs that I introduced described in #1060.
Bug 1: I didn't give a
test_
prefix to the AI API test modules and so they weren't picked up bypytest
. This has been addressed by a simple rename.Bug 2: I didn't deal with the case where there was no Cohere API key present (as will be the case on the test runners). This has been addressed by some simple monkey patching.
Bug 3: The tests were failing for CPython 3.11, as documented in #1060. This fix was a bit more complicated. Ultimately it relates to the fact that
vcrpy
uses different versions ofurllib3
depending on the CPython version, and that the differenturllib3
versions have some unexpected changed behaviour that appears to not have an obvious fix. My solution in this PR was to only usingurllib3<2
for the tests. I'm not aware of any other easy solutions. Hopefully this is okay.Along the way I noted a more serious issue - at the moment you have tests disabled from your CI. This appears to be related to some changes to the
Makefile
that were introduced last week. Fixing this is not within the scope of this PR. @fnikolaiRelated Issues
#1060
Checklist
make test
successfully?Additional Notes or Comments