[Bug]: old catalog_data not cleared out on a pip install
Where did you find this bug?
PyGambit
What operating system are you using?
macOS
What version of Gambit are you using?
development
What happened?
The failures one gets when the catalog structure is updated, e.g. here:
http://github.com/gambitproject/gambit/actions/runs/26894409878/job/79329166508
do not show up on a local install. This seems to be because old package data persists in catalog_data, e.g., for me:
/Users/rahul/.virtualenvs/gambit/lib/python3.13/site-packages/pygambit/catalog_data/selten1975/fig2.nfg
is still there, where it should now only be the following (which is also there):
/Users/rahul/.virtualenvs/gambit/lib/python3.13/site-packages/pygambit/catalog_data/journals/ijgt/selten1975/fig1.efg
I've come across this issue before and found it fiddly to get around, though it isn't an issue if you switch to an editable install when doing catalog changes (which I recommend in the "important" block at the top of the dev doc, worth doing anyway so you don't need to redo a pip install each time before running the update script), however you're right that this would be good to fix anyway.
The issue seems to be that the package data that gets added via these lines in pyproject.toml doesn't always remove files that have been removed on a reinstall:
[tool.setuptools.package-data]
pygambit = ["catalog_data/**/*"]
I've come across this issue before and found it fiddly to get around, though it isn't an issue if you switch to an editable install when doing catalog changes (which I recommend in the "important" block at the top of the dev doc, worth doing anyway so you don't need to redo a pip install each time before running the update script), however you're right that this would be good to fix anyway.
The issue seems to be that the package data that gets added via these lines in
pyproject.tomldoesn't always remove files that have been removed on a reinstall:[tool.setuptools.package-data] pygambit = ["catalog_data/**/*"]
OK, I think we should expand the docs to mention this issue and indeed suggest doing -e not just for convenience but for robust testing. Then we can close issue #920.
From Rahul: Are there perhaps some other pip flags like a "clean" analog that we are missing and would fix this?