Skip to content

Conversation

@authierj
Copy link
Contributor

@authierj authierj commented Jan 22, 2026

Checklist before merging this PR:

  • Mentioned all issues that this PR fixes or addresses.
  • Summarized the updates of this PR under Summary.
  • Added an entry under Unreleased in the Changelog.

Fixes #2990

Summary

Migrates Darts from pip to uv, a modern, fast Python package manager. Consolidates all dependency management into pyproject.toml, deprecates the u8darts package, and modernizes CI/CD infrastructure.

⚠️ Breaking Change

The u8darts package is deprecated and will no longer be maintained. Users should migrate to darts with optional extras.

Migration Guide

Before (u8darts) After (darts)
pip install u8darts pip install darts
pip install u8darts[torch] pip install "darts[torch]"
pip install u8darts[all] pip install "darts[all]"

Key Changes

1. Dependency Management

  • Removed requirements/* folder - all dependencies now managed in pyproject.toml
  • Updated all GitHub Actions workflows to use uv commands
  • Configured setup-uv@v7 action with automatic caching in CI

2. Package Simplification

  • The darts package now uses a modular installation system with optional extras:
    • pip install darts - Core only (minimal dependencies)
    • pip install "darts[torch]" - Core + PyTorch models
    • pip install "darts[notorch]" - Core + Prophet, LightGBM, CatBoost, XGBoost, StatsForecast
    • pip install "darts[all]" - All available models

3. Build System Modernization

  • Removed setup.py, setup_u8darts.py, MANIFEST.in - consolidated to PEP 621 compliant pyproject.toml
  • Removed .bumpversion.cfg - migrated configuration to [tool.bumpversion] in pyproject.toml
  • Updated make_dists.sh to use uv build
  • Fixed license format to use SPDX identifier (Apache-2.0)

4. CI/CD Improvements

  • Removed redundant .github/workflows/update-cache.yml (cache now managed automatically by setup-uv)
  • Added uv cache prune --ci to all workflow jobs for optimal cache management (ref)
  • Updated all workflows: develop.yml, merge.yml, release.yml, doc.yml
  • Modernized version bumping workflow:
    • Replaced unmaintained bump2version with bump-my-version>=1.2.5
    • Replaced third-party GitHub Actions with official maintained action (callowayproject/bump-my-version@v0.27.0)
    • Added user-friendly dropdown menu for version selection (patch/minor/major)

5. Docker & Conda Updates

  • Rewrote Dockerfile to use uv instead of pip
    • Now uses official ghcr.io/astral-sh/uv:0.9.26 image
    • Uses uv sync --group dev-all --frozen for reproducible builds
  • Updated conda_recipe/darts/meta.yaml to read from pyproject.toml using modern load_file_data()

6. Documentation Updates

  • Updated INSTALL.md with new modular installation instructions
  • Updated CLAUDE.md with uv development workflow
  • Updated CONTRIBUTING.md with uv commands

Testing

  • Tested local installation with uv sync
  • Verified CI passes on all workflows
  • Tested Docker build
  • Tested conda recipe

@authierj authierj requested a review from dennisbader as a code owner January 22, 2026 09:16
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.63%. Comparing base (bc4d747) to head (87b8420).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2993      +/-   ##
==========================================
- Coverage   95.69%   95.63%   -0.07%     
==========================================
  Files         154      154              
  Lines       16604    16623      +19     
==========================================
+ Hits        15890    15898       +8     
- Misses        714      725      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@authierj authierj marked this pull request as draft January 22, 2026 17:06
Copy link
Collaborator

@brunnedu brunnedu left a comment

Choose a reason for hiding this comment

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

Overall looks really good and it's great to see you pushing to update our environment management! I tested as much as I could on my side (installation of different flavors, building the package, running tests, building docs, conda build, docker build etc.) and it mostly worked flawlessly. Left some minor suggestions throughout. Thanks for the great work on this migration! 🚀

pyproject.toml Outdated
zip-safe = false

[tool.setuptools.packages.find]
exclude = ["examples*", "static*", "datasets*", "darts_logs*", "conda_recipe*", "from_df_times*"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some of these exclusions are probably not required (e.g. from_df_times*) while tests* should probably be excluded. Long-term, would it make sense to move from a darts/darts/ to a darts/src/darts layout? It’s the modern 'gold standard' because it implicitly handles these exclusions and ensures we only ship what's in the source folder. What do you think @dennisbader?

6. Create a new branch:
4. Install [uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already: `curl -LsSf https://astral.sh/uv/install.sh | sh`
5. Install all development dependencies: `uv sync --group dev-all`
6. Set up [automatic code formatting and linting](#code-formatting-and-linting)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know it's a bit unrelated but would it make sense to include the uv run pre-commit install command right here without having to follow the link and potentially missing it? @dennisbader

Suggested change
6. Set up [automatic code formatting and linting](#code-formatting-and-linting)
6. Set up [automatic code formatting and linting](#code-formatting-and-linting): `uv run pre-commit install`

@authierj authierj changed the title Uv test github action Migrate to uv and pyproject.toml, drop u8darts Jan 29, 2026
authierj and others added 2 commits January 29, 2026 15:25
Co-authored-by: Dustin Brunner <92083143+brunnedu@users.noreply.github.com>
Co-authored-by: Dustin Brunner <92083143+brunnedu@users.noreply.github.com>
@authierj authierj marked this pull request as ready for review January 29, 2026 14:27
authierj and others added 7 commits January 29, 2026 15:47
Add python-version parameter to setup-uv actions and update UV to 0.9.
Fixes onnxruntime installation failures caused by UV using Python 3.14.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

Adopting uv for faster dependency management

2 participants