drivendataorg / cloudpathlib

Python pathlib-style classes for cloud storage services such as Amazon S3, Azure Blob Storage, and Google Cloud Storage.
https://cloudpathlib.drivendata.org
MIT License
478 stars 62 forks source link

Live tests: use variable for client schemes, allowing override (#467) #471

Closed pjbull closed 2 months ago

pjbull commented 2 months ago

Live tests for #467


This change is intended to make the default client implementations more flexible so that their scheme can be customized. This can be useful in scenarios where a subclass wants to implement a custom scheme on e.g. a S3 compatible API [1] but with a custom scheme so that the default S3 access is still also available.

[1] https://cloudpathlib.drivendata.org/stable/authentication/#accessing-custom-s3-compatible-object-stores

The tests have been updated to include a new s3-like rig which uses the new scheme override functionality.

This isolates the implementation in response to PR feedback: https://github.com/drivendataorg/cloudpathlib/pull/467#discussion_r1742723302

DESCRIPTION_HERE

Closes #ISSUE


Contributor checklist:

github-actions[bot] commented 2 months ago

🚀 Deployed on https://deploy-preview-471--gallant-agnesi-5f7bb3.netlify.app

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.2%. Comparing base (b776bee) to head (16038bb). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cloudpathlib/azure/azblobclient.py 75.0% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #471 +/- ## ======================================== - Coverage 94.2% 94.2% -0.1% ======================================== Files 23 23 Lines 1745 1745 ======================================== - Hits 1645 1644 -1 - Misses 100 101 +1 ``` | [Files with missing lines](https://app.codecov.io/gh/drivendataorg/cloudpathlib/pull/471?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=drivendataorg) | Coverage Δ | | |---|---|---| | [cloudpathlib/gs/gsclient.py](https://app.codecov.io/gh/drivendataorg/cloudpathlib/pull/471?src=pr&el=tree&filepath=cloudpathlib%2Fgs%2Fgsclient.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=drivendataorg#diff-Y2xvdWRwYXRobGliL2dzL2dzY2xpZW50LnB5) | `91.4% <100.0%> (ø)` | | | [cloudpathlib/s3/s3client.py](https://app.codecov.io/gh/drivendataorg/cloudpathlib/pull/471?src=pr&el=tree&filepath=cloudpathlib%2Fs3%2Fs3client.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=drivendataorg#diff-Y2xvdWRwYXRobGliL3MzL3MzY2xpZW50LnB5) | `93.6% <ø> (-0.8%)` | :arrow_down: | | [cloudpathlib/azure/azblobclient.py](https://app.codecov.io/gh/drivendataorg/cloudpathlib/pull/471?src=pr&el=tree&filepath=cloudpathlib%2Fazure%2Fazblobclient.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=drivendataorg#diff-Y2xvdWRwYXRobGliL2F6dXJlL2F6YmxvYmNsaWVudC5weQ==) | `96.8% <75.0%> (ø)` | |