Skip to content

uv packaging#3184

Open
deruyter92 wants to merge 45 commits intoDeepLabCut:mainfrom
deruyter92:arash_and_jaap/uv_packaging
Open

uv packaging#3184
deruyter92 wants to merge 45 commits intoDeepLabCut:mainfrom
deruyter92:arash_and_jaap/uv_packaging

Conversation

@deruyter92
Copy link
Collaborator

@deruyter92 deruyter92 commented Jan 16, 2026

Replacement PR for #3134 by @arashsm79
(cannot push changes to the original branch)

Summary
This PR performs an overhaul on how DLC is packaged.
uv is an extremely fast Python package and project manager that has seen incredible adoption from the Python community.
Here, the first steps are taken to package DLC with uv for different platforms and Python version.

The CI has also been updated accordingly to use uv.
The CI will be updated accordingly in a separate PR

How to use this PR
Checkout this PR on a local copy of DLC.
Install uv
If you are not familiar with uv, you can take a look at their Getting Started page.
Run uv sync with the extra dependencies you may want (you can take a look at the ci.yml file in this PR for example usage of uv.
Like: uv sync --extra gui --python 3.11
uv run deeplabcut

(Solves issue #3111 and similar)

@deruyter92 deruyter92 mentioned this pull request Jan 16, 2026
@deruyter92 deruyter92 force-pushed the arash_and_jaap/uv_packaging branch from 9bb8d35 to 2929daa Compare January 16, 2026 13:31
@deruyter92 deruyter92 force-pushed the arash_and_jaap/uv_packaging branch from 81c9b12 to e824a5b Compare January 16, 2026 13:59
@deruyter92 deruyter92 requested a review from Copilot January 16, 2026 16:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates DeepLabCut's packaging system from the traditional setup.py to a modern pyproject.toml-based configuration using uv as the package manager. The migration streamlines dependency management and follows current Python packaging best practices.

Changes:

  • Migrated package configuration from setup.py to pyproject.toml with support for multiple Python versions and platforms
  • Removed obsolete development tools and scripts that are no longer needed with the new packaging approach
  • Updated documentation to reflect the new installation methods using both uv and pip

Reviewed changes

Copilot reviewed 10 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Complete package configuration with dependencies, optional extras, and platform-specific requirements
setup.py Simplified to a compatibility shim that delegates to pyproject.toml
README.md Updated installation instructions for both PyPI and source installations
.pre-commit-config.yaml Replaced black with ruff for code formatting
.github/workflows/python-package.yml Updated CI to install package directly instead of using requirements.txt
tools/update_license_headers.py Removed obsolete developer tool
tools/README.md Removed documentation for obsolete developer tools
testscript_cli.py Removed obsolete test script
reinstall.sh Removed obsolete installation script
dlc.py Removed obsolete CLI entry point file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@deruyter92 deruyter92 marked this pull request as ready for review January 21, 2026 17:05
@deruyter92 deruyter92 requested a review from C-Achard January 21, 2026 17:05
@deruyter92 deruyter92 added enhancement New feature or request dependencies Pull requests that update a dependency file labels Jan 21, 2026
@deruyter92 deruyter92 marked this pull request as draft January 22, 2026 06:45
@deruyter92 deruyter92 marked this pull request as ready for review January 22, 2026 08:59
@deruyter92 deruyter92 force-pushed the arash_and_jaap/uv_packaging branch from f906c5d to a1e370b Compare January 22, 2026 09:06
arashsm79 and others added 2 commits January 22, 2026 12:02
- Edit pyproject.toml
- Keep setup.py for backward compatibility
@deruyter92 deruyter92 force-pushed the arash_and_jaap/uv_packaging branch from 5763d4b to eb04efa Compare January 22, 2026 11:09
@C-Achard C-Achard self-requested a review February 4, 2026 16:42
Copy link
Collaborator

@C-Achard C-Achard left a comment

Choose a reason for hiding this comment

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

NOTE This is definitely for a later PR. We are not using importlib.resources in the code but relying on os.realpath which is not really the best way to do this. Still, feel free to have a look


Lots of fairly low-level details that may be worth checking, if not in this PR at least in a subsequent one. Let me know what you think @deruyter92

@deruyter92 deruyter92 marked this pull request as draft February 5, 2026 10:45
deruyter92 and others added 4 commits February 5, 2026 11:46
Co-authored-by: Cyril Achard <cyril.achard@alumni.epfl.ch>
Co-authored-by: Cyril Achard <cyril.achard@alumni.epfl.ch>
Co-authored-by: Cyril Achard <cyril.achard@alumni.epfl.ch>
Co-authored-by: Cyril Achard <cyril.achard@alumni.epfl.ch>
@deruyter92 deruyter92 marked this pull request as ready for review February 9, 2026 09:07
@deruyter92 deruyter92 requested a review from MMathisLab February 9, 2026 09:07
@deruyter92
Copy link
Collaborator Author

@MMathisLab, I have removed all unrelated changes. Let me know what you think. NB, the package can be installed exactly as before, so I left the README unchanged for now. We can always decide to add uv installation instructions in a separate PR.

Co-authored-by: Cyril Achard <cyril.achard@alumni.epfl.ch>
Update .pre-commit-config.yaml to add TOML support and pyproject checks: include the check-toml hook and add pyproject-fmt (rev v2.15.2) and validate-pyproject (rev v0.25) repositories. These hooks enforce formatting and validation for pyproject.toml files as part of pre-commit.
@C-Achard
Copy link
Collaborator

See deruyter92#1 for pyproject validation hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants