Graphs.jl icon indicating copy to clipboard operation
Graphs.jl copied to clipboard

Allow JuliaFormatter v2

Open ChrisRackauckas opened this issue 6 months ago • 9 comments

CompatHelper seems to be disabled here?

ChrisRackauckas avatar May 31 '25 11:05 ChrisRackauckas

CompatHelper seems to be disabled here?

Are you sure? I do admit that I haven't seen any PR from CompatHelper in a while but it looks like the workflow still run: image

Perhaps something is outdated.

simonschoelly avatar May 31 '25 11:05 simonschoelly

From the logs it looks like CompatHelper does not check [extras].

 ┌ Error: The dependency was not found in any of the registries
│   dep.package.name = "SharedArrays"
│   dep = CompatHelper.DepInfo(CompatHelper.Package("SharedArrays", Base.UUID("1a1011a3-84de-559e-8e89-a11a2f7dc383")), nothing, nothing, nothing)
└ @ CompatHelper ~/.julia/packages/CompatHelper/K9Pyo/src/utilities/new_versions.jl:198
┌ Info: latest_version in version_spec
│   dep.latest_version = v"0.9.4"
│   dep.version_spec = VersionSpec("0.9")
│   dep.package.name = "SimpleTraits"
└   dep = CompatHelper.DepInfo(CompatHelper.Package("SimpleTraits", Base.UUID("699a6c99-e7fa-54fc-8d76-47d257e15c1d")), v"0.9.4", VersionSpec("0.9"), "0.9")
┌ Info: latest_version in version_spec
│   dep.latest_version = v"1.11.1"
│   dep.version_spec = VersionSpec("1")
│   dep.package.name = "Statistics"
└   dep = CompatHelper.DepInfo(CompatHelper.Package("Statistics", Base.UUID("10745b16-79ce-11e8-11f9-7d13ad32a3b2")), v"1.11.1", VersionSpec("1"), "1")
┌ Error: The dependency was not found in any of the registries
│   dep.package.name = "SparseArrays"
│   dep = CompatHelper.DepInfo(CompatHelper.Package("SparseArrays", Base.UUID("2f01184e-e22b-5df5-ae63-d93ebab69eaf")), nothing, nothing, nothing)
└ @ CompatHelper ~/.julia/packages/CompatHelper/K9Pyo/src/utilities/new_versions.jl:198
┌ Info: latest_version in version_spec
│   dep.latest_version = v"0.18.22"
│   dep.version_spec = VersionSpec("0.17 - 0.18")
│   dep.package.name = "DataStructures"
└   dep = CompatHelper.DepInfo(CompatHelper.Package("DataStructures", Base.UUID("864edb3b-99cc-5e75-8d2d-829cb0a9cfe8")), v"0.18.22", VersionSpec("0.17 - 0.18"), "0.17, 0.18")
┌ Error: The dependency was not found in any of the registries
│   dep.package.name = "Distributed"
│   dep = CompatHelper.DepInfo(CompatHelper.Package("Distributed", Base.UUID("8ba89e20-285c-5b6f-9357-94700520ee1b")), nothing, nothing, nothing)
└ @ CompatHelper ~/.julia/packages/CompatHelper/K9Pyo/src/utilities/new_versions.jl:198
┌ Info: latest_version in version_spec
│   dep.latest_version = v"0.1.5"
│   dep.version_spec = VersionSpec("0.1.3 - 0.1")
│   dep.package.name = "Inflate"
└   dep = CompatHelper.DepInfo(CompatHelper.Package("Inflate", Base.UUID("d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9")), v"0.1.5", VersionSpec("0.1.3 - 0.1"), "0.1.3")
┌ Info: latest_version in version_spec
│   dep.latest_version = v"0.4.0"
│   dep.version_spec = VersionSpec("0.4")
│   dep.package.name = "ArnoldiMethod"
└   dep = CompatHelper.DepInfo(CompatHelper.Package("ArnoldiMethod", Base.UUID("ec485272-7323-5ecc-a04f-4719b315124d")), v"0.4.0", VersionSpec("0.4"), "0.4")
┌ Error: The dependency was not found in any of the registries
│   dep.package.name = "LinearAlgebra"
│   dep = CompatHelper.DepInfo(CompatHelper.Package("LinearAlgebra", Base.UUID("37e2e46d-f89d-539d-b4ee-838fcccc9c8e")), nothing, nothing, nothing)
└ @ CompatHelper ~/.julia/packages/CompatHelper/K9Pyo/src/utilities/new_versions.jl:198
┌ Error: The dependency was not found in any of the registries
│   dep.package.name = "Random"
│   dep = CompatHelper.DepInfo(CompatHelper.Package("Random", Base.UUID("9a3f8284-a2c9-5f02-9a11-845980a1fd5c")), nothing, nothing, nothing)
└ @ CompatHelper ~/.julia/packages/CompatHelper/K9Pyo/src/utilities/new_versions.jl:198

simonschoelly avatar May 31 '25 19:05 simonschoelly

Apparently there is an open PR https://github.com/JuliaRegistries/CompatHelper.jl/pull/502 related to also check test dependencies.

simonschoelly avatar May 31 '25 19:05 simonschoelly

@simonschoelly , for my packages I have switched away from using extras and rather using a sub Project.toml for the tests. I believe that started being supported somewhere around the julia 1.3ish era. If you are ok with it, I can go ahead and split the Project.toml's extras into a test/Project.toml.

This would have "accidentally" fixed the current issue, as usually there are no compat bounds for test/Project.toml.

Krastanov avatar Jun 01 '25 00:06 Krastanov

test/Project.toml is from the Julia 1.2 era: https://pkgdocs.julialang.org/v1/creating-packages/#Alternative-approach:-test/Project.toml-file-test-specific-dependencies

Krastanov avatar Jun 01 '25 00:06 Krastanov

@simonschoelly , for my packages I have switched away from using extras and rather using a sub Project.toml for the tests. I believe that started being supported somewhere around the julia 1.3ish era. If you are ok with it, I can go ahead and split the Project.toml's extras into a test/Project.toml.

This would have "accidentally" fixed the current issue, as usually there are no compat bounds for test/Project.toml.

I don't have an opinion on that - if you think we should try that out, why not?

Although I am not sure that JuliaFormatter is purely for testing - some people might also use it as a precommit hook for git - then they would have to activate the testing environment?

simonschoelly avatar Jun 02 '25 00:06 simonschoelly

All of this is all well and good, but in the meantime, could we unblock JuliaFormatter v2 from downstream? The only test failure here is formatter error, want me to reformat the whole package or someone else?

ChrisRackauckas avatar Jun 02 '25 10:06 ChrisRackauckas

I am not sure how I can add something to your PR - so the changes are here: #435

simonschoelly avatar Jun 02 '25 22:06 simonschoelly

check #436 for potentially a simpler and quicker alternative

Krastanov avatar Jun 03 '25 02:06 Krastanov

closing in favor of #435 (running Formatter v2) and #436 (moving Formatter to not be a dependency at all)

Krastanov avatar Jul 02 '25 11:07 Krastanov