Skip to content

chore(utils_lib): add cvs_package_root(), dedupe ad-hoc root resolution - #335

Open
speriaswamy-amd wants to merge 1 commit into
speriaswamy/cvsman-01-verify-network-errorsfrom
speriaswamy/cvsman-02-package-root
Open

chore(utils_lib): add cvs_package_root(), dedupe ad-hoc root resolution#335
speriaswamy-amd wants to merge 1 commit into
speriaswamy/cvsman-01-verify-network-errorsfrom
speriaswamy/cvsman-02-package-root

Conversation

@speriaswamy-amd

Copy link
Copy Markdown
Contributor

Part 2 of 14 in a stack for AIMVT-276. Base: #334.

Why

run_config_paths.py and copy_config_plugin.py each independently computed the installed cvs package directory — one via os.path.dirname(os.path.abspath(cvs.__file__)), the other via dirname(dirname(__file__)). A third call site (the upcoming config parameter registry) needs the same path, which would make a third divergent implementation.

What changed

  • cvs/lib/utils_lib.py — added cvs_package_root().
  • cvs/lib/run_config_paths.py, cvs/cli_plugins/copy_config_plugin.py — switched their existing ad-hoc logic to call it.
  • cvs/lib/unittests/test_utils_lib.py — added tests for the new helper.

run_config_paths.py and copy_config_plugin.py each hand-rolled their own
`os.path.dirname(os.path.abspath(cvs.__file__))` / `dirname(dirname(__file__))`
to find the installed cvs package directory. Extract the shared helper and
point both call sites at it.

AIMVT-276.
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.

1 participant