McCode icon indicating copy to clipboard operation
McCode copied to clipboard

Generate registry files usable by `pooch` in Python

Open g5t opened this issue 1 year ago • 2 comments

For the Python/ANTLR based code-generator I bundled all McStas and McXtrace components plus the C runtime library files into a separate repository to avoid packaging/deploying the files with the module on PyPI.

I think it would be better to use the same component and runtime files as this repository in order to avoid deviations between the lex|flex/yacc|bison generators and the experimental version. There are at least three ways to achieve this:

  1. Switch (at McStas/McXtrace v3.5.0?) to an external component/runtime file repository -- e.g., McFiles.
  2. Update mccode-files to host only the three registry files, with some specialization in mccode-antlr to read the registry from one GitHub URL and its files from another.
  3. Add pooch-compatible registry files to this repository.

I suspect the first option is not viable. The second would be better than the current implementation, but would likely require manual intervention at each McStas/McXtrace release to avoid feature creep. The third option could include a git-hook to automatically update the registry files at each commit (or a GitHub action to do the same at each push/merge); which seems like it would be useful.

What do you think @willend? Can I put together a pull request to add registry-file generation to this repository? Or should I pursue my second option (and look into a cron-job style action to update the registry files for each new tag here)?

g5t avatar Dec 04 '23 15:12 g5t

If the second option is preferred, maybe this repository-dispatch action would be worth using to keep the registry files in sync. Since it requires an access token to work, perhaps moving mccode-files under McStasMcXtrace as, e.g., pooch-registries, would make sense too.

g5t avatar Dec 04 '23 16:12 g5t

@g5t I am certainly open (one of the) automation-ideas, but I think we need a chat over coffee at a whiteboard for me to fully understand the details. And to grasp the implications of choosing one over the other solution... :-)

willend avatar Dec 08 '23 08:12 willend