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

Feature: Tool Enhancements #24

Merged
merged 8 commits into from
Sep 19, 2024
Merged

Feature: Tool Enhancements #24

merged 8 commits into from
Sep 19, 2024

Conversation

trentonyo
Copy link
Contributor

@trentonyo trentonyo commented Aug 16, 2024

Tool Enhancements

ASSOCIATED ISSUES:

Description

🧰🤔 Tool Installation Modes: Tools were given more granular control over how they are installed:

  • alt: Allows Path designers to specify a "backup" choice for when a Tool fails to install for any reason.
  • mode:
    • install (Default): Tool is installed as usual
    • optional: User is prompted y/N to install the Tool
    • as_alt: Tool is only installed if it is specified as an alt for a tool that fails to install

🧱🏠 Don't Uninstall Me, bro! Tools which were already installed will not be uninstalled during the rollback step of Tool installation.

Definition of Done

  • Changes are approved
  • Contains no breaking changes
  • Changes are implemented in all components
  • Each component associated with issue is updated (no stubs)
  • Each new feature has unit tests written and confirmed
  • All tests pass, no regressions
  • All documentation is updated, including release notes

Bump project version to 0.4.0 and introduce `InstallationStatus` enum to track installation states. Add `should_rollback` function and use it to selectively roll back installations on failure. Enhance tests with parameterized testing for rollback functionality.
Incorporate support for alternative tool installations via 'alt' and 'mode' attributes. Update relevant tests, schemas, and configuration files accordingly.
Adjusted the installation process for optional tools to support user input and assumptions for automated workflows. Also included a version bump to 0.4.2 and updated test scenarios accordingly.
Modified `starter2.yaml` to include an echo statement in the `init` script. Updated `test_starterfile_parser.py` to align tests with the new script content. This ensures the init script reflects the intended behavior during tests.
This commit introduces a new test file, `test_module_with_monitoring.py`, which adds tests for the initialization and destruction processes in `Module`, `ScriptModule`, and `GitModule` classes. These tests utilize various mocking strategies to ensure subprocess interactions are properly monitored.
Replace explicit TypeError raises with implicit ValueError from get_script calls to streamline the module creation process. This reduces redundant error-handling code while maintaining functionality.
Introduced new unit tests for the `is_yaml_loadable_type` function to ensure it correctly handles various data types and raises a `SchemaError` for unloadable types. Included tests for strings, integers, floats, booleans, lists, dictionaries, and `None`. Used pytest for exception handling in the test case for unloadable types.
@trentonyo
Copy link
Contributor Author

I know I've said this before, but I think that you should really be able to use:

Linux/MacOS
cd /tmp
python -m venv .venv
source .venv/bin/activate
pip install typer schema pyyaml requests python-dotenv rich parameterized pytest pytest-cov
pip install -i https://test.pypi.org/simple/ startout==0.4.3
Windows
cd /tmp
python -m venv .venv 
.venv/Scripts/activate
pip install typer schema pyyaml requests python-dotenv rich parameterized pytest pytest-cov
pip install -i https://test.pypi.org/simple/ startout==0.4.3

to test this version, it is available on Python 3.8-3.12

Copy link
Collaborator

@Gehrkej Gehrkej left a comment

Choose a reason for hiding this comment

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

When running the commands in the previous comment I was met with this output.
image

@Gehrkej
Copy link
Collaborator

Gehrkej commented Aug 23, 2024

When running the commands in the previous comment I was met with this output. image

Here is the version of Python I have installed:
image

I am testing on windows 10 btw.

@trentonyo
Copy link
Contributor Author

That's interesting, I'll look into it

@trentonyo trentonyo merged commit defff9b into dev Sep 19, 2024
32 of 33 checks passed
@trentonyo trentonyo deleted the feature/tool-enhancements branch September 19, 2024 21:54
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.

Don't uninstall Tools on fail if previously installed Add alternatives to tools
2 participants