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

Building a project with dev dependencies does not make those dev dependencies installable. #12248

Open
boatcoder opened this issue Mar 17, 2025 · 2 comments
Labels
question Asking for clarification or support

Comments

@boatcoder
Copy link

Summary

uv add --dev places packages in the dependency-groups section of pyproject.toml
uv build does not build them into an installable section djadmin[dev]
You have to move/copy them from dependency-groups to [project.optional-dependencies] so that you can get them to install.

This might be as designed or desired but it is definitely puzzling when you try to package things and then they won't install. Hopefully this will help someone else that runs into this.

[project]
name = "djadmin"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
    "django>=5.1.6",
    "django-extensions>=3.2.3",
    "django-hint>=0.3.2",
    "django-nested-admin>=4.1.1",
    "django-stubs-ext>=5.1.3",
    "djantic>=0.7.0",
    "pgvector>=0.3.6",
    "psycopg2-binary>=2.9.10",
]

[project.optional-dependencies]
dev = [
    "model-bakery>=1.20.4",
    "pyyaml>=6.0.2",
    "requests>=2.32.3",
    "django-debug-toolbar>=5.0.1",
]

[dependency-groups]
dev = [
    "responses>=0.25.7",
]

Platform

mac0S 14.2.1

Version

uv 0.6.6

Python version

No response

@boatcoder boatcoder added the bug Something isn't working label Mar 17, 2025
@zanieb
Copy link
Member

zanieb commented Mar 17, 2025

This is intentional. dependency-groups and development dependencies are not part of the published project.

https://docs.astral.sh/uv/concepts/projects/dependencies/#development-dependencies

It sounds like you want uv add --optional dev instead.

@zanieb
Copy link
Member

zanieb commented Mar 17, 2025

Note this is not just a detail of uv, but the intent of the Python standard for development dependency groups https://peps.python.org/pep-0735/

@zanieb zanieb added question Asking for clarification or support and removed bug Something isn't working labels Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

2 participants