Skip to content
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

Fix Revise on 0.7 #48

Merged
merged 4 commits into from
Sep 28, 2017
Merged

Fix Revise on 0.7 #48

merged 4 commits into from
Sep 28, 2017

Conversation

timholy
Copy link
Owner

@timholy timholy commented Sep 27, 2017

JuliaLang/julia#23579 changed how modules are loaded, and for Revise's purposes the important change appears to be that the module isn't externally available while its __init__ method is being run or when Base.package_callbacks are being run. This @schedules Revise's workflow until after module definition is completely finished. @JeffBezanson, is this correct (and intended)? The first commit is the one that implements the fix.

Also fixes some deprecations, and attempts to fix test failures on OSX (I'm just guessing here). CC @cstjean

The changes in module-loading seem to make it necessary to delay "asking" for the module---it doesn't seem to be available until after the __init__ method finishes running.
@codecov
Copy link

codecov bot commented Sep 27, 2017

Codecov Report

Merging #48 into master will increase coverage by 1.59%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
+ Coverage   83.27%   84.86%   +1.59%     
==========================================
  Files           1        1              
  Lines         299      304       +5     
==========================================
+ Hits          249      258       +9     
+ Misses         50       46       -4
Impacted Files Coverage Δ
src/Revise.jl 84.86% <80%> (+1.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf06d0d...a27eb2c. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 27, 2017

Codecov Report

Merging #48 into master will increase coverage by 1.59%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
+ Coverage   83.27%   84.86%   +1.59%     
==========================================
  Files           1        1              
  Lines         299      304       +5     
==========================================
+ Hits          249      258       +9     
+ Misses         50       46       -4
Impacted Files Coverage Δ
src/Revise.jl 84.86% <87.5%> (+1.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf06d0d...78f3920. Read the comment docs.

@cstjean
Copy link
Collaborator

cstjean commented Sep 27, 2017

On OSX, Revise.watch_files_via_dir("/Users/cedric/nodir") doesn't return when I rm -r nodir. Does it on Linux?

EDIT: but it does return when I touch a file in it.

@timholy
Copy link
Owner Author

timholy commented Sep 27, 2017

julia> Revise.watch_files_via_dir("/tmp/nodir")
ERROR: KeyError: key "/tmp/nodir" not found
Stacktrace:
 [1] getindex at ./dict.jl:474 [inlined]
 [2] watch_files_via_dir(::String) at /home/tim/.julia/v0.6/Revise/src/Revise.jl:521

(That's triggered when I delete the directory.)

@cstjean
Copy link
Collaborator

cstjean commented Sep 28, 2017

Then isn't that where the test failure comes from? revise_dir_queued blocks on watch_files_via_dir, so it never gets to warn(dirname, " is not an existing directory, Revise is not watching").

@timholy
Copy link
Owner Author

timholy commented Sep 28, 2017

I see, thanks for explaining. Curiously, it did pass tests on some OSX installations, but not others. Let's just skip that test on OSX, then.

Windows was failing for an independent reason (only on 0.7), let's see if the latest works on all platforms.

@cstjean
Copy link
Collaborator

cstjean commented Sep 28, 2017

Curiously, it did pass tests on some OSX installations, but not others.

Might be timing-dependent: rm dir/file still triggers watch_files_via_dir, so if the order of events is rm dir/file, rm dir, revise_dir_queued(dir), then we'll see the warning.

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