Skip to content

Published wheels since v1.2.0 omit the bundled codeanalyzer-java JAR #284

Description

@rahlk

Summary

Every hatchling-built wheel/sdist since v1.2.0 ships without the bundled
codeanalyzer-java JAR, so pip install cldk + CLDK.java(...) fails with
CodeanalyzerExecutionException: codeanalyzer jar not found.

Affected published wheels (verified on PyPI)

VersionWheel sizeJAR
1.4.3176 KB✗ missing
1.4.2176 KB✗ missing
1.4.1176 KB✗ missing
1.4.0174 KB✗ missing
1.2.0168 KB✗ missing
2.0.0rc1188 KB✗ missing
≤ 1.1.3 (setuptools era)26–56 MB✓ present

Root cause

  • The root .gitignore has *.jar; the nested cldk/analysis/java/codeanalyzer/jar/.gitignore
    re-includes it with !codeanalyzer-*.jar. git honors the negation (the JAR is tracked and
    in every tag); hatchling applies *.jar at build time but does not honor the nested
    negation, so it drops the JAR.
  • Hatchling only applies .gitignore exclusion when a .git dir is present — which CI has — so
    the bug reproduces in CI but not on a git archive / source-tarball build (a false negative
    that hid it for 5 releases).
  • release.yml even has an "Inject the latest Code Analyzer JAR" step that downloads the JAR
    before uv build — hatchling silently discards it anyway.

Reproduction

# In a tree WITH .git (CI condition):
uv build && unzip -l dist/*.whl | grep codeanalyzer-.*jar # -> 176 KB wheel, NO jar

Byte-identical to the published 1.4.3 wheel (176081 bytes).

Fix

Force-include the VCS-ignored JAR via hatchling's artifacts, and add a release-workflow guard
that fails the job before publishing if a built artifact is missing the JAR.

Affects pyproject.toml and .github/workflows/release.yml. Requires a follow-up 1.4.4
release since 1.4.3 is already published jarless.

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