Skip to content

Conversation

JamesWrigley
Copy link
Contributor

The property will change to a field of a struct in an upcoming release: JuliaLang/IJulia.jl#1145

@halleysfifthinc
Copy link
Contributor

This might not be the right time/place to suggest, but this kind of interaction and issue would be better solved by adding an IJulia extension, which would solve the compat aspect of this.

@JamesWrigley
Copy link
Contributor Author

That's true, this is all I have time for ATM but yeah ideally both IJulia and Distributed support would be in extensions.

Copy link

codecov bot commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.43%. Comparing base (807496a) to head (c13c208).
⚠️ Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
src/ProgressMeter.jl 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #353      +/-   ##
==========================================
+ Coverage   93.48%   96.43%   +2.95%     
==========================================
  Files           1        1              
  Lines         399      561     +162     
==========================================
+ Hits          373      541     +168     
+ Misses         26       20       -6     

☔ 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.

@MarcMush
Copy link
Collaborator

ProgressMeter.jl has a lot of these, which look difficult to move into extensions without type-piracy:

function printover(io::IO, s::AbstractString, color::Symbol = :color_normal)
    print(io, "\r")
    printstyled(io, s; color=color)
    if isdefined(Main, :IJulia)
        Main.IJulia.stdio_bytes[] = 0 # issue #76: circumvent IJulia I/O throttling
    elseif isdefined(Main, :ESS) || isdefined(Main, :Atom)
    else
        print(io, "\u1b[K")     # clear the rest of the line
    end
end

an extension for Distributed.jl looks more doable

@JamesWrigley
Copy link
Contributor Author

I've changed this to use a new public function that will be used: https://julialang.github.io/IJulia.jl/dev/library/public/#IJulia.reset_stdio_count

I think it's ready to be merged now that the IJulia PR has been merged.

@MarcMush
Copy link
Collaborator

should we first add a version of ProgressMeter that has a [weakdep] to limit to the old ijulia version?

@JamesWrigley
Copy link
Contributor Author

We could, but I don't think that's necessary with the current code? Or are you saying that we make one release with the current code and a weakdep for IJulia 1.29, and then another version with the new code I added and a weakdep on IJulia 1.30?

@MarcMush
Copy link
Collaborator

yes that's what I meant
It seems cleaner but it might not matter, we can merge like that I guess

@JamesWrigley
Copy link
Contributor Author

Come to think of it I'm actually not sure that would work in a lot of cases because of how weird IJulia is 😅 Many users install it in their global environment instead of in notebook environments, so someone could be in a situation where the global environment has an old IJulia version and new ProgressMeter version. AFAIK compat bounds aren't always respected with stacked environments so that would cause an error if ProgressMeter only supported the newer IJulia version (and vice-versa).

The property will change to a field of a struct in an upcoming release.
@JamesWrigley
Copy link
Contributor Author

(minor change in f3a99ae to make the code use Main.IJulia for consistency)

@MarcMush MarcMush merged commit 4de1255 into timholy:master Aug 23, 2025
@JamesWrigley JamesWrigley deleted the ijulia branch August 23, 2025 08:13
@@ -617,7 +617,12 @@ function printover(io::IO, s::AbstractString, color::Symbol = :color_normal)
print(io, "\r")
printstyled(io, s; color=color)
if isdefined(Main, :IJulia)
Main.IJulia.stdio_bytes[] = 0 # issue #76: circumvent IJulia I/O throttling
# issue #76: circumvent IJulia I/O throttling
if pkgversion(Main.IJulia) < v"1.30"
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't this have used isdefined(Main.IJulia, :reset_stdio_count) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep that would work too, I just prefer this style.

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.

4 participants