Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop pinning urllib3 (only done for testing dep) #69

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

DavidCain
Copy link
Contributor

This fixes a problem where one cannot install bioutils into an
environment where urllib3 version 2 is being used. In other words,
merely installing bioutils forces you to use urllib3 version 1.

There's a positive side effect too where installing bioutils no longer
pulls in an unneeded dependency.

Why are we pinning an unused dependency?

Previously, vcrpy (a test dependency) would not support urllib3
version 2. Tests would fail to run because of an attempted import of
urllib3.connectionpool.VerifiedHTTPSConnection (not present in v2):
#46 (comment)

To resolve the error, urllib3 was pinned to version 1.26.*:
#49

This definitely worked, but urllib3 is not directly used by the
package, only indirectly used during testing.

Why pin a transitive test-only dependency?

Unfortunately, the way that urllib3 was pinned doesn't just affect CI
for this repository, but affects any environment in which bioutils
is installed. Specifically, urllib3 will always be installed as a
dependency (or possibly downgraded from v2) when you pip install bioutils!

There are ways we could have pinned urllib3 only in CI without
affecting package dependencies, but that's not important anymore.

Is the original problem solved?

Yes! vcrpy version 4.3.1 (released in May of 2023) started supporting
urllib3 version 2!

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.

https://vcrpy.readthedocs.io/en/latest/changelog.html

@DavidCain DavidCain requested a review from a team as a code owner September 6, 2024 22:01
andreasprlic
andreasprlic previously approved these changes Sep 7, 2024
Copy link
Member

@andreasprlic andreasprlic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this change is breaking the unit tests

@andreasprlic andreasprlic self-requested a review September 7, 2024 04:40
@andreasprlic andreasprlic dismissed their stale review September 7, 2024 04:41

unit tests failing

@DavidCain
Copy link
Contributor Author

Thanks for the review and for triggering CI, @andreasprlic - I can take a look at the failing unit tests and try to sort it out soon.

@jsstevenson
Copy link
Contributor

fwiw, behavior looks correct to me when I test manually -- I wonder if the cassettes need to be regenerated?

This fixes a problem where one cannot install `bioutils` into an
environment where `urllib3` version 2 is being used. In other words,
merely installing `bioutils` forces you to use `urllib3` version 1.

There's a positive side effect too where installing `bioutils` no longer
pulls in an unneeded dependency.

Why are we pinning an unused dependency?
========================================
Previously, `vcrpy` (a test dependency) would not support urllib3
version 2. Tests would fail to run because of an attempted import of
`urllib3.connectionpool.VerifiedHTTPSConnection` (not present in v2):
biocommons#46 (comment)

To resolve the error, `urllib3` was pinned to version `1.26.*`:
biocommons#49

This definitely worked, but `urllib3` is *not* directly used by the
package, only indirectly used during testing.

Why pin a transitive test-only dependency?
==========================================
Unfortunately, the way that `urllib3` was pinned doesn't just affect CI
for this repository, but affects *any* environment in which `bioutils`
is installed. Specifically, `urllib3` will *always* be installed as a
dependency (or possibly downgraded from v2) when you `pip install bioutils`!

There are ways we could have pinned `urllib3` only in CI without
affecting package dependencies, but that's not important anymore.

Is the original problem solved?
===============================
Yes! `vcrpy` version 4.3.1 (released in May of 2023) started supporting
`urllib3` version 2!

> 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.

https://vcrpy.readthedocs.io/en/latest/changelog.html
korikuzma
korikuzma previously approved these changes Sep 27, 2024
@DavidCain
Copy link
Contributor Author

Thank you! @andreasprlic - tests do seem to be passing now.

@andreasprlic
Copy link
Member

Somehow I am jinxing this. The tests fail in the CI. Should we try regenerating the cassettes, as @jsstevenson suggested?

Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Oct 28, 2024
@ahwagner ahwagner removed the stale label Oct 28, 2024
@ahwagner
Copy link
Member

Removing stale this time; @DavidCain please try regenerating the cassettes for this PR or requesting help to do so if needed.

@DavidCain
Copy link
Contributor Author

Removing stale this time; @DavidCain please try regenerating the cassettes for this PR or requesting help to do so if needed.

Thank you, @ahwagner -- I'll confess that I have no idea what "cassettes" even mean in this context so I will gladly take assistance!

@ahwagner
Copy link
Member

This should be good to go now, and is ready for re-review. I also added in a fix to the makefile to build virtual env properly.

@ahwagner ahwagner requested a review from korikuzma October 29, 2024 01:42
Copy link
Member

@andreasprlic andreasprlic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ahwagner ahwagner merged commit 7f44b4d into biocommons:main Oct 29, 2024
7 checks passed
@DavidCain DavidCain deleted the dcain-unpin-urllib3 branch October 29, 2024 02:47
@DavidCain
Copy link
Contributor Author

Thank you all so much! Any idea when we might be able to get a new release of bioutils so that urllib3 version 2 can be used?

@andreasprlic
Copy link
Member

doing a release should be easy (just placing a git tag). Let me try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants