-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Depend on audbackend>=2.0.0 #386
Conversation
@ChristianGeng as I would like to release |
My understanding is that the current main branch of audbackend is the release 2.0.0 candidate, right? |
No, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Merge Requests makes use of new features in audbackend. The features themselves are useful and better the achitecture / design of the involved packages into the direction of more loosely coupled components.
- The
interfaces
subpackage inaudbackend
- The
backend
subpackage inaudbackend
- The
Repository
object here inaudb
This great advancement comes at a cost: audb
and auadbackend
are more complex to study when wanting to gain an understanding of the two packages under consideration and their interactions. The main points raised in the review targeted the process of getting to grips with this structure. These points were not so much about implementation details, rather more about the organization and terminology of the areforementioned building blocks and their documentation.
- both the
interfaces
and thebackend
subpackages are implemented using oop inheritance. The abstract class is in both cases calledBase
declaring that it should not be instantiated. It would probably be more in accordance with general terminology to call theseBackend
in the case of `backen` and make them - in the absence of the abstract keyword in Python - an Abstract Base Clase. - the name
interfaces
is quite generic. Mainly this audbackend subpackage is about server-side directory layouts. - The
Repository
class maintains an inventory of backend classes, but on__call__
returns an interface associated with the backend class in the inventory. So its main purpose is object creation that looks what is very similar to what often is idiomatically implemented as a factory pattern. - I had proposed documenting creating and documenting type stubs, with high level documentation being more in the
.pyi
files - similar to C++. Now It think this is over the top. However, bird's eye documentation in addition to the new developer guide inaudbackend
would come in handy. - Concerning
backend
andinterface
, it might be that this alternatively could be implemented using multiple inheritance. Then the Artifactory backend would get its directory layout management from theMaven Interface
. Multiple inheritance in Python is often flagged by calling the classes that implement the additional functionalityMixin
. I am not sure right now whether this would fly, but this is a pattern that is quite often seen in Python projects.
Taken together: the architecture in audbackend-2.0
is clearly improved, this MR simply makes use of it. Imo there would be leeway of improving the process of getting other devs on board in audbackend
. However I would - given that this will be needed in the future - postpone this for a later release. Therefore I am approving - as on this side there is not really much to do.
Updates the code to use the new API of
audbackend
2.0.0.The main changes in
audbackend
2.0.0 affectingaudb
are:audb
we use theaudbackend.interface.Maven
for versioning on theaudbackend.backend.Artifactory
backend.audbackend.backend.Base.open()
or using thewith
statement. This also means it is desired to useaudbackend.backend.Base.close()
when the backend is no longer needed.audbackend.Repository
was removed asaudbackend
is no longer using string names likeartifactory
to address a backend. As we still use names inaudb
to address a backend, e.g. in the config file, we need to handle this here directly.To do so, it implements now its own version of
audb.Repository
and does no longer rely onaudbackend.Repository
, so we can deprecate that as well.