-
-
Notifications
You must be signed in to change notification settings - Fork 414
feat: add support for Python virtual environment in testsuite setup #956
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
Conversation
WalkthroughThe changes add optional support in Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant dev.sh
participant Python
participant venv
Developer->>dev.sh: Run with or without --use-global-env
alt Use global environment
dev.sh->>Python: pip install -r requirements.txt (global)
dev.sh->>Python: Run integration testsuite (global)
else Use virtual environment
dev.sh->>venv: setup_venv(./venv)
venv-->>dev.sh: venv created & activated
dev.sh->>Python: pip install -r requirements.txt (inside venv)
dev.sh->>Python: Run integration testsuite (inside venv)
dev.sh->>venv: cleanup_venv() on exit/interruption
end
Estimated code review effort2 (~20 minutes) Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
dev.sh (1)
119-122: Offer a short flag for ergonomicsConsider adding
-eas a shorthand for--use-venv, mirroring the existing pattern (-t/-s/-v). Small DX win, zero cost.- --use-venv) + -e|--use-venv) USE_VENV=true shift ;;
|
Cases of failure (e.g., ~/superfile$ ./dev.sh --testsuite --use-global-env
🚀 Starting superfile development workflow
==> Tidying Go modules...
✓ Go modules tidied
==> Formatting Go code...
✓ Code formatted
==> Running golangci-lint...
✓ Linting passed
==> Running unit tests...
? github.com/yorukot/superfile [no test files]
? github.com/yorukot/superfile/src/cmd [no test files]
? github.com/yorukot/superfile/src/config [no test files]
? github.com/yorukot/superfile/src/config/icon [no test files]
ok github.com/yorukot/superfile/src/internal (cached)
ok github.com/yorukot/superfile/src/internal/common (cached)
? github.com/yorukot/superfile/src/internal/ui [no test files]
ok github.com/yorukot/superfile/src/internal/ui/prompt (cached)
ok github.com/yorukot/superfile/src/internal/ui/rendering (cached)
ok github.com/yorukot/superfile/src/internal/ui/sidebar (cached)
ok github.com/yorukot/superfile/src/internal/utils (cached)
? github.com/yorukot/superfile/src/pkg/file_preview [no test files]
? github.com/yorukot/superfile/src/pkg/string_function [no test files]
✓ Unit tests passed
==> Running integration testsuite...
==> Installing testsuite requirements globally...
⚠ Using global Python environment - consider removing --use-global-env flag to use virtual environment
⚠ Failed to install testsuite requirements - continuing anyway
Traceback (most recent call last):
File "/home/khitoshi/superfile/testsuite/main.py", line 64, in <module>
main()
File "/home/khitoshi/superfile/testsuite/main.py", line 58, in main
success = run_tests(spf_path, only_run_tests=args.tests)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/khitoshi/superfile/testsuite/core/runner.py", line 57, in run_tests
spf_manager = TmuxSPFManager(str(spf_path))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/khitoshi/superfile/testsuite/core/tmux_manager.py", line 33, in __init__
raise RuntimeError(
RuntimeError: libtmux version 0.31.0 or higher is required. Current version: 0.30.2. Please upgrade with: pip install 'libtmux>=0.31.0'
✗ Integration testsuite failedSuccessful Cases ~/superfile$ ./dev.sh --testsuite --use-global-env
🚀 Starting superfile development workflow
==> Tidying Go modules...
✓ Go modules tidied
==> Formatting Go code...
✓ Code formatted
==> Running golangci-lint...
✓ Linting passed
==> Running unit tests...
? github.com/yorukot/superfile [no test files]
? github.com/yorukot/superfile/src/cmd [no test files]
? github.com/yorukot/superfile/src/config [no test files]
? github.com/yorukot/superfile/src/config/icon [no test files]
ok github.com/yorukot/superfile/src/internal (cached)
ok github.com/yorukot/superfile/src/internal/common (cached)
? github.com/yorukot/superfile/src/internal/ui [no test files]
ok github.com/yorukot/superfile/src/internal/ui/prompt (cached)
ok github.com/yorukot/superfile/src/internal/ui/rendering (cached)
ok github.com/yorukot/superfile/src/internal/ui/sidebar (cached)
ok github.com/yorukot/superfile/src/internal/utils (cached)
? github.com/yorukot/superfile/src/pkg/file_preview [no test files]
? github.com/yorukot/superfile/src/pkg/string_function [no test files]
✓ Unit tests passed
==> Running integration testsuite...
==> Installing testsuite requirements globally...
⚠ Using global Python environment - consider removing --use-global-env flag to use virtual environment
⚠ Failed to install testsuite requirements - continuing anyway
[2025-07-23 12:38:44 - INFO] Testcases : [ChooserFileTest, CopyWTest, DeleteDirTest, EmptyPanelTest, CompressExtractTest, CommandTest, CopyDirTest, RenameTest, CutTest, CopyTest, DeleteTest]
[2025-07-23 12:38:44 - INFO] Running test ChooserFileTest
[2025-07-23 12:38:48 - INFO] Passed test ChooserFileTest
[2025-07-23 12:38:48 - INFO] Running test CopyWTest
[2025-07-23 12:38:50 - INFO] Passed test CopyWTest
[2025-07-23 12:38:50 - INFO] Running test DeleteDirTest
[2025-07-23 12:38:51 - INFO] Passed test DeleteDirTest
[2025-07-23 12:38:51 - INFO] Running test EmptyPanelTest
[2025-07-23 12:38:53 - INFO] Passed test EmptyPanelTest
[2025-07-23 12:38:53 - INFO] Running test CompressExtractTest
[2025-07-23 12:38:55 - INFO] Passed test CompressExtractTest
[2025-07-23 12:38:55 - INFO] Running test CommandTest
[2025-07-23 12:38:57 - INFO] Passed test CommandTest
[2025-07-23 12:38:57 - INFO] Running test CopyDirTest
[2025-07-23 12:38:58 - INFO] Passed test CopyDirTest
[2025-07-23 12:38:58 - INFO] Running test RenameTest
[2025-07-23 12:39:00 - INFO] Passed test RenameTest
[2025-07-23 12:39:00 - INFO] Running test CutTest
[2025-07-23 12:39:02 - INFO] Passed test CutTest
[2025-07-23 12:39:02 - INFO] Running test CopyTest
[2025-07-23 12:39:04 - INFO] Passed test CopyTest
[2025-07-23 12:39:04 - INFO] Running test DeleteTest
[2025-07-23 12:39:06 - INFO] Passed test DeleteTest
[2025-07-23 12:39:06 - INFO] Finished running 11 test. 11 passed
✓ Integration testsuite passed
==> Building spf binary...
✓ Build completed successfully
🎉 All steps completed successfully!
Binary location: ./bin/spf
Binary size: 23M |
…ve pane retrieval in TmuxSPFManager
~/superfile$ ./dev.sh --testsuite
🚀 Starting superfile development workflow
==> Tidying Go modules...
✓ Go modules tidied
==> Formatting Go code...
✓ Code formatted
==> Running golangci-lint...
✓ Linting passed
==> Running unit tests...
? github.com/yorukot/superfile [no test files]
? github.com/yorukot/superfile/src/cmd [no test files]
? github.com/yorukot/superfile/src/config [no test files]
? github.com/yorukot/superfile/src/config/icon [no test files]
ok github.com/yorukot/superfile/src/internal (cached)
ok github.com/yorukot/superfile/src/internal/common (cached)
? github.com/yorukot/superfile/src/internal/ui [no test files]
ok github.com/yorukot/superfile/src/internal/ui/prompt (cached)
ok github.com/yorukot/superfile/src/internal/ui/rendering (cached)
ok github.com/yorukot/superfile/src/internal/ui/sidebar (cached)
ok github.com/yorukot/superfile/src/internal/utils (cached)
? github.com/yorukot/superfile/src/pkg/file_preview [no test files]
? github.com/yorukot/superfile/src/pkg/string_function [no test files]
✓ Unit tests passed
==> Running integration testsuite...
==> Using existing virtual environment at ./venv
==> Upgrading pip in virtual environment...
✓ Pip upgraded successfully
==> Installing testsuite requirements in virtual environment...
✓ Testsuite requirements installed in virtual environment
[2025-07-23 12:46:00 - INFO] Testcases : [ChooserFileTest, CopyWTest, DeleteDirTest, EmptyPanelTest, CompressExtractTest, CommandTest, CopyDirTest, RenameTest, CutTest, CopyTest, DeleteTest]
[2025-07-23 12:46:00 - INFO] Running test ChooserFileTest
[2025-07-23 12:46:04 - INFO] Passed test ChooserFileTest
[2025-07-23 12:46:04 - INFO] Running test CopyWTest
[2025-07-23 12:46:06 - INFO] Passed test CopyWTest
[2025-07-23 12:46:06 - INFO] Running test DeleteDirTest
[2025-07-23 12:46:07 - INFO] Passed test DeleteDirTest
[2025-07-23 12:46:07 - INFO] Running test EmptyPanelTest
[2025-07-23 12:46:09 - INFO] Passed test EmptyPanelTest
[2025-07-23 12:46:09 - INFO] Running test CompressExtractTest
[2025-07-23 12:46:11 - INFO] Passed test CompressExtractTest
[2025-07-23 12:46:11 - INFO] Running test CommandTest
[2025-07-23 12:46:13 - INFO] Passed test CommandTest
[2025-07-23 12:46:13 - INFO] Running test CopyDirTest
[2025-07-23 12:46:15 - INFO] Passed test CopyDirTest
[2025-07-23 12:46:15 - INFO] Running test RenameTest
[2025-07-23 12:46:16 - INFO] Passed test RenameTest
[2025-07-23 12:46:16 - INFO] Running test CutTest
[2025-07-23 12:46:18 - INFO] Passed test CutTest
[2025-07-23 12:46:18 - INFO] Running test CopyTest
[2025-07-23 12:46:22 - INFO] Passed test CopyTest
[2025-07-23 12:46:22 - INFO] Running test DeleteTest
[2025-07-23 12:46:24 - INFO] Passed test DeleteTest
[2025-07-23 12:46:24 - INFO] Finished running 11 test. 11 passed
✓ Integration testsuite passed
==> Building spf binary...
✓ Build completed successfully
🎉 All steps completed successfully!
Binary location: ./bin/spf
Binary size: 23M |
… pane retrieval in TmuxSPFManager
~/superfile$ ./dev.sh --testsuite --use-global-env --verbose
....
[2025-07-23 01:54:28 - DEBUG] spf_manager info : [], Current file structure :
D-dir1
D-dir2
F-dir1/file1(1).txt
F-dir1/file1.txt
[2025-07-23 01:54:28 - INFO] Passed test CopyTest
[2025-07-23 01:54:28 - INFO] Running test DeleteTest
[2025-07-23 01:54:28 - DEBUG] Current file structure :
F-file_to_delete.txt
[2025-07-23 01:54:28 - DEBUG] windows_command : /home/khitoshi/superfile/bin/spf -c /home/khitoshi/superfile/src/superfile_config/config.toml --hf /home/khitoshi/superfile/src/superfile_config/hotkeys.toml
[2025-07-23 01:54:28 - DEBUG] spf_session initialised : Session($0 spf_session)
[2025-07-23 01:54:29 - DEBUG] sendind key : 'a'
[2025-07-23 01:54:29 - DEBUG] sendind key : '\x04'
[2025-07-23 01:54:29 - DEBUG] sendind key : '\r'
[2025-07-23 01:54:29 - DEBUG] sendind key : '\x1b'
[2025-07-23 01:54:30 - DEBUG] Finished Execution
[2025-07-23 01:54:30 - DEBUG] spf_manager info : [], Current file structure :
[2025-07-23 01:54:30 - INFO] Passed test DeleteTest
[2025-07-23 01:54:30 - INFO] Finished running 11 test. 11 passed
✓ Integration testsuite passed
==> Building spf binary...
✓ Build completed successfully |
dev.sh
Outdated
| if pip3 install -r requirements.txt > /dev/null 2>&1; then | ||
| print_success "Testsuite requirements installed" | ||
| # Setup virtual environment if requested | ||
| if [ "$USE_VENV" = true ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Khitoshi Thanks for this. I would prefer if its other way around.
--use-global-env or a better name -> Uses global
default -> Uses venv
Default using global sounds bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes more sense. I’ll switch the default to venv and add a --use-global-env flag.
lazysegtree
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tested. I would have @yorukot also take a look as he wrote this script.
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [yorukot/superfile](https://github.com/yorukot/superfile) | patch | `v1.3.1` -> `v1.3.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>yorukot/superfile (yorukot/superfile)</summary> ### [`v1.3.3`](https://github.com/yorukot/superfile/releases/tag/v1.3.3) [Compare Source](yorukot/superfile@v1.3.2...v1.3.3) Hey folks. Releasing v1.3.3 with bug fix related to config file, and improvements in metadata panel feature. #### Install: [**Click me to know how to install**](https://github.com/yorukot/superfile?tab=readme-ov-file#installation) #### Highlights - Fixed a bug in config file correction that would make config file invalid. Thanks [@​estebandpena](https://github.com/estebandpena) for reporting the issue, and [@​wassup05](https://github.com/wassup05) for the fix. #### Detailed Change Summary <details><summary>Details</summary> <p> ##### Update - feat: Metadata loading via bubbletea's tea.Cmd method, removed usage channels and custom goroutines [#​947](yorukot/superfile#947) by @​lazysegtree - feat: Metadata panel into separate package, UI bug fixes, Code improvements [#​950](yorukot/superfile#950) by @​lazysegtree - feat: add support for Python virtual environment in testsuite setup [#​956](yorukot/superfile#956) by @​Khitoshi ##### Bug fix - fix: windows test ci [#​941](yorukot/superfile#941) by @​claykom - fix: fixing `config.toml` [#​952](yorukot/superfile#952) by @​wassup05 </p> </details> **Full Changelog**: yorukot/superfile@v1.3.2...v1.3.3 ### [`v1.3.2`](https://github.com/yorukot/superfile/releases/tag/v1.3.2) [Compare Source](yorukot/superfile@v1.3.1...v1.3.2) Hey folks. Releasing v1.3.2 with multiple new features including implementation image preview using kitty protocol, and various bug fixes and internal improvements. ##### **You can now preview images in high quality — no more pixelation!** <img width="1267" height="670" alt="image" src="https://github.com/user-attachments/assets/0f7ec48e-9386-4716-92a5-4a02783f6612" /> #### Install: [**Click me to know how to install**](https://github.com/yorukot/superfile?tab=readme-ov-file#installation) #### Highlights - Added image preview via kitty protocol. Thanks @​JassonCordones and @​yorukot for the implementation. - Added Zoxide support for path resolution in initial configuration. Thanks @​yorukot for this. - New 0x96f Theme by @​filipjanevski - Various usability and layout bug fixes. See "Detailed Change Summary" below. Thanks to @​larsn03 @​Frost-Phoenix @​TheLazron @​vkhatsiur @​Khitoshi @​claykom ##### Developer Improvements - Added CI Action to run unit tests and build for windows. - Updated contribution guidelines and MR template - Added a dev.sh script for building, linting and running tests for faster development workflows. #### Detailed Change Summary <details><summary>Details</summary> <p> ##### Update - Normalize user-facing naming to superfile [#​880](yorukot/superfile#880) by @​yorukot - Add kitty protocol for image preview [#​841](yorukot/superfile#841) by @​JassonCordones - feat: add Zoxide support for path resolution in initial configuration [#​892](yorukot/superfile#892) by @​yorukot - feat: update superfile's help output [#​908](yorukot/superfile#908) by @​yorukot - feat: Add Action to Publish to Winget [#​925](yorukot/superfile#925) by @​claykom - feat: update superfile build test for the windows and macOS [#​922](yorukot/superfile#922) by @​yorukot - Theme: add 0x96f theme [#​860](yorukot/superfile#860) by @​filipjanevski ##### Bug fix - fix: outdated and broken nix flake [#​846](yorukot/superfile#846) by @​Frost-Phoenix - fix: handle UTF-8 BOM in file reader [#​865](yorukot/superfile#865) by @​vkhatsiur - fix icon displayed on spf prompt when nerdfont disabled [#​878](yorukot/superfile#878) by @​claykom - fix: create item check for dot-entries [#​817](yorukot/superfile#817) by @​TheLazron - fix: prevent pasting a directory into itself, avoiding infinite loop [#​887](yorukot/superfile#887) by @​yorukot - fix: clear search bar value on parent directory reset [#​906](yorukot/superfile#906) by @​yorukot - fix: enhance terminal pixel detection and response handling [#​904](yorukot/superfile#904) by @​yorukot - fix: Cannot Build superfile on Windows [#​921](yorukot/superfile#921) by @​claykom - fix: Improve command tokenization to handle quotes and escapes [#​931](yorukot/superfile#931) by @​Khitoshi - fix: Dont read special files, and prevent freeze [#​932](yorukot/superfile#932) by @​lazysegtree - Compress all files selected [#​821](yorukot/superfile#821) by @​larsn03 ##### Optimization - Metadata and filepanel rendering refactor [#​867](yorukot/superfile#867) by @​JassonCordones - refactor: simplify panel mode handling in file movement logic [#​907](yorukot/superfile#907) by @​yorukot - refactor: standardize TODO comments and ReadMe to README [#​913](yorukot/superfile#913) by @​yorukot ##### Documentation - enhance: add detailed documentation for InitIcon function and update … [#​879](yorukot/superfile#879) by @​yorukot - docs: add documentation for image preview [#​882](yorukot/superfile#882) by @​yorukot - docs: update contributing guide and MR template [#​885](yorukot/superfile#885) by @​yorukot - docs: update README and plugin documentation for clarity and structure [#​902](yorukot/superfile#902) by @​yorukot - feat(docs): Update arch install package docs [#​929](yorukot/superfile#929) by @​booth-w ##### CI/CD - ci: add MR title linting with semantic-pull-request action [#​884](yorukot/superfile#884) by @​yorukot - ci: improve MR workflows with contributor greeting and title linter fix [#​886](yorukot/superfile#886) by @​yorukot ##### Dependencies - build(deps): bump prismjs from 1.29.0 to 1.30.0 in /website [#​786](yorukot/superfile#786) by @​dependabot[bot] - fix(deps): update dependency astro to v5.8.0 [#​787](yorukot/superfile#787) by @​renovate[bot] - chore(deps): bump vite from 6.3.3 to 6.3.5 in /website [#​822](yorukot/superfile#822) by @​dependabot[bot] - fix(deps): update dependency sharp to v0.34.2 [#​909](yorukot/superfile#909) by @​renovate[bot] - fix(deps): update astro monorepo [#​894](yorukot/superfile#894) by @​renovate[bot] - fix(deps): update fontsource monorepo to v5.2.6 [#​910](yorukot/superfile#910) by @​renovate[bot] ##### Misc - chore(license): update copyright year [#​895](yorukot/superfile#895) by @​yorukot - feat: add ignore missing field flag [#​881](yorukot/superfile#881) by @​claykom - feat: add sitemap integration and update giscus input position [#​912](yorukot/superfile#912) by @​yorukot </p> </details> #### New Contributors * @​filipjanevski made their first contribution in yorukot/superfile#860 * @​larsn03 made their first contribution in yorukot/superfile#821 * @​vkhatsiur made their first contribution in yorukot/superfile#865 * @​claykom made their first contribution in yorukot/superfile#878 * @​TheLazron made their first contribution in yorukot/superfile#817 * @​Khitoshi made their first contribution in yorukot/superfile#931 **Full Changelog**: yorukot/superfile@v1.3.1...v1.3.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
close #917
Description
This PR resolves the issue with Python package management in the
dev.shscript by adding support for Python virtual environments when running the integration testsuite.Changes Made
Added Virtual Environment Support
--use-venvcommand line flag to enable Python virtual environment usagesetup_venv()function to create and activate virtual environmentscleanup_venv()function to properly deactivate virtual environmentstestsuite/venvwhen enabledEnhanced Testsuite Execution
--use-venvflag is used:testsuite/venvUpdated Documentation
--use-venvoption to help messageUsage Examples
Summary by CodeRabbit