repo2docker icon indicating copy to clipboard operation
repo2docker copied to clipboard

Cleanup hydroshare provider and stop using urlopen

Open yuvipanda opened this issue 11 months ago • 0 comments

Sort-of a follow up to https://github.com/jupyterhub/repo2docker/pull/993. Follow-up to #1390, in moving hydroshare tests to be integration tests

It does two things, that are intertwined:

Cleanup using urlopen vs requests

We were:

  1. In some cases, directly using requests
  2. In some cases, directly using the stdlib's urlopen
  3. In some cases, had a method named urlopen that simply passed things through to requests

This is unnecessarily confusing, and seems to primarily be done for the benefit of mocking the network calls. However, as described in the recently merged https://github.com/jupyterhub/repo2docker/pull/1390, I don't think mocking is appropriate here as it means we don't actually catch problems.

This PR mostly focuses on getting unifying to only using requests directly with as little indirection as possible.

Cleanup hydroshare

The biggest user of the slightly easier mocking provided by the url redirection was hydroshare. Similar to #1390, this PR now:

  1. Turns the hydroshare tests into integration tests
  2. Simplifies the detection logic and makes it clearer what we are detecting (with URL examples in the tests)

yuvipanda avatar Dec 21 '24 00:12 yuvipanda