Skip to content

setup: venv to manage python dependencies automatically#44

Open
Pistonight wants to merge 1 commit into
open-ead:masterfrom
Pistonight:python_venv
Open

setup: venv to manage python dependencies automatically#44
Pistonight wants to merge 1 commit into
open-ead:masterfrom
Pistonight:python_venv

Conversation

@Pistonight
Copy link
Copy Markdown

@Pistonight Pistonight commented May 31, 2026

I started using uv to manage python projects and it doesn't come with a nice way to install global pip packages. I think it would be nice to have the setup script make a python venv automatically and install the necessary dependencies, which will make the setup more streamlined as well. Another benefit is the wheel versions are locked

With this change, downstream projects just need to insert this snippet in tools/setup.py at the top (before importing other modules - this will setup the venv and execv into the venv)

from common.setup_venv import enter_venv
if __name__ == "__main__":
    enter_venv()

Now people setting up the project just need to have python installed (to run the setup script itself), and a venv will be created at tools/common/venv automatically.

A shim for asm-differ is created for viking to call. If this shim does not exist, it will fallback to the current behavior of trying to call diff.py using global python. This way the change is fully backward-compatible and everything should behave as-is if the above snippet is not used. Projects can opt-in to the new behavior by updating the setup script.


This change is Reviewable

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.

1 participant