Skip to content

Commit

Permalink
Add audbackend.backend.Minio (#231)
Browse files Browse the repository at this point in the history
* Add audbackend.backend.MinIO

* Add dependency to minio

* Rename MinIO to Minio

* Fix Minio.delete() to first remove objects

* Let Minio.exists() return True for "/"

* Fix Minio.ls() for non-existing paths

* Add tests using a local MinIO server

* Expand tests to 100% code coverage

* Fix remaining issues

* Update docstrings

* Define constant hosts values at single position

* Run tests on play.min.io

* Be more conservative for other copy method

* Add Minio.get_config()

* Add docstring example

* Correct get_config() docstring

* Add secure argument

* Add possibility to provide **kwargs

* Set content-type during upload

* Add **kwargs to docstring

* Add support for owner() (#234)

* Add support for owner()

* Be more conservative regarding owner

* Fix owner test under Windows

* Revert "Fix owner test under Windows"

This reverts commit 643c85d.

* Try to fix Windows owner test

* Replace _close() with close()

* Limit copy size to 4.9 GB

* Ensure errors are tested for MinIO

* Add docstring to test_get_config

* Add docstring to test_maven_file_structure

* Ground truth var for interfaces in _unversioned.py

* Ground truth var for interfaces in _versioned.py

* Ground truth var for interfaces in _maven.py

* Fix typos

* Update get_file test

* Fix typing of _size()

* Remove default None in dict.get()

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* Improve code quality

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* Add comment for MinIO credentials

* Improve code quality

* Add exception in _get_file()

* Fix coverage

* DEBUG: coverage

* Try to fix coverage

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
  • Loading branch information
hagenw and sourcery-ai[bot] authored Oct 30, 2024
1 parent 937da89 commit 1d65670
Show file tree
Hide file tree
Showing 12 changed files with 887 additions and 92 deletions.
4 changes: 4 additions & 0 deletions audbackend/backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
from audbackend.core.backend.artifactory import Artifactory
except ImportError: # pragma: no cover
pass
try:
from audbackend.core.backend.minio import Minio
except ImportError: # pragma: no cover
pass
8 changes: 8 additions & 0 deletions audbackend/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,11 @@ def register(
register("artifactory", Artifactory)
except ImportError: # pragma: no cover
pass

# Register optional backends
try:
from audbackend.core.backend.minio import Minio

register("minio", Minio)
except ImportError: # pragma: no cover
pass
Loading

0 comments on commit 1d65670

Please sign in to comment.