Skip to content

Conversation

@aviadr1
Copy link
Contributor

@aviadr1 aviadr1 commented Mar 18, 2025

This PR provides the project with a new uv-based dependency management system. The changes include:

What is uv and why is it important?

uv is a modern dependency manager for python that centralizes project metadata in a pyproject.toml file and generates a uv.lock file for reproducible installs, simplifying dependency tracking and environment setup.

Solves:

  • differences between windows and other platforms (triton / triton-windows)
  • publishing to pypi is easy!
  • faster than pip
  • to install csm for other libraries just run uv add --editable git+https://github.com/SesameAILabs/csm@master#egg=csm

For more details, check out uv

Usage:

  1. first install uv if you dont have it https://github.com/astral-sh/uv?tab=readme-ov-file#installation
  2. run uv sync to install everything you need for csm and get running
  3. run uv run python example.py to run a code with csm

These updates aim to improve dependency management and overall developer experience.
.python-version:
A new file is added to specify the Python version (3.12), ensuring that the correct interpreter is used across development environments.

pyproject.toml:
The project metadata is now centralized in a pyproject.toml file following PEP 621 standards. This file defines the project name, version, description, required Python version, and a list of dependencies (including conditional dependencies for platforms such as Linux and Windows).

uv.lock:
A lockfile is generated to capture the resolved state of all dependencies. This ensures reproducible installs and consistent environments regardless of external package updates.

These changes will enable better dependency resolution, reproducibility, and improved management of the project’s virtual environment through uv.

@aviadr1 aviadr1 changed the title create uv-based installation create uv-based installation, package management and venv Mar 18, 2025
@rosmur
Copy link

rosmur commented Mar 22, 2025

Ah beaten to the punch - I was going to submit this PR.

uv has thankfully very quickly become the standard, especially in AI projects. Strongly recommend adopting it and merging this PR

@rosmur
Copy link

rosmur commented Mar 22, 2025

@aviadr1 found 3 issues: the README still has the old pip based installation instructions. The branch is labeled poetry which is confusing.

and errors out on triton:

Resolved 107 packages in 0.93ms error: Distributiontriton==3.0.0 @ registry+https://pypi.org/simple` can't be installed because it doesn't have a source distribution or wheel for the current platform`

@alansrobotlab2
Copy link

just an fyi, your specification of python >= 3.12 is incompatible with the rest of the dependency versions.

requires-python = "==3.10.*" allows a uv sync to proceed without error and matches the recommendations of the repo.

Thanks!

Alan

@rosmur
Copy link

rosmur commented Mar 28, 2025

But does python actually need to be 3.10 for this repo? Or instead should the other dependencies be updated to versions that work with >=3.12 ?

@alansrobotlab2
Copy link

alansrobotlab2 commented Mar 28, 2025

Yeah, that's not my call, I'm just getting it to work with the git specs. Also you'll need to add setuptools to the dependancies list.

But once those two changes are made the sample scripts run without issue.

It's really nice, uv sync followed by uv run run_csm.py is all you need.

@rosmur
Copy link

rosmur commented Apr 3, 2025

@ZackHodari would you mind confirming if python version== 3.10 is required? or is >= 3.10 ok? Or better yet, any reason not to update to >= 3.12?

@ZackHodari
Copy link
Collaborator

I would love for us to land this PR, uv is cool. However, we will only provide one recommended install method, so we'd need to make sure the approach works and brings benefit to users before deprecating the requirements.txt approach.

I feel a big contribution in this pr is cross-platform support. Is there a reason we can't do this with requirements.txt first, once that works we could switch to uv for it's other benefits. To do this I'd want to know what fails in the windows install right now and examples of working requirements.txt for multiple platforms (we can use sys_platform ==)

On the question of python version, it all comes down to testing. We only tested with 3.10, the ideal situation is we don't need to change requirements, but if you test install and run_csm.py on a platform and it can't work with 3.10 then you'd need to look at changing the dependencies or python version

@JohnOluB
Copy link

Yeah, that's not my call, I'm just getting it to work with the git specs. Also you'll need to add setuptools to the dependancies list.

But once those two changes are made the sample scripts run without issue.

It's really nice, uv sync followed by uv run run_csm.py is all you need.

Can you please provide more details on the setup tools you used

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.

5 participants