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

♻️ Set Component Library Install to Run on Terminal #375

Merged
merged 5 commits into from
Feb 19, 2025

Conversation

MFA-X-AI
Copy link
Member

@MFA-X-AI MFA-X-AI commented Feb 15, 2025

Description

This PR:

  • Sets the tray component library install to run in the terminal instead of the output viewer.
  • Uses the xircuits install libraryName command for installation (now case-insensitive).
  • CLI Update: When running non-init commands, Xircuits now traverses upward to locate the working directory (the folder containing both .xircuits and xai_components) and switches to it before executing the command.
  • CLI Update: If the working directory isn’t found, Xircuits auto-initializes if the XIRCUITS_INIT environment variable is set or prompts the user to initialize in the current directory.
  • Removes automatic initialization on module import so that initialization occurs only when needed.
install.success.mp4

References

#281
#297

Pull Request Type

  • Xircuits Core (Jupyterlab Related changes)
  • Xircuits Canvas (Custom RD Related changes)
  • Xircuits Component Library
  • Xircuits Project Template
  • Testing Automation
  • Documentation
  • Others (Please Specify)

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Refactor

Tests

  1. Install a component library from the tray.
  2. Verify that it spawns the terminal and installs (clone + install requirements) as expected.
  3. Run a non-init Xircuits command (e.g. xircuits install libraryName) in a directory without the working directory present and confirm that the CLI prompts or auto-initializes as designed.

Tested on?

  • Windows
  • Linux Ubuntu
  • Centos
  • Mac
  • Others (State here -> xxx )

Notes

Powershell users might experience errors. Will explore it further in next PRs.

Copy link

Binder 👈 Launch a binder notebook on branch XpressAI/xircuits/fahreza/update-install-lib

@treo
Copy link
Contributor

treo commented Feb 17, 2025

I've added the couple lines of code to look for the output that tells us it is finished.

But while testing it, I found that this doesn't actually work on windows.
image

I guess you tried it from WSL?

There are two problems:

  1. just \n is not enough to trigger the execution of a command on windows, it needs to be \r\n, but that would interfere with linux
  2. on windows it will default to powershell, and that doesn't like the bash based environment setup and variable usage.

Those problems apply to the entire terminal run functionality. Running a regular xircuits file also exhibits the problem.

…Traverse upwards to find the Xircuits working directory (.xircuits + xai_components) - Automatically switch to the working directory before executing commands
@MFA-X-AI
Copy link
Member Author

You're right, I've been using Git Bash which is more linux-like with the pathing. Upon further investigation, the current install is already broken in powershell. I've updated the current xircuits to traverse the parents as discussed, with other things mentioned in the PR.

@MFA-X-AI MFA-X-AI merged commit e94c0a6 into master Feb 19, 2025
8 checks passed
@MFA-X-AI MFA-X-AI deleted the fahreza/update-install-lib branch February 19, 2025 17:30
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