-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
approach to default packages #23876
approach to default packages #23876
Conversation
2581508
to
4d326b0
Compare
5cb8252
to
1e65047
Compare
34e4425
to
bb244c3
Compare
If we add these back to the bottom of sysimg.jl (for now, e.g. outside of Base), I think we can get on with merging this, and then work on making it lazy later in this development cycle. Otherwise, lgtm! Glad to see progress getting made on this. |
bb244c3
to
568fb33
Compare
Done. |
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.
Exciting! It'd be nice to maybe outline the process somewhere for moving something to /stdlib
. Something along the lines of:
- Create directories in
/stdlib/Package/src
and /stdlib/Package/test` - Remove code/references from Base, exports.jl, docs, etc. to
/stdlib/Package/src
- Move code from
/test
to/stdlib/Package/test
- Add
using Package
tosysimg.jl
Though what's the general thought on doing sysimg.jl
vs. .juliarc.jl
?
:detect_ambiguities, :detect_unbound_args] | ||
@eval Base.@deprecate_moved $f "Test" true true | ||
end | ||
end |
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.
Can we do Base.@deprecate_moved Test "Test" true true
, or would that do something different?
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.
@deprecate_moved
only seems to support the format @deprecate_moved function package
.
@quinnj Adding to sysimg.jl just improves startup time. Adding to juliarc.jl makes the names still available by default in the repl. For each package you can pick whether to do one or both of those. I think I'm going to need help with the doc build for this. How can we set things up so docs live in package directories, but each one becomes a section of the manual? |
I did the following hack to seems to make the docs generate like before:
Diff: https://gist.github.com/KristofferC/d0dd3009fd42d13bef91c919f186c3b7 Not pretty but perhaps it allows for moving forward on this and move out more packages, and a better workflow for the documentation could be worked out later. This Documenter issue and PR are relevant: JuliaDocs/Documenter.jl#551, JuliaDocs/Documenter.jl#552 |
Any thought of what should be done with packages that are somehow used in |
Just have their own precompile? |
Yeah, of course :). I forgot that since they are included in the |
568fb33
to
f7cf4f9
Compare
Thanks, @KristofferC ! I think this should be ready to go now. |
end), | ||
default_package ? :(function $eold(args...; kwargs...) | ||
error($eold, " has been moved to the standard library package ", $new, ".\n", | ||
"Restart Julia and then run `using ", $new, "` to load it.") |
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.
There should be no need to restart Julia in this case.
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.
Yeah, maybe, but it's fairly easy to end up with conflicting identifiers and such.
Is there any way to see the doc build log on AV? EDIT: nvm, I suspect we can't do symlinks there. |
badbe0c
to
ab1878f
Compare
@@ -16,6 +16,15 @@ end | |||
|
|||
# Documenter Setup. | |||
|
|||
# make links for stdlib package docs | |||
if Sys.iswindows() |
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.
Will this dirty the repo if one builds the docs? Locally, I just committed the symlinked file that is being created here.
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.
Will that work everywhere? Do we have any symlinks in the repo currently? I didn't want to be the first :)
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.
I've seen people do it for linking in the README.md into the documentation. Whether it will work everywhere... your guess is much better than mine.
ab1878f
to
cbda9d0
Compare
Ok, done. I'm just making symlinks (unix) or copies (windows) during the doc build, with an appropriate |
cbda9d0
to
e562890
Compare
as a demo, moves DataFmt out of Base. adds a line to default juliarc so the functions are still available by default.
e562890
to
d759779
Compare
Do we want to call this |
Yes, I'm ok with considering everything in there the standard library. I like what wikipedia says in the very first paragraph of that entry though: "contents of a language's associated library may also be determined (in part or whole) by more informal practices of a language's community". So what happens to be in Another good name might be |
The name |
|
Running |
Here's a strawman to get started on #18795. It's simple but basically does what I'd want. Here's what I did:
stdlib
.DataFmt
(readdlm and writedlm) tostdlib/DelimitedFiles
.stdlib
from usr/share/julia/site/VERSION so it's available in LOAD_PATH. The files will be copied bymake install
as well.using DelimitedFiles
in the default juliarc, so the default repl experience is identical to before.It should also be possible to put the
using Whatever
in sysimg.jl for faster startup. In that case I think there's still a clear code organization improvement; increased coupling can only take the form of adding a singleusing
line to sysimg.jl or juliarc.jl.Initially, the files can remain in this repo. Eventually, we might want to make some into external packages, and clone those repos into
stdlib/
as a build step. By path/depot priority, it will be possible to install different versions of these packages and load them instead of the defaults.If we move lots of Base submodules right away using this method, we can gain lots of flexibility, e.g. being able to update
Distributed
using the package manager during 1.x.