Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include humanize_list function as a utility #183

Open
lengau opened this issue Oct 6, 2023 · 4 comments
Open

Include humanize_list function as a utility #183

lengau opened this issue Oct 6, 2023 · 4 comments

Comments

@lengau
Copy link
Contributor

lengau commented Oct 6, 2023

What needs to get done

  1. Copy this function and its relevant tests to craft-cli: https://github.com/canonical/craft-parts/blob/main/craft_parts/utils/formatting_utils.py
  2. Make a craft-cli release
  3. Update craft apps to reference this function instead of their own instances of it.
  4. Make comments both here and in the craft-parts implementation that the function exists in the other location so we can copy bug fixes if needed. (No functional changes in craft-parts)

Why it needs to get done

Reduced copy/pasting of code for improved maintainability

@tigarmo
Copy link
Collaborator

tigarmo commented Oct 6, 2023

Are we sure that this lib is the right place for this function? I can see that in the majority of cases the list if being humanized to be emitted/logged, but a side-effect of this is that the libs (like craft-parts and -providers) would start having craft-cli as a dependency. Which isn't awful necessarily , but is a consequence we need to consider.

...

At the same time, I'm not a huge fan of a grab-bag "craft-util" lib because it feels a bit chaotic, so I don't have any better suggestions, heh.

@tigarmo
Copy link
Collaborator

tigarmo commented Oct 6, 2023

Maybe we could get this landed and use python-humanize?

@lengau
Copy link
Contributor Author

lengau commented Oct 6, 2023

@tigarmo I was just typing the same thing

@mr-cal
Copy link
Contributor

mr-cal commented Oct 18, 2024

python-humanize/humanize#110 landed this month in 4.11.0 so it is finally ready for us to use!

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

No branches or pull requests

3 participants