Skip to content

uv workspace reorganization#50

Open
micahwoodard wants to merge 9 commits into
mainfrom
feat-uv-workspace-reorg
Open

uv workspace reorganization#50
micahwoodard wants to merge 9 commits into
mainfrom
feat-uv-workspace-reorg

Conversation

@micahwoodard

@micahwoodard micahwoodard commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Updates

  • reorganizes repo to have individual repos be separate packages managed by uv workspaces
  • renames project to mixology
  • updates and fixes imports

Fixed Issues

Merge Checklist

  • update the changelog
  • bump the version

@micahwoodard micahwoodard requested review from a team, Poofjunior and hannalee2 April 30, 2026 21:32
@micahwoodard

Copy link
Copy Markdown
Contributor Author

Also we should probably rename the repo? This will need to be done in a coordinated way to not break brainslosher-instrument deployment

@hannalee2 hannalee2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the code separation in mixology for common fluidic control code.

After digging a little bit into uv workspaces, it seems that using brainslosher, brainwasher, and seqflow as workspace members is not suitable. We can simply use mixology as a common source code library via path dependencies.

The uv documentation says: "Workspaces are not suited for cases in which members have conflicting requirements, or desire a separate virtual environment for each member. In this case, path dependencies are often preferable."

A workspace creates one giant virtual environment (.venv) at the root of the repo. This would cause brainslosher to install brainwasher's Raspberry Pi hardware libraries, which could lead to crashes. Also, if brainwasher and brainslosher have different dependencies (such as one needing pydantic v2.11 and the other needing v2.0), resolving these conflicting requirements will not work. This becomes especially problematic as we expand to include more instruments.

We keep the instant code-sharing of mixology. If you update mixology's code, brainslosher and brainwasher will instantly see the changes.
Each instrument should get its own isolated .venv an uv.lock files.

I approve since we can change only few lines in pyproject.toml to use path.

Comment thread pyproject.toml Outdated
"pydantic-settings>=2.12.0",
"email-validator>=2.3.0",
"pandas>=2.0.3",
"pyharp>=0.1.0",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a piece of hardware is only ever going to be used by one instrument, I think its driver does not belong in mixology.

For example, if brainwasher uses a very specific Raspberry Pi that brainslosher and seqflow will never use, it would be better to remove those dependencies from mixology and put them directly into brainwasher's pyproject.toml

Comment thread instruments/brainwasher/pyproject.toml Outdated
pythonpath = ["src", "tests"]

[tool.uv.sources]
mixology = { workspace = true }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than using workspace, we can define as a path. mixlology = { path = "...."}

Comment thread instruments/brainslosher/pyproject.toml Outdated
pythonpath = ["src", "tests"]

[tool.uv.sources]
mixology = { workspace = true }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than using workspace, we can define as a path. mixlology = { path = "...."}

Comment thread pyproject.toml Outdated
brainwasher = "brainwasher.scripts.main:main"
brainslosher = "brainwasher.scripts.brainslosher_main:main"
[tool.uv.workspace]
members = ["instruments/*"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After digging some uv workspace usage, maybe we should not use the workspace for sperate instruments.

@micahwoodard

Copy link
Copy Markdown
Contributor Author

@hannalee2 okay sounds good! I will try and make changes later this week

Comment thread pyproject.toml Outdated
Comment on lines 19 to 25
"vicivalve>=0.0.13",
"rpi-hardware-pwm>=0.3.1",
"SM16inpind>=1.0.1",
"SM8mosind>=1.0.1",
"SM16univin>=1.0.3",
"smbus2>=0.5.0",
]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think optional dependacies woud be better :)

Example)
[project.optional-dependencies]
custom_something = ["vicivalve", "sambus2"... ]

I will add barseq specific drivers under optional dependacies. :)

* Monorepo workspaces -> path dependencies for Mixology

* Decouple hardware dependencies from mixology core
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