All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Fix GitHub Workflow yaml by putting python-version in quotes ("3.10" reads as "3.1" without them)
Require Python 3.10+
Fix a bug while handling HTTPErrors where an attempt to parse JSON fails and throws a JSONDecodeError
Update ServerSideRenderingError to extend the Error class to standardize our error and make SSR errors easier to diagnose.
The tween will now loop over app_iter chunks rather than accessing response.text directly: this should be backwards-compatible.
Python 2.7 support has been dropped. This package now requires py3.7+.
BatchRequest now accepts a function, get_job_group_url, in place of batch_url. This allows for increased flexibility in routing hypernova requests.
You'll need to update your pyramid_hypernova.get_batch_url to the pyramid_hypernova.get_job_group_url setting.
Before:
def get_batch_url():
return 'https://localhost:8080/batch'
registry.settings.update({
'pyramid_hypernova.get_batch_url': get_batch_url,
})After:
def get_job_group_url():
return 'https://localhost:8080/batch'
registry.settings.update({
'pyramid_hypernova.get_job_group_url': get_job_group_url,
})Additionally, If you were manually supplying a BatchRequest factory via the pyramid_hypernova.batch_request_factory setting, you'll need
to update its API to accept get_job_group_url and pass it along to the BatchRequest class. Example:
Before:
def batch_request_factory(batch_url, plugin_controller, json_encoder, pyramid_request):
return BatchRequest(
batch_url=batch_url,
plugin_controller=plugin_controller,
json_encoder=json_encoder,
pyramid_request=pyramid_request,
)
registry.settings.update({
'pyramid_hypernova.batch_request_factory': batch_request_factory,
})After:
def batch_request_factory(get_job_group_url, plugin_controller, json_encoder, pyramid_request):
return BatchRequest(
get_job_group_url=get_job_group_url,
plugin_controller=plugin_controller,
json_encoder=json_encoder,
pyramid_request=pyramid_request,
)
registry.settings.update({
'pyramid_hypernova.batch_request_factory': batch_request_factory,
})get_job_group_url will be supplied two parameters - the job group that pyramid_hypernova will be making a request for and the pyramid request:
def get_batch_url(job_group, pyramid_request): ...This will be called right before send on every job group request. If you're doing an expensive operation to retrieve this url, consider memoizing it.