Skip to content

Include metadata.json in the published package #1163

@olejorgenb

Description

@olejorgenb

Starting with dbc 2.0.0, metadata.json is no longer included in the published wheel. It was present in 1.7.1 and earlier.

The dash_bootstrap_components/_components/metadata.json file contains the JS-level component type metadata (prop types, descriptions, defaults, etc.) that is generated by dash-generate-components during the build. It's the same file that all other Dash component packages ship (dash.dcc, dash.html, dash_ag_grid, dash_daq, etc.).

Verified by inspecting the wheels directly:

1.7.1 — present

dash_bootstrap_components/_components/metadata.json ✓

2.0.4 — absent
(no metadata.json anywhere in the wheel)

Why is the file useful?

I do see that the file is not explicitly documented as a build artifact to include in the package, but it can be quite useful for downstream tooling that reads metadata.json for code generation, introspection, or IDE support. And all of the built-in dash packages do include it.

It is less severe since the type annotations are richer after Dash 3. I believe they contain most/all of the same information.


Root cause

The migration to hatchling as build backend. Hatchling respects .gitignore by default, and the dbc .gitignore excludes _components/. The pyproject.toml whitelists specific generated files via [tool.hatch.build.targets.wheel] artifacts, but only *.py and *.min.js — metadata.json was not included:

  [tool.hatch.build.targets.wheel]
  artifacts = [
      "dash_bootstrap_components/_components/dash_bootstrap_components.min.js",
      "dash_bootstrap_components/_components/*.py",
  ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions