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

feat: add base_command decorator #22

Merged
merged 4 commits into from
Dec 2, 2024
Merged

feat: add base_command decorator #22

merged 4 commits into from
Dec 2, 2024

Conversation

qdelamea-aneo
Copy link
Contributor

@qdelamea-aneo qdelamea-aneo commented Nov 16, 2024

  • chore: refactor project structure
  • feat: add base_command decorator
  • test: restructure and complete the test suite
  • fix: test coverage report generation
  • fix: publication to PyPiTest

Motivation

The aim of these changes is to provide a simple and elegant way of integrating the essential basic logic of error handling and common options into a CLI command. These changes also complement unit testing.

Description

All the CLI commands implemented so far share a number of common features. Firstly, they all use the same error handling logic (using the @error_handler decorator). Secondly, all these commands share a number of common options, such as the cluster endpoint (--endpoint), the output format option (--output) and the debug flag (--debug). For the moment, implementing these behaviors requires the addition of numerous decorators above each function defining a command.

The aim of these changes is to streamline the code by providing a single decorator that abstracts this complexity.
The aim is to centralize this logic to lighten the code and simplify future modifications.

In addition, a number of unit tests are missing. These changes add a number of them and significantly improve test coverage.

Testing

A number of unit tests have been added to ensure that the changes made do not alter the proper operation of the CLI. In addition, manual tests have been performed to validate end-to-end functionality.

Impact

These changes have no impact on the rest of the ArmoniK project. They are purely internal to this project.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have thoroughly tested my modifications and added tests when necessary.
  • Tests pass locally and in the CI.
  • I have assessed the performance impact of my modifications.

Copy link

github-actions bot commented Nov 16, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
252 238 94% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 943ac77 by action🐍

@qdelamea-aneo qdelamea-aneo force-pushed the qd/ssl branch 11 times, most recently from a581dac to 943ac77 Compare November 21, 2024 14:20
@ngruelaneo ngruelaneo merged commit 3aa2315 into main Dec 2, 2024
3 of 4 checks passed
@ngruelaneo ngruelaneo deleted the qd/ssl branch December 2, 2024 12:51
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