Skip to content

use /test/Project.toml instead of [extras] in /Project.toml #436

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Krastanov
Copy link
Member

This PR simplifies the Project.toml file by splitting off the test dependencies in a separate PR.

The main value of doing so is avoiding annoying compat bounds on test dependencies that leads to Graphs downgrading other packages on a user's system.

Before this PR the following was not possible ] add Graphs JuliaFormatter@2 because our tests had a dependencies on JuliaFormatter==1. Now that the test environment is separate this is not an issue.

Alternative to #433 and #435 that does not require changing anything about our formatting. Of course, switching to JuliaFormatter 2 would be nice at some point, but the urgency is to make sure that our package is not downgrading other people's environments.

@Krastanov
Copy link
Member Author

in #433 the concern of having Formatter for more than just tests was raised, e.g. if Formatter is used in a pre-commit hook: that is fine, as either way Formatter should not be a dependency of Graphs, rather just another package in the dev environment in which Graphs is already dev-ed (or in the root environment).

Copy link

codecov bot commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.41%. Comparing base (c001dab) to head (97a299d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #436   +/-   ##
=======================================
  Coverage   97.41%   97.41%           
=======================================
  Files         120      120           
  Lines        6953     6953           
=======================================
  Hits         6773     6773           
  Misses        180      180           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines -9 to -13
benchmark/Manifest.toml
.benchmarkci
*.cov
/Manifest.toml
/docs/Manifest.toml
Copy link
Member

Choose a reason for hiding this comment

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

I assume that this means no Manifest.toml would get added to git?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@simonschoelly
Copy link
Member

I have some issues running the tests locally now - can you try if it works for you? I create open Julia v1.12 with a new temporary project: julia --project=temp then ]add Graphs and test Graphs. Then I see errors like the one below and after a while the tests hang:

Path from parents: Error During Test at /home/simon/.julia/dev/Graphs/test/shortestpaths/utils.jl:1
  Got exception outside of a @test
  ArgumentError: Package Graphs not found in current path, maybe you meant `import/using .Graphs`.
  - Otherwise, run `import Pkg; Pkg.add("Graphs")` to install the Graphs package.
  Stacktrace:
    [1] macro expansion
      @ ./loading.jl:2296 [inlined]
    [2] macro expansion
      @ ./lock.jl:273 [inlined]
    [3] __require(into::Module, mod::Symbol)
      @ Base ./loading.jl:2271
    [4] #invoke_in_world#3
      @ ./essentials.jl:1089 [inlined]
    [5] invoke_in_world
      @ ./essentials.jl:1086 [inlined]
    [6] require(into::Module, mod::Symbol)
      @ Base ./loading.jl:2260
    [7] macro expansion
      @ ~/.julia/dev/Graphs/test/shortestpaths/utils.jl:2 [inlined]
    [8] macro expansion
      @ ~/.julia/juliaup/julia-1.11.5+0.x64.linux.gnu/share/julia/stdlib/v1.11/Test/src/Test.jl:1704 [inlined]
    [9] top-level scope
      @ ~/.julia/dev/Graphs/test/shortestpaths/utils.jl:2
   [10] include(fname::String)
      @ Main ./sysimg.jl:38
   [11] macro expansion
      @ ~/.julia/dev/Graphs/test/runtests.jl:177 [inlined]
   [12] macro expansion
      @ ~/.julia/juliaup/julia-1.11.5+0.x64.linux.gnu/share/julia/stdlib/v1.11/Test/src/Test.jl:1704 [inlined]
   [13] macro expansion
      @ ~/.julia/dev/Graphs/test/runtests.jl:175 [inlined]
   [14] macro expansion
      @ ~/.julia/juliaup/julia-1.11.5+0.x64.linux.gnu/share/julia/stdlib/v1.11/Test/src/Test.jl:1704 [inlined]
   [15] top-level scope
      @ ~/.julia/dev/Graphs/test/runtests.jl:154
   [16] include(fname::String)
      @ Main ./sysimg.jl:38
   [17] top-level scope
      @ none:6
   [18] eval
      @ ./boot.jl:430 [inlined]
   [19] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:296
   [20] _start()
      @ Base ./client.jl:531
Actual tests: Error During Test at /home/simon/.julia/dev/Graphs/test/runtests.jl:174
  Got exception outside of a @test
  LoadError: ArgumentError: Package Graphs not found in current path, maybe you meant `import/using .Graphs`.
  - Otherwise, run `import Pkg; Pkg.add("Graphs")` to install the Graphs package.
  Stacktrace:

@Krastanov
Copy link
Member Author

The following worked for me (maybe the difference is using add with(out) specifying the branch of the repo -- there are some differences between add package_name and add package_repo with respect to tags and branches that I have not tried to understand):

> julia +1.12 --project=an_empty_folder -tauto,auto
pkg> add Graphs#moderntoml
pkg> test Graphs
... the usual output

@Krastanov Krastanov requested a review from simonschoelly June 6, 2025 12:48
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