Skip to content

chore: use pathlib to interact with craft-parts#5981

Draft
EdmilsonRodrigues wants to merge 1 commit intocanonical:mainfrom
EdmilsonRodrigues:craft-parts-1317-pathlib-fixes
Draft

chore: use pathlib to interact with craft-parts#5981
EdmilsonRodrigues wants to merge 1 commit intocanonical:mainfrom
EdmilsonRodrigues:craft-parts-1317-pathlib-fixes

Conversation

@EdmilsonRodrigues
Copy link
Contributor

@EdmilsonRodrigues EdmilsonRodrigues commented Jan 26, 2026

Adjust calls to functions of craft-parts to use pathlib after change in craft-parts API.


  • I've followed the contribution guidelines.
  • I've signed the CLA.
  • I've successfully run make lint && make test.
  • I've added or updated any relevant documentation.
  • I've updated the relevant release notes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with what these changes are doing, but I'm curious what caused them to be needed? I don't see any obvious link between this module's changes and Craft Parts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because of these lines in snapcraft/parts/lifecycle.py (line 693):

    migrated_files = step_info.state.files
    patcher = Patcher(dynamic_linker=linker, root_path=step_info.prime_dir)
    elf_files = elf_utils.get_elf_files_from_list(step_info.prime_dir, migrated_files)

migrated_files has changed its type to be an Iterable[Path] instead of Interable[str]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I could convert it there to string also, but I preferred to changing here to use pathlib instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants