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

fix: clean up the cli #1108

Merged
merged 4 commits into from
Dec 3, 2024
Merged

fix: clean up the cli #1108

merged 4 commits into from
Dec 3, 2024

Conversation

Bento007
Copy link
Contributor

Reason for Change

  • configure logging when the cli is initialize, not when a specific command it called. This prevents us from configuring logging in multiple places. This has be an issue when using the cellxgene-schema library in the backend.
  • use logger to ouput messages instead of print. This makes it easier to silence extra messages in our logs

Changes

  • configure logging when the cli is initialize
  • Use the schema_cli group to add new commands
  • use logger to ouput messages instead of print.

Testing

  • installed using make install locally and ran
    cellxgene-schema validate ./cellxgene_schema_cli/tests/fixtures/h5ads/example_valid.h5ad
    and
    cellxgene-schema -v validate ./cellxgene_schema_cli/tests/fixtures/h5ads/example_valid.h5ad
    and verified the log messages were as expected.

- configure logging when the cli is initialize, not when a specific command it called. This prevents us from configuring logging in multiple places.
- use logger to ouput messages instead of print.
Copy link
Contributor

@ejmolinelli ejmolinelli left a comment

Choose a reason for hiding this comment

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

@Bento007 @joyceyan
This looks great - CLI should always use logger

@Bento007 Bento007 enabled auto-merge (squash) December 3, 2024 19:17
@Bento007 Bento007 merged commit bc905f4 into main Dec 3, 2024
7 of 8 checks passed
@Bento007 Bento007 deleted the tsmith/cli-cleanup branch December 3, 2024 19:19
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.

3 participants