Skip to content

Automatic and Custom Environments for Emulator Integration and Testing Suite with virtual environments #746

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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

abdallhfattah
Copy link

Description

This PR introduces a Bash script (tools/dev-tool.sh) that simplifies running the SeedSigner emulator and test suite in isolated Python virtual environments. The original script was created by @fedebuyito I’ve translated it into English, refactored it into modular functions, and improved usability with clearer error handling and Python version checks.

Motivation

Inspired by discussions in the SeedSigner community and proposals like #681, this tool aims to streamline development workflows by enabling a single-command setup for:

  • Dev mode: launches the emulator in a dedicated virtual environment.
  • Test mode: runs the full test suite within an isolated virtual environment.

This approach helps avoid polluting the global environment or the main repo, making it easier to switch between development and testing tasks, and improves reproducibility.

Usage Examples

./tools/dev-tool.sh                                # Default: dev mode with current Python version
./tools/dev-tool.sh test test_env python3.11       # Test mode with custom venv name and Python version

The script supports flexible arguments and has been tested on major Linux distributions, including Arch, Kubuntu, and Ubuntu.

Screenshots omitted as this is a command-line tool.


This pull request is categorized as:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Other

Checklist

  • I’ve run pytest and verified all unit tests pass before submitting this PR.

If you modified or added functionality/workflow, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

Tested on:

@kdmukai
Copy link
Contributor

kdmukai commented May 1, 2025

Big caveat to my thoughts here: I have not read through the entire bash script nor have I ever tried to get the emulator running.

With that in mind, I am a mild NACK on this for now.

Setting up a basic virtualenv in order to get the test suite running should be trivial for the average python dev. Virtualenvs can be a little confusing and messy at first, but this is a python ecosystem problem, not a SeedSigner problem. If you're a python dev, figure out virtualenvs. Period.

As for the emulator, if it requires a lengthy bash script to wrangle dependencies, env vars, etc, then that script should reside in the emulator repo, not here.

As a general principle, we don't want complex bash scripts in the main repo if we can avoid it, even if they're just meant for local dev.

My NACK feels a lot less mild now that I've articulated all this. Fairly strong NACK.

@abdallhfattah
Copy link
Author

i initially had some trouble running the tests without encountering errors, but to be honest, i wasn’t following the instructions in the README.md file. Personally, i would have preferred a setup script to handle that, but I completely agree with your points.

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