Skip to content
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

RFC: Change package managament to UV #2199

Open
cjdsellers opened this issue Jan 9, 2025 · 4 comments
Open

RFC: Change package managament to UV #2199

cjdsellers opened this issue Jan 9, 2025 · 4 comments
Assignees
Labels
enhancement New feature or request RFC A request for comment

Comments

@cjdsellers
Copy link
Member

This RFC proposes changing the package and dependency management tooling for NautilusTrader from Poetry to UV.

Pros

  • Performance (dependency resolution, env setup, package installation, etc)
  • Improved/simplified environment setup
  • Improved/simplified python version management (could also replace the recommended pyenv for this?)
  • Potentially better design principles than Poetry - less issues, more longevity?
  • Gaining community adoption fast

Cons

I'm not currently aware of any disadvantages of using UV over Poetry?

Questions

  • Is there anything which Poetry can do right now which UV can't, specific to NautilusTrader?
  • Does anyone have any hesitations about making this change soon?
  • Does anyone have suggestions for alternatives? (e.g., pixi already suggested and is conda specific)
@cjdsellers cjdsellers added enhancement New feature or request RFC A request for comment labels Jan 9, 2025
@cjdsellers cjdsellers self-assigned this Jan 9, 2025
@sunlei
Copy link
Collaborator

sunlei commented Jan 10, 2025

In our project, we have experimented with the following setups:

  • asdf + poetry
  • asdf + pdm
  • mise + poetry
  • mise + pdm

We ultimately settled on: mise + poetry.

The switch from asdf to mise brought significant benefits.
The transition from poetry to pdm was not made due to the large number of projects involved; however, pdm has been adopted in some personal projects.

I’ve been keeping an eye on uv, but haven’t yet invested time to explore it in detail.

@davidsblom
Copy link
Collaborator

Very welcome change. One thing I like is that when nautilus is added as a dependency to another project with git via uv, it doesn't fetch the complete git history unlike poetry.

@faysou
Copy link
Collaborator

faysou commented Jan 10, 2025

uv is not supported yet by intellijidea, but should be soon https://youtrack.jetbrains.com/issue/PY-70533/Support-package-management-via-uv

uv presentation for reference https://youtu.be/gSKTfG1GXYQ

@omencat
Copy link

omencat commented Jan 13, 2025

Glad to see some uv converts. I am by no means a uv expert, but here is my uv pyproject.toml that works with nautilus_trader that might be of help kick starting this effort.

[project]
name = "nautilus_trader"
version = "0.1.0"
description = "Your best friend, out of the box!"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
    "cython==3.1.0a1",
    "msgspec>=0.19.0,<0.20.0",
    "nautilus-trader[dydx]==1.211.0a20250112",
    "numba>=0.60.0",
    "scikit-learn>=1.5.2",
]
[[tool.uv.index]]
name = "nautilus-trader"
url = "https://packages.nautechsystems.io/simple"
# [tool.uv.sources]
# nautilus-trader = { git = "https://github.com/nautechsystems/nautilus_trader.git", branch = "develop" } #rev = "19a599619b110fc7087f9f3baf58dd7916bb2ffe" }
[build-system]
requires = ["setuptools>=75.6.0", "wheel", "setuptools-rust>=1.10.2"]
build-backend = "setuptools.build_meta"

[dependency-groups]
dev = [
    "ipykernel>=6.29.5",
    "matplotlib>=3.10.0",
]

I'm still learning it myself. after updates I run: uv lock --upgrade;uv sync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request RFC A request for comment
Projects
None yet
Development

No branches or pull requests

5 participants