Remove unused number dependency to unblock decimal 3.x#2113
Merged
Conversation
The number package pinned decimal to "~> 1.5 or ~> 2.0", which blocked decimal 3.0 (including its security fix) and in turn ecto_sql 3.14. Backpex has not used number since 71757de (PR #541), which dropped the Number.Delimit call from Backpex.HTML.pretty_value/1 and made formatting the caller's responsibility. The dependency was left behind in mix.exs and kept being resolved, so mix deps.unlock --unused never flagged it. Remove it from Backpex and replace the two remaining demo usages with a local DemoWeb.NumberFormat helper, which keeps the previous formatting behaviour including nil handling. This unblocks: decimal 2.4.1 -> 3.1.1 ecto 3.13.6 -> 3.14.1 ecto_sql 3.13.5 -> 3.14.0
Flo0807
enabled auto-merge
July 17, 2026 10:29
Satisfies credo --strict Code.Readability check.
This was referenced Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
numberpackage (last released April 2024) pinsdecimalto~> 1.5 or ~> 2.0. Sincedecimal3.0 shipped — including a security fix — this transitive chaindecimal -> number -> backpexblocked us from updating.ecto_sqlv3.14.0 requiresdecimal3.0, so it was the first package we could no longer update.Root cause
Backpex has not actually used
numbersince 71757de (PR #541, 2024-08-26). That commit removed the only call site fromBackpex.HTML.pretty_value/1:Formatting became the caller's responsibility, but
{:number, "~> 1.0"}was left behind inmix.exs. It kept being resolved intomix.lockever since, without a single call site inlib/.This never surfaced because
mix deps.unlock --unused(part ofmix lint) only checks whether a lock entry is still required bymix.exs— not whether the code actually calls the package. As long as it was declared, it counted as "used".Changes
{:number, "~> 1.0"}from Backpex.post_live.ex,product_live.ex) with a localDemoWeb.NumberFormat.to_delimited/1helper, preserving the previous formatting behaviour includingnilhandling. Added unit tests + doctests.numberis now gone from the repository entirely.No alternative library needed — the library never used it.
Result
This unblocks, for both the library and the demo:
Verification
mix lintpasses (compile --warning-as-errors,deps.unlock --unused,format,credo, 100 doctests + 174 tests, 0 failures).credoclean; newNumberFormattests pass (3 doctests, 5 tests).Note for reviewers
The decimal/ecto/ecto_sql bumps in the lockfiles are arguably a separate concern and could be left to Renovate. They are included here as proof that the block is actually gone — happy to drop them from this PR if you prefer it scoped purely to removing
number.