#15843 closed enhancement (fixed)
RFE: xml2toml function in bundle builder
| Reported by: | Zach Pearson | Owned by: | Zach Pearson |
|---|---|---|---|
| Priority: | blocker | Milestone: | |
| Component: | Build System | Version: | |
| Keywords: | Cc: | chimerax-programmers | |
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
It would be good if bundle builder could use bundle_builder_toml for all bundles, perhaps by converting xml to toml on the fly in bundle builder and exposing that function as an entry point if the user desires to do it in-tree and convert permanently.
Change History (3)
comment:1 by , 15 months ago
| Component: | Unassigned → Build System |
|---|
comment:2 by , 15 months ago
| Cc: | added |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
comment:3 by , 15 months ago
Oh, I forgot to say: it just prints the output to stdout. You can direct that output to whatever file you want.
python -m chimerax.bundle_builder -c bundle_info.xml > pyproject.toml
Note:
See TracTickets
for help on using tickets.
Bundle builder can now perform rudimentary conversion of
bundle_info.xmlfiles to TOML.You can call bundle builder as a module, e.g.
python -m chimerax.bundle_builder -c bundle_info.xmlThere is also a long option version,
--convert.You can optionally add
--dynamic-versionat the end to get a TOML file that supports specifying the package version assrc.__version__. As long as__version__ = 'version'is the first uncommented line of Python in your top level__init__, this will work.I implemented the minimum converter required to accurately convert the bundles in
$(TOP)/.readthedocs.yml, e.g:so it is not generally accurate yet.
It would be helpful to copy these xml files to
bundle_builder/tests/xml/{bundle_folder_name}.xmlwhen they change in a major way.The converter is very dumb. It adds
src/libtolibrary-dirsfor each extension whether or not it's needed, for instance. As another example, it adds every build dependency toinclude-moduleswhether a specific extension or library needs it or not. This is to guarantee maximum correctness for the widest range of bundles with a minimum number of special casing and assumption making. It also formats them like garbage, e.g.instead of
Because this ugly formatting is more predictable and therefore testable. A modern editor should auto format it to something sensible automatically the first time you open and save it anyway (and you can cut out what you don't need as desired).