-
Notifications
You must be signed in to change notification settings - Fork 20
Write Project.toml with the same section sorting as Pkg #74
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
Open
nickrobinson251
wants to merge
3
commits into
JuliaPackaging:master
Choose a base branch
from
nickrobinson251:npr-write-project-toml-like-pkg
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| name = "LocalPkg" | ||
| uuid = "8fa365b9-38ac-4f5f-96f8-37668e8e369e" | ||
| authors = ["Preferences.jl contributors"] | ||
| version = "0.1.0" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| module LocalPkg | ||
|
|
||
| greet() = print("Hello World!") | ||
|
|
||
| end # module LocalPkg |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name = "PkgV_1_11_plus" | ||
| uuid = "6fde81da-fe91-40db-985f-5f1fb79db309" | ||
| authors = ["Preferences.jl contributors"] | ||
| version = "0.1.0" | ||
|
|
||
| [preferences.PkgV_1_11_plus] | ||
| TEST_PREF = true | ||
|
|
||
| [deps] | ||
| Example = "7876af07-990d-54b4-ab0e-23690620f79a" | ||
| LocalPkg = "fcf55292-0d03-4e8a-9e0b-701580031fc3" | ||
|
|
||
| [sources] | ||
| Example = {url = "https://github.com/JuliaLang/Example.jl"} | ||
| LocalPkg = {path = "LocalPkg"} | ||
|
|
||
| [compat] | ||
| Example = "0.5" | ||
| Test = "1.11.0" | ||
| julia = "1.11" | ||
|
|
||
| [extras] | ||
| Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
|
||
| [targets] | ||
| test = ["Test"] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name = "PkgV_1_11_plus" | ||
| uuid = "6fde81da-fe91-40db-985f-5f1fb79db309" | ||
| authors = ["Preferences.jl contributors"] | ||
| version = "0.1.0" | ||
|
|
||
| [deps] | ||
| Example = "7876af07-990d-54b4-ab0e-23690620f79a" | ||
| LocalPkg = "fcf55292-0d03-4e8a-9e0b-701580031fc3" | ||
|
|
||
| [sources] | ||
| Example = {url = "https://github.com/JuliaLang/Example.jl"} | ||
| LocalPkg = {path = "LocalPkg"} | ||
|
|
||
| [compat] | ||
| Example = "0.5" | ||
| Test = "1.11.0" | ||
| julia = "1.11" | ||
|
|
||
| [extras] | ||
| Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
|
||
| [targets] | ||
| test = ["Test"] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name = "PkgV_1_11_plus" | ||
| uuid = "6fde81da-fe91-40db-985f-5f1fb79db309" | ||
| authors = ["Preferences.jl contributors"] | ||
| version = "0.1.0" | ||
|
|
||
| [deps] | ||
| Example = "7876af07-990d-54b4-ab0e-23690620f79a" | ||
| LocalPkg = "fcf55292-0d03-4e8a-9e0b-701580031fc3" | ||
|
|
||
| [sources] | ||
| Example = {url = "https://github.com/JuliaLang/Example.jl"} | ||
| LocalPkg = {path = "LocalPkg"} | ||
|
|
||
| [compat] | ||
| Example = "0.5" | ||
| Test = "1.11.0" | ||
| julia = "1.11" | ||
|
|
||
| [extras] | ||
| Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
|
||
| [targets] | ||
| test = ["Test"] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| module PkgV_1_11_plus | ||
|
|
||
| greet() = print("Hello World!") | ||
|
|
||
| end # module PkgV_1_11_plus |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -444,3 +444,28 @@ end | |
| end | ||
| end | ||
| end | ||
|
|
||
| # https://github.com/JuliaPackaging/Preferences.jl/issues/52 | ||
| # Need v1.11+ for Project.toml `[sources]` section to be supported. | ||
| if VERSION > v"1.11.0-" | ||
| @testset "Project.toml writing" begin | ||
| Pkg.activate("PkgV_1_11_plus") do | ||
| @eval using PkgV_1_11_plus | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code suffers from world age issues, hence the tests are failing with Julia >= 1.12 See also my PR #88 which might give a suggestion how to fix this (but perhaps a better solution is possible) |
||
| proj_path = joinpath("PkgV_1_11_plus", "Project.toml") | ||
| proj_before = read(proj_path, String) | ||
| ref_before = read(joinpath("PkgV_1_11_plus", "Project-reference-before.toml"), String) | ||
| @test proj_before == ref_before | ||
| try | ||
| set_preferences!(PkgV_1_11_plus, "TEST_PREF" => true; export_prefs=true) | ||
| proj_after = read(proj_path, String) | ||
| ref_after = read(joinpath("PkgV_1_11_plus", "Project-reference-after.toml"), String) | ||
| @assert ref_before != ref_after | ||
| @test proj_after == ref_after | ||
| finally | ||
| open(proj_path, "w") do io | ||
| write(io, proj_before) | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end # if VERSION | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we insert
preferenceshere, should a similar patch be made toPkg.jlso that it also sortspreferencesto the same position?