Skip to content

Modernize/streamline make-release-repo.py #534

@andrewmogan

Description

@andrewmogan

Having evolved organically over time with changing requirements, make-release-repo.py has become a bit of a mess (not to point fingers; some of it is my fault). I can imagine this script needing additional updates as our release environments evolve (especially in light of #532), so I think a bit of upfront effort to improve maintainability could go a long way. A few specific ideas:

  • Replace os.path with pathlib.Path. Path is more modern, readable, and has its own error handling.
  • The DAQRelease class does too much by itself. Much of the package-specific logic could be factored into something like a DAQPackage class. This class could contain the necessary generate() method, as well as package-level functions like get_file_from_package, get-cmake-dependencies, etc. DAQRelease would then contain/construct a list of DAQPackages from the input release yaml.
  • copy_release_yaml is doing too much, to the point where I'd argue it's misnamed. It doesn't just copy the yaml file, it also conditionally mutates self.rdict in place, which leads to the use of deepcopy to avoid accidentally mutating the input file. This is a hacky workaround which I think can be circumvented by not actually copying the release yaml at all, but by loading the yaml data into its own structure and writing when necessary.

Other ideas are welcome.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions