Skip to content

Humanize byte size error for community image upload #3205

Humanize byte size error for community image upload

Humanize byte size error for community image upload #3205

Status Failure
Total duration 5m 4s
Artifacts

tests.yml

on: pull_request
Matrix: Tests
Fit to window
Zoom out
Zoom in

Annotations

28 errors and 48 warnings
Tests (3.10, postgresql14, opensearch2): invenio_communities/errors.py#L1
Black format check --- /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py 2025-02-10 17:45:46.892991+00:00 +++ /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py 2025-02-10 17:47:10.006522+00:00 @@ -48,11 +48,14 @@ file_size_hr, file_size_unit = human_readable_unit() """Initialise error.""" super().__init__( _( "Logo size limit exceeded. Limit: {limit} {limit_unit} Given: {file_size} {file_size_unit} bytes".format( - limit=ceil(limit_hr), limit_unit=limit_unit, file_size=ceil(file_size_hr), file_size_unit=file_size_unit + limit=ceil(limit_hr), + limit_unit=limit_unit, + file_size=ceil(file_size_hr), + file_size_unit=file_size_unit, ) ) )
Tests (3.10, postgresql14, opensearch2): invenio_communities/errors.py#L1
pydocstyle-check /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py:46 in public method `__init__`: D107: Missing docstring in __init__
Tests (3.10, postgresql14, opensearch2): invenio_communities/errors.py#L1
isort-check from flask_babel import ngettext from invenio_i18n import gettext as _ + from .utils import human_readable_unit
Tests (3.10, postgresql14, opensearch2): invenio_communities/utils.py#L1
Black format check --- /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py 2025-02-10 17:45:46.904991+00:00 +++ /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py 2025-02-10 17:47:13.124762+00:00 @@ -113,9 +113,9 @@ def human_readable_unit(size): """ Converts bytes to largest unit (e.g., KB, MB, GB). """ - for unit in ['B', 'KB', 'MB', 'GB', 'TB', 'PB']: + for unit in ["B", "KB", "MB", "GB", "TB", "PB"]: if size < 1000.0: return size, unit size /= 1000.0
Tests (3.10, postgresql14, opensearch2): invenio_communities/utils.py#L1
pydocstyle-check /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py:115 in public function `human_readable_unit`: D200: One-line docstring should fit on one line with quotes (found 3)
Tests (3.10, postgresql14, opensearch2): invenio_communities/communities/services/config.py#L1
isort-check SearchOptionsMixin, ) from invenio_records_resources.services.files.links import FileLink -from invenio_records_resources.services.records.config import RecordServiceConfig +from invenio_records_resources.services.records.config import ( + RecordServiceConfig, +) from invenio_records_resources.services.records.config import ( SearchOptions as SearchOptionsBase, )
Tests (3.10, postgresql14, opensearch2)
Process completed with exit code 1.
Tests (3.11, postgresql14, opensearch2): invenio_communities/errors.py#L1
Black format check --- /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py 2025-02-10 17:45:46.823388+00:00 +++ /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py 2025-02-10 17:47:21.168487+00:00 @@ -48,11 +48,14 @@ file_size_hr, file_size_unit = human_readable_unit() """Initialise error.""" super().__init__( _( "Logo size limit exceeded. Limit: {limit} {limit_unit} Given: {file_size} {file_size_unit} bytes".format( - limit=ceil(limit_hr), limit_unit=limit_unit, file_size=ceil(file_size_hr), file_size_unit=file_size_unit + limit=ceil(limit_hr), + limit_unit=limit_unit, + file_size=ceil(file_size_hr), + file_size_unit=file_size_unit, ) ) )
Tests (3.11, postgresql14, opensearch2): invenio_communities/errors.py#L1
pydocstyle-check /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py:46 in public method `__init__`: D107: Missing docstring in __init__
Tests (3.11, postgresql14, opensearch2): invenio_communities/errors.py#L1
isort-check from flask_babel import ngettext from invenio_i18n import gettext as _ + from .utils import human_readable_unit
Tests (3.11, postgresql14, opensearch2): invenio_communities/utils.py#L1
Black format check --- /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py 2025-02-10 17:45:46.835388+00:00 +++ /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py 2025-02-10 17:47:23.918136+00:00 @@ -113,9 +113,9 @@ def human_readable_unit(size): """ Converts bytes to largest unit (e.g., KB, MB, GB). """ - for unit in ['B', 'KB', 'MB', 'GB', 'TB', 'PB']: + for unit in ["B", "KB", "MB", "GB", "TB", "PB"]: if size < 1000.0: return size, unit size /= 1000.0
Tests (3.11, postgresql14, opensearch2): invenio_communities/utils.py#L1
pydocstyle-check /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py:115 in public function `human_readable_unit`: D200: One-line docstring should fit on one line with quotes (found 3)
Tests (3.11, postgresql14, opensearch2): invenio_communities/communities/services/config.py#L1
isort-check SearchOptionsMixin, ) from invenio_records_resources.services.files.links import FileLink -from invenio_records_resources.services.records.config import RecordServiceConfig +from invenio_records_resources.services.records.config import ( + RecordServiceConfig, +) from invenio_records_resources.services.records.config import ( SearchOptions as SearchOptionsBase, )
Tests (3.11, postgresql14, opensearch2)
Process completed with exit code 1.
Tests (3.9, postgresql14, opensearch2): invenio_communities/errors.py#L1
Black format check --- /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py 2025-02-10 17:45:46.768421+00:00 +++ /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py 2025-02-10 17:47:22.141626+00:00 @@ -48,11 +48,14 @@ file_size_hr, file_size_unit = human_readable_unit() """Initialise error.""" super().__init__( _( "Logo size limit exceeded. Limit: {limit} {limit_unit} Given: {file_size} {file_size_unit} bytes".format( - limit=ceil(limit_hr), limit_unit=limit_unit, file_size=ceil(file_size_hr), file_size_unit=file_size_unit + limit=ceil(limit_hr), + limit_unit=limit_unit, + file_size=ceil(file_size_hr), + file_size_unit=file_size_unit, ) ) )
Tests (3.9, postgresql14, opensearch2): invenio_communities/errors.py#L1
pydocstyle-check /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py:46 in public method `__init__`: D107: Missing docstring in __init__
Tests (3.9, postgresql14, opensearch2): invenio_communities/errors.py#L1
isort-check from flask_babel import ngettext from invenio_i18n import gettext as _ + from .utils import human_readable_unit
Tests (3.9, postgresql14, opensearch2): invenio_communities/utils.py#L1
Black format check --- /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py 2025-02-10 17:45:46.780421+00:00 +++ /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py 2025-02-10 17:47:25.279668+00:00 @@ -113,9 +113,9 @@ def human_readable_unit(size): """ Converts bytes to largest unit (e.g., KB, MB, GB). """ - for unit in ['B', 'KB', 'MB', 'GB', 'TB', 'PB']: + for unit in ["B", "KB", "MB", "GB", "TB", "PB"]: if size < 1000.0: return size, unit size /= 1000.0
Tests (3.9, postgresql14, opensearch2): invenio_communities/utils.py#L1
pydocstyle-check /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py:115 in public function `human_readable_unit`: D200: One-line docstring should fit on one line with quotes (found 3)
Tests (3.9, postgresql14, opensearch2): invenio_communities/communities/services/config.py#L1
isort-check SearchOptionsMixin, ) from invenio_records_resources.services.files.links import FileLink -from invenio_records_resources.services.records.config import RecordServiceConfig +from invenio_records_resources.services.records.config import ( + RecordServiceConfig, +) from invenio_records_resources.services.records.config import ( SearchOptions as SearchOptionsBase, )
Tests (3.9, postgresql14, opensearch2)
Process completed with exit code 1.
Tests (3.12, postgresql14, opensearch2): invenio_communities/errors.py#L1
Black format check --- /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py 2025-02-10 17:45:46.913685+00:00 +++ /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py 2025-02-10 17:47:16.902389+00:00 @@ -48,11 +48,14 @@ file_size_hr, file_size_unit = human_readable_unit() """Initialise error.""" super().__init__( _( "Logo size limit exceeded. Limit: {limit} {limit_unit} Given: {file_size} {file_size_unit} bytes".format( - limit=ceil(limit_hr), limit_unit=limit_unit, file_size=ceil(file_size_hr), file_size_unit=file_size_unit + limit=ceil(limit_hr), + limit_unit=limit_unit, + file_size=ceil(file_size_hr), + file_size_unit=file_size_unit, ) ) )
Tests (3.12, postgresql14, opensearch2): invenio_communities/errors.py#L1
pydocstyle-check /home/runner/work/invenio-communities/invenio-communities/invenio_communities/errors.py:46 in public method `__init__`: D107: Missing docstring in __init__
Tests (3.12, postgresql14, opensearch2): invenio_communities/errors.py#L1
isort-check from flask_babel import ngettext from invenio_i18n import gettext as _ + from .utils import human_readable_unit
Tests (3.12, postgresql14, opensearch2): invenio_communities/utils.py#L1
Black format check --- /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py 2025-02-10 17:45:46.925685+00:00 +++ /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py 2025-02-10 17:47:21.494193+00:00 @@ -113,9 +113,9 @@ def human_readable_unit(size): """ Converts bytes to largest unit (e.g., KB, MB, GB). """ - for unit in ['B', 'KB', 'MB', 'GB', 'TB', 'PB']: + for unit in ["B", "KB", "MB", "GB", "TB", "PB"]: if size < 1000.0: return size, unit size /= 1000.0
Tests (3.12, postgresql14, opensearch2): invenio_communities/utils.py#L1
pydocstyle-check /home/runner/work/invenio-communities/invenio-communities/invenio_communities/utils.py:115 in public function `human_readable_unit`: D200: One-line docstring should fit on one line with quotes (found 3)
Tests (3.12, postgresql14, opensearch2): invenio_communities/communities/services/config.py#L1
isort-check SearchOptionsMixin, ) from invenio_records_resources.services.files.links import FileLink -from invenio_records_resources.services.records.config import RecordServiceConfig +from invenio_records_resources.services.records.config import ( + RecordServiceConfig, +) from invenio_records_resources.services.records.config import ( SearchOptions as SearchOptionsBase, )
Tests (3.12, postgresql14, opensearch2)
Process completed with exit code 1.
Tests (3.10, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/marshmallow_utils/fields/generated.py#L12
The '__version_info__' attribute is deprecated and will be removed in in a future version. Use feature detection or 'packaging.Version(importlib.metadata.version("marshmallow")).release' instead.
Tests (3.10, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/marshmallow_utils/fields/generated.py#L12
The '__version_info__' attribute is deprecated and will be removed in in a future version. Use feature detection or 'packaging.Version(importlib.metadata.version("marshmallow")).release' instead.
Tests (3.10, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/jsonresolver/contrib/jsonschema.py#L31
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.10, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/jsonresolver/contrib/jsonschema.py#L31
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.10, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/invenio_records/resolver.py#L14
jsonschema.exceptions.RefResolutionError is deprecated as of version 4.18.0. If you wish to catch potential reference resolution errors, directly catch referencing.exceptions.Unresolvable.
Tests (3.10, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/invenio_records/resolver.py#L14
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.10, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/invenio_records/resolver.py#L14
jsonschema.exceptions.RefResolutionError is deprecated as of version 4.18.0. If you wish to catch potential reference resolution errors, directly catch referencing.exceptions.Unresolvable.
Tests (3.10, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/invenio_records/resolver.py#L14
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.11, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/marshmallow_utils/fields/generated.py#L12
The '__version_info__' attribute is deprecated and will be removed in in a future version. Use feature detection or 'packaging.Version(importlib.metadata.version("marshmallow")).release' instead.
Tests (3.11, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/marshmallow_utils/fields/generated.py#L12
The '__version_info__' attribute is deprecated and will be removed in in a future version. Use feature detection or 'packaging.Version(importlib.metadata.version("marshmallow")).release' instead.
Tests (3.11, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/jsonresolver/contrib/jsonschema.py#L31
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.11, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/jsonresolver/contrib/jsonschema.py#L31
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.11, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/invenio_records/resolver.py#L14
jsonschema.exceptions.RefResolutionError is deprecated as of version 4.18.0. If you wish to catch potential reference resolution errors, directly catch referencing.exceptions.Unresolvable.
Tests (3.11, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/invenio_records/resolver.py#L14
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.11, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/invenio_records/resolver.py#L14
jsonschema.exceptions.RefResolutionError is deprecated as of version 4.18.0. If you wish to catch potential reference resolution errors, directly catch referencing.exceptions.Unresolvable.
Tests (3.9, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/marshmallow_utils/fields/generated.py#L12
The '__version_info__' attribute is deprecated and will be removed in in a future version. Use feature detection or 'packaging.Version(importlib.metadata.version("marshmallow")).release' instead.
Tests (3.9, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/marshmallow_utils/fields/generated.py#L12
The '__version_info__' attribute is deprecated and will be removed in in a future version. Use feature detection or 'packaging.Version(importlib.metadata.version("marshmallow")).release' instead.
Tests (3.9, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/jsonresolver/contrib/jsonschema.py#L31
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.9, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/jsonresolver/contrib/jsonschema.py#L31
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.9, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/invenio_records/resolver.py#L14
jsonschema.exceptions.RefResolutionError is deprecated as of version 4.18.0. If you wish to catch potential reference resolution errors, directly catch referencing.exceptions.Unresolvable.
Tests (3.9, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/invenio_records/resolver.py#L14
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.9, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/invenio_records/resolver.py#L14
jsonschema.exceptions.RefResolutionError is deprecated as of version 4.18.0. If you wish to catch potential reference resolution errors, directly catch referencing.exceptions.Unresolvable.
Tests (3.9, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/invenio_records/resolver.py#L14
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
Tests (3.12, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/_pytest/assertion/rewrite.py#L670
ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
Tests (3.12, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/_pytest/assertion/rewrite.py#L672
Attribute s is deprecated and will be removed in Python 3.14; use value instead
Tests (3.12, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/_pytest/assertion/rewrite.py#L670
ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
Tests (3.12, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/_pytest/assertion/rewrite.py#L672
Attribute s is deprecated and will be removed in Python 3.14; use value instead
Tests (3.12, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/marshmallow_utils/fields/generated.py#L12
The '__version_info__' attribute is deprecated and will be removed in in a future version. Use feature detection or 'packaging.Version(importlib.metadata.version("marshmallow")).release' instead.
Tests (3.12, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/marshmallow_utils/fields/generated.py#L12
The '__version_info__' attribute is deprecated and will be removed in in a future version. Use feature detection or 'packaging.Version(importlib.metadata.version("marshmallow")).release' instead.
Tests (3.12, postgresql14, opensearch2): opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/jsonresolver/contrib/jsonschema.py#L31
jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.