Currently upgrade_document has the following signature and always dumps the upgraded step objects into outpu_dir.
def upgrade_document(
document: Any, v1_only: bool, v1_1_only: bool, output_dir: str, imports: Set[str]
) -> Any:
However, it makes harder to integrate other related tools such as cwl_utils.parser.load_document family.
I would be nice if upgrade_document has an option that returns a upgraded packed CWL object instead of directly writing upgraded CWL objects.