Skip to content

Conversation

@nedfreetoplay
Copy link

Simplify the virtual-environment setup by replacing large, platform-specific interactive shells with small delegating wrappers and a single cross-platform Python setup script.

What I changed

  • Replaced the bulk of the old interactive logic in setup_venv.bat with a minimal Windows wrapper that finds Python and delegates to setup_venv.py.

  • Replaced the bulk of the old interactive logic in setup_venv.command with a minimal macOS wrapper that locates Python and execs setup_venv.py.

  • Added setup_venv.py: a cross-platform, interactive Python script that:

  • prints the banner and checks Python,
  • confirms/recreates the venv directory,
  • supports simple and advanced install flows,
  • allows selecting Qt/mpv/OpenCV/dev/future options,
  • creates the venv and installs dependencies (via pip) using package extras.
  • added dependency-groups and project.optional-dependencies entries (e.g. qt6-new, mpv-new, opencv-new, dev, etc.) so installs use package extras instead of scattered requirement files.
  • Updated .gitignore to ignore common build artifacts (*.egg-info/, dist/, build/).

Why

  • Single, maintainable entrypoint for venv creation and dependency installation reduces duplication and divergence across platform scripts.

  • Moving to pyproject.toml optional-dependencies / dependency-groups centralizes package metadata, making it simpler to install configurable dependency sets via package extras (and easier to keep synced).

  • A Python-based installer improves cross-platform behavior, error handling, and is easier to extend and test than complex shell/batch logic.

User-facing notes / upgrade steps

  • pip install .[qt6-new,mpv-new,opencv-new]
  • After the installer finishes, activate the venv as usual:
  • Windows: venv\Scripts\activate.bat
  • Unix/macOS: source venv/bin/activate

Testing / verification

  • Run the installer on target platform and verify:
  • venv is created,
  • python -m pip list shows installed extras,
  • the client can be started from the created venv.
  • If an advanced custom Qt version is required, use the interactive w option (the script will attempt to install the specified PySide6/qtpy versions).

@hydrusnetwork
Copy link
Owner

Hey, thank you for submitting this. I don't normally like to take pull requests, but this is a great step forward. Merging the script into the one shared .py is great, and using just the pyproject.toml is something I wanted to look into and you've done it all.

I won't merge right now, but I'll revisit next Saturday. Looks great.

@hydrusnetwork hydrusnetwork changed the base branch from master to develop February 8, 2026 22:28
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