Skip to content

Ship the experimental CSVs in the wheel (fixes expdata on install) - #15

Merged
simulkade merged 1 commit into
mainfrom
fix-package-data
Oct 2, 2026
Merged

simulkade merged 1 commit into
mainfrom
fix-package-data

Conversation

@simulkade

Copy link
Copy Markdown
Contributor

pip install pyepisuite produces a package where every expdata class raises FileNotFoundError. Reproduced against the 1.3.0 just published:

>>> from pyepisuite.expdata import HenryData
>>> HenryData()
FileNotFoundError: .../site-packages/pyepisuite/../../data/henrywin/Henry_PhysProp_Data.csv

Cause

expdata.data_folder() resolved the CSVs as <package>/../../data — that is site-packages/data once installed, a path that only exists in a source checkout.

  • Wheel (30 KB): no data at all
  • Sdist (8.2 MB): contained data/, but installs only src/pyepisuite, so it failed identically
  • MANIFEST.in: inert. It is a setuptools file and this project builds with hatchling, which never read it — the 1.3.0 sdist shipped notebooks/ and docs/, which the file does not list

Affects HenryData, BoilingPointData, MeltingPointData, VaporPressureData, SolubilityData and logKowData, and has been broken since at least 1.1.0. The tests never caught it because they run from the source tree, where the fallback path resolves.

Fix

Only 8 of the ~15 MB in data/ are runtime data. Those are mapped into the wheel at pyepisuite/data/ via [tool.hatch.build.targets.wheel.force-include], and data_folder() prefers the packaged copy, falling back to the repo root for source checkouts — so editable installs and the data-cleanup notebooks keep working, and no files move.

The sdist is also trimmed: it was sweeping in the whole repo. The eight CSVs stay, because the wheel build reads them out of the sdist.

Before After
Wheel 30 KB 955 KB
Sdist 8.2 MB 1.1 MB

Verification

Clean Python 3.12 venv, installed from the built artifacts:

Dataset Rows
HenryData 1829
BoilingPointData 6113
MeltingPointData 11475
VaporPressureData 3037
SolubilityData 1450
logKowData 13345
  • Works from both the wheel and the sdist, including the sdist→wheel round trip
  • HenryData().HLC('50-00-0') → 3.37e-07
  • Source checkout still resolves data_folder() to the repo-root data/
  • 88 tests pass; twine check passes on both artifacts

Version bumped to 1.3.1 — 1.3.0 is already on PyPI and can't be replaced.

🤖 Generated with Claude Code

`expdata.data_folder()` resolved the datasets as `<package>/../../data`,
which is `site-packages/data` once installed and only ever existed in a
source checkout. The wheel carried no data at all, and while the sdist
did contain `data/`, it installed only `src/pyepisuite`, so it failed the
same way.

Every class in the module raised FileNotFoundError on any installed copy:
HenryData, BoilingPointData, MeltingPointData, VaporPressureData,
SolubilityData and logKowData. Broken since at least 1.1.0 - the tests
never caught it because they run from the source tree, where the fallback
path happens to resolve.

- Map the eight runtime CSVs into the wheel at `pyepisuite/data/` via
  hatch force-include. data_folder() prefers that packaged copy and falls
  back to the repo-root `data/` for source checkouts, so editable
  installs and the notebooks keep working. Wheel: 30 KB -> 955 KB.
- Trim the sdist, which was sweeping in the entire repo. Drops the
  .xls/.doc source material, the unread bcfbaf and waternt trees, and
  notebooks/docs/examples. 8.2 MB -> 1.1 MB. The eight CSVs stay, because
  the wheel build reads them out of the sdist.
- Remove MANIFEST.in. It is a setuptools file; hatchling never read it.
  The 1.3.0 sdist contained notebooks/ and docs/, which it does not list.

Verified: clean 3.12 venv from both the wheel and the sdist loads all six
datasets; source checkout still resolves to the repo root; 88 tests pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@simulkade
simulkade merged commit 00936fc into main Oct 2, 2026
5 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