Skip to content

Exclude depletion chain xml files from the wheel and sdist - #39

Merged
shimwell merged 1 commit into
mainfrom
exclude-chains-from-wheel
Aug 19, 2026
Merged

Exclude depletion chain xml files from the wheel and sdist#39
shimwell merged 1 commit into
mainfrom
exclude-chains-from-wheel

Conversation

@shimwell

Copy link
Copy Markdown
Member

The 2.5.0 release failed to upload to PyPI with a 400 Bad Request. The wheel was 210 MB, over the 100 MB per file limit (2.4.2 was 86.9 MB, so it had been close to the limit already and the newly added chains tipped it over).

The chain xml files under src/openmc_data/depletion are tracked in git so download_chain can fetch them from the github raw urls in urls_xml.py. They were also being picked up as package data, since include-package-data defaults to true for pyproject.toml based config and setuptools_scm adds every tracked file to the file finder. Nothing reads them from the installed package.

  • include-package-data = false plus an explicit package-data entry for the json files, which are the only data files read at runtime (add_branching_ratios reads branching_ratios_*.json)
  • MANIFEST.in to keep the xml out of the sdist too

Checked on a local build:

before after
wheel 210 MB 95 KB
sdist ~86 MB 72 KB

No .xml in either distribution, all five json files still present and loadable from site-packages after installing the wheel, twine check passes on both.

Unrelated, the build also warns that the project.license table form is deprecated and needs to be a SPDX string by 2027-Feb-18. Left alone here.

The chain xml files under src/openmc_data/depletion are tracked in git so
that download_chain can fetch them from the github raw urls listed in
urls_xml.py. They were also being picked up as package data, which took
the 2.5.0 wheel to 210 MB and caused PyPI to reject the upload with a
400, the per file limit being 100 MB.

Turn off include-package-data and list the json data files explicitly,
which are the only data files read from the installed package
(add_branching_ratios reads branching_ratios_*.json). Add a MANIFEST.in
to keep the xml files out of the sdist as well.

The wheel goes from 210 MB to 95 KB.
@shimwell
shimwell merged commit a3fd652 into main Aug 19, 2026
3 checks passed
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.

1 participant