diff --git a/README.md b/README.md index 7062f3eec..b41a78332 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ [![Test & Build](https://github.com/NatLibFi/ekirjasto-circulation/actions/workflows/test-build.yml/badge.svg)](https://github.com/NatLibFi/ekirjasto-circulation/actions/workflows/test-build.yml) - - [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) @@ -177,8 +175,8 @@ a storage service, you can set the following environment variables: public access to the files. - `PALACE_STORAGE_ANALYTICS_BUCKET`: Required if you want to use the storage service to store analytics data. - `PALACE_STORAGE_ACCESS_KEY`: The access key (optional). - - If this key is set it will be passed to boto3 when connecting to the storage service. - - If it is not set boto3 will attempt to find credentials as outlined in their + - If this key is set it will be passed to boto3 when connecting to the storage service. + - If it is not set boto3 will attempt to find credentials as outlined in their [documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#configuring-credentials). - `PALACE_STORAGE_SECRET_KEY`: The secret key (optional). - `PALACE_STORAGE_REGION`: The AWS region of the storage service (optional). @@ -186,11 +184,11 @@ a storage service, you can set the following environment variables: s3 compatible storage service like [minio](https://min.io/). - `PALACE_STORAGE_URL_TEMPLATE`: The url template to use when generating urls for files stored in the storage service (optional). - - The default value is `https://{bucket}.s3.{region}.amazonaws.com/{key}`. - - The following variables can be used in the template: - - `{bucket}`: The name of the bucket. - - `{key}`: The key of the file. - - `{region}`: The region of the storage service. + - The default value is `https://{bucket}.s3.{region}.amazonaws.com/{key}`. + - The following variables can be used in the template: + - `{bucket}`: The name of the bucket. + - `{key}`: The key of the file. + - `{region}`: The region of the storage service. #### Reporting @@ -215,8 +213,8 @@ the logging: - `PALACE_LOG_CLOUDWATCH_INTERVAL`: The interval in seconds to send logs to CloudWatch. Default is `60`. - `PALACE_LOG_CLOUDWATCH_CREATE_GROUP`: Whether to create the log group if it does not exist. Default is `true`. - `PALACE_LOG_CLOUDWATCH_ACCESS_KEY`: The access key to use when sending logs to CloudWatch. This is optional. - - If this key is set it will be passed to boto3 when connecting to CloudWatch. - - If it is not set boto3 will attempt to find credentials as outlined in their + - If this key is set it will be passed to boto3 when connecting to CloudWatch. + - If it is not set boto3 will attempt to find credentials as outlined in their [documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#configuring-credentials). - `PALACE_LOG_CLOUDWATCH_SECRET_KEY`: The secret key to use when sending logs to CloudWatch. This is optional. @@ -717,7 +715,7 @@ enabled by setting environment variables while starting the application. - `PALACE_XRAY_NAME`: The name of the service shown in x-ray for these traces. - `PALACE_XRAY_ANNOTATE_`: Any environment variable starting with this prefix will be added to to the trace as an annotation. - - For example setting `PALACE_XRAY_ANNOTATE_KEY=value` will set the annotation `key=value` on all xray traces sent + - For example setting `PALACE_XRAY_ANNOTATE_KEY=value` will set the annotation `key=value` on all xray traces sent from the application. - `PALACE_XRAY_INCLUDE_BARCODE`: If this environment variable is set to `true` then the tracing code will try to include the patrons barcode in the user parameter of the trace, if a barcode is available. @@ -780,10 +778,10 @@ pyinstrument -m pytest --no-cov tests/api/ - `PALACE_PYINSTRUMENT`: Profiling will the enabled if this variable is set. The saved profile data will be available at path specified in the environment variable. - - The profile data will have the extension `.pyisession`. - - The data can be accessed with the - [`pyinstrument.session.Session` class](https://pyinstrument.readthedocs.io/en/latest/reference.html#pyinstrument.session.Session). - - Example code to print details of the gathered statistics: + - The profile data will have the extension `.pyisession`. + - The data can be accessed with the + [`pyinstrument.session.Session` class](https://pyinstrument.readthedocs.io/en/latest/reference.html#pyinstrument.session.Session). + - Example code to print details of the gathered statistics: ```python import os diff --git a/tests/api/finland/test_ekirjasto.py b/tests/api/finland/test_ekirjasto.py index c1adbebc6..a97d3ec5c 100644 --- a/tests/api/finland/test_ekirjasto.py +++ b/tests/api/finland/test_ekirjasto.py @@ -1,8 +1,8 @@ import datetime import uuid from base64 import b64encode +from collections.abc import Callable from functools import partial -from typing import Callable import jwt import pytest diff --git a/tests/api/finland/test_opensearch_analytics_provider.py b/tests/api/finland/test_opensearch_analytics_provider.py index 88ced28b3..eda0b15e5 100644 --- a/tests/api/finland/test_opensearch_analytics_provider.py +++ b/tests/api/finland/test_opensearch_analytics_provider.py @@ -4,7 +4,7 @@ # The test set is based on core/test_analytics.py -MOCK_PROTOCOL = "..mock_analytics_provider" +MOCK_PROTOCOL = "../../core/mock_analytics_provider" class TestOpenSearchAnalytics: