Skip to content
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

Remove deprecated functions #246

Merged
merged 6 commits into from
Nov 14, 2024
Merged

Remove deprecated functions #246

merged 6 commits into from
Nov 14, 2024

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Nov 14, 2024

In the release 2.0.0 (2024-05-10) of audbackend we deprecated the functions audbackend.access(), audbackend.create(), audbackend.delete(), and audbackend.register(), and marked them for removal in version 2.2.0. At the moment, we are at version 2.1.0, and the next release will be 2.2.0 as we added a new function in #245.

To address it, this pull requests removes:

  • audbackend.access()
  • audbackend.create()
  • audbackend.delete()
  • audbackend.register()

It adds a few new tests in order to preserve code coverage, as before the tests for the deprecated functions were responsible to cover some parts.

Summary by Sourcery

Tests:

  • Add new tests to ensure code coverage after removing deprecated functions.

Summary by Sourcery

Tests:

  • Add new tests to ensure code coverage after removing deprecated functions.

Copy link
Contributor

sourcery-ai bot commented Nov 14, 2024

Reviewer's Guide by Sourcery

This PR removes four deprecated functions from the audbackend library that were marked for removal in version 2.2.0. To maintain code coverage, new test cases have been added that cover the functionality previously tested through the deprecated functions. The changes primarily focus on test file modifications and the removal of the deprecated API module.

Class diagram for audbackend backend changes

classDiagram
    class FileSystem {
        +create(host, repository)
        +delete(host, repository)
        +open()
        +close()
    }
    class Artifactory {
        +create(host, repository)
        +delete(host, repository)
        +open()
        +close()
    }
    class Minio {
        +create(host, repository)
        +delete(host, repository)
        +open()
        +close()
    }
    note for FileSystem "Removed deprecated access, create, delete, register functions"
    note for Artifactory "Removed deprecated access, create, delete, register functions"
    note for Minio "Removed deprecated access, create, delete, register functions"
Loading

File-Level Changes

Change Details Files
Added new test cases for repository operations
  • Added test_create_delete_repositories to verify repository creation and deletion
  • Added test_open_close to verify repository opening and closing operations
  • Added error case testing for duplicate repository creation
  • Added error case testing for opening non-existent repositories
tests/test_backend_filesystem.py
tests/test_backend_artifactory.py
tests/test_backend_minio.py
Fixed documentation strings in backend implementations
  • Corrected docstring for _create method from 'Access existing repository' to 'Create repository'
audbackend/core/backend/artifactory.py
audbackend/core/backend/filesystem.py
Removed deprecated API functionality
  • Removed deprecated register_single_folder fixture
  • Removed deprecated API module containing access(), create(), delete(), and register() functions
tests/conftest.py
audbackend/core/api.py
tests/test_api.py

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@hagenw hagenw marked this pull request as ready for review November 14, 2024 10:18
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @hagenw - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@hagenw hagenw requested a review from ChristianGeng November 14, 2024 10:20
Copy link
Member

@ChristianGeng ChristianGeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of #246

Afaics this completes a process that has been broader in scope than simplz removing deprecated functions:
together with previous pull requests, the design architecture has changed in that
there now is a division between interface and backend.

The now deleted audbackend/core/api.py had been implementing a kind of delegation design pattern. with public methods being mapped to subclasses' private method by means of a delegation design pattern.

This is now not needed any longer, simplifying the development process.
I sum, I have do not have low level technical comment beyond sourcery's, but
the change in design has left a few scars in the documentation:

I find that the depiction of the two components:

(i) a backend that implements file operations on a specific storing device (audbackend.backend) and (ii) an interface that passes user requests to a backend (audbackend.interface) is not optimally located at the beginning of the API doc.

I think it would make more sense to have such a high-level description more upfront, e.g., at the top of the developer guide or the usage guide, in order to get the documentation reader oriented as fast as possible.

The points that I have raised now do not really target the current Merge Request, rather might stimulate a follow-up issue if at all. As said, apart from that I do not want to get into low level details that looking are good, at least afaics.

Therefore I am approving right now.

@hagenw
Copy link
Member Author

hagenw commented Nov 14, 2024

Thanks for your points regarding how to improve the documentation. Would be cool, if you could create an issue for that, so we don't forget it.

@hagenw hagenw merged commit b8d71ac into main Nov 14, 2024
10 checks passed
@hagenw hagenw deleted the remove-deprecated branch November 14, 2024 14:28
@ChristianGeng
Copy link
Member

Thanks for your points regarding how to improve the documentation. Would be cool, if you could create an issue for that, so we don't forget it.

see #251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants