Conversation
Member
Author
|
@copilot can you fix the errors from https://github.com/Clarifai/clarifai-python/actions/runs/22261474947/job/64400373261?pr=958 i suspect that the new config test is clobbering the CLARIFAI_PAT and other env vars |
Contributor
…aths (#959) * Initial plan * Fix env var clobbering in test_config.py by using @patch.dict Co-authored-by: zeiler <2138258+zeiler@users.noreply.github.com> * Fix test patch paths broken by lazy loading refactor Co-authored-by: zeiler <2138258+zeiler@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: zeiler <2138258+zeiler@users.noreply.github.com>
Minimum allowed line rate is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and new features to the CLI, focusing on lazy command loading, enhanced user context handling, new app management commands, and expanded test coverage for configuration logic. The most important changes are grouped below by theme.
CLI Command Loading and Structure
LazyAliasedGroupclass inclarifai/utils/cli.py, enabling lazy loading of CLI command modules for improved startup performance and command aliasing. All CLI groups now use this class instead ofAliasedGroup. ([[1]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-e3cafb4277139ff82e1f80b80b5dcc839f4420b365d79d97c44206e151e6eeb1R329-R371),[[2]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-6b11868a510d65b7b8d2550d7a614cfad49fc8e5d709a9ef529343281c74edffL9-R19),[[3]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-6b11868a510d65b7b8d2550d7a614cfad49fc8e5d709a9ef529343281c74edffL61-R65))clarifai/cli/base.py, now handled lazily byLazyAliasedGroup. ([clarifai/cli/base.pyL542-R594](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-6b11868a510d65b7b8d2550d7a614cfad49fc8e5d709a9ef529343281c74edffL542-R594))App Management CLI
appcommand group toclarifai/cli/app.pyfor managing apps, including subcommands for creating, listing, and deleting apps. ([clarifai/cli/app.pyR1-R85](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-cf5647745ef431e4ab42c5bc51105695bc858a6cec995cbb2fec5adcfd1005dfR1-R85))User Context and Authentication
whoamicommand toclarifai/cli/base.pyto display both the context user ID and the authenticated user ID, with warning if they differ. ([clarifai/cli/base.pyR127-R174](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-6b11868a510d65b7b8d2550d7a614cfad49fc8e5d709a9ef529343281c74edffR127-R174))Artifact and Pipeline Template Command Refactoring
[[1]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-d4cd19419e77075aa0829215b5c2bb2833fba3fb9ff58af1936bfca062ec4bc4L8-L13),[[2]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-d4cd19419e77075aa0829215b5c2bb2833fba3fb9ff58af1936bfca062ec4bc4R139-R140),[[3]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-d4cd19419e77075aa0829215b5c2bb2833fba3fb9ff58af1936bfca062ec4bc4R179-R182),[[4]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-d4cd19419e77075aa0829215b5c2bb2833fba3fb9ff58af1936bfca062ec4bc4R235-R240),[[5]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-d4cd19419e77075aa0829215b5c2bb2833fba3fb9ff58af1936bfca062ec4bc4R339-R343),[[6]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-d4cd19419e77075aa0829215b5c2bb2833fba3fb9ff58af1936bfca062ec4bc4R416-R418),[[7]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-c0f2809b0d9330cda23fba6162e0480c54a12740673a16086a03bfffe19371dfL10),[[8]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-c0f2809b0d9330cda23fba6162e0480c54a12740673a16086a03bfffe19371dfR39-R40),[[9]](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-c0f2809b0d9330cda23fba6162e0480c54a12740673a16086a03bfffe19371dfR106-R107))Configuration Logic and Testing
ConfigandContextclasses intests/client/test_config.py, covering environment variable overrides, direct access, fallbacks, and error handling. ([tests/client/test_config.pyR1-R232](https://github.com/Clarifai/clarifai-python/pull/958/files#diff-0774976c767ba9cc7410392dbf26231bcefdfd529d2dbe133c48af538d311c5bR1-R232))