FAQ | This is a LIVE service | Changelog

Commit d872cc50 authored by Dr Rich Wareham's avatar Dr Rich Wareham
Browse files

remove use of deprecated Google Cloud Storage function

This bumps the version number so post merging, the procedure at [1]
should be followed.

[1] https://guidebook.devops.uis.cam.ac.uk/en/latest/workflow/pypi/#publishing-a-previously-published-package

Closes #4
parent 2aa87d6d
Pipeline #100381 passed with stages
in 2 minutes and 57 seconds
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.1] - 2021-07-15
### Added
- Support for data URLs.
### Changed
- Replace use of deprecated download_as_string function for Google Storage.
## [1.0.0] - 2020-08-07
### Added
- Initial version
......@@ -89,8 +89,7 @@ def _fetch_storage_url(components):
bucket = client.get_bucket(bucket)
blob = bucket.get_blob(blob_path)
# Despite the function name, this actually downloads the blob as a bytes object.
return blob.download_as_string()
return blob.download_as_bytes()
def _fetch_data_url(components):
......
......@@ -22,7 +22,7 @@ with open("README.md") as fobj:
setup(
name="geddit",
version="0.1.0",
version="0.1.1",
author="University of Cambridge Information Services",
author_email="devops+geddit@uis.cam.ac.uk",
description="Zero-configuration fetching of configuration resources",
......
......@@ -14,7 +14,7 @@ class GoogleStorageTestCase(unittest.TestCase):
self.mock_content = b'some request content'
self.mock_bucket = self.mock_client.get_bucket.return_value
self.mock_blob = self.mock_bucket.get_blob.return_value
self.mock_blob.download_as_string.return_value = self.mock_content
self.mock_blob.download_as_bytes.return_value = self.mock_content
def test_basic_fetch(self):
"""Can fetch a basic gs://... URL."""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment