-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Pkg3: package namespaces #8
Comments
Some open issues:
|
My thoughts on this, for however many cents ≤2 they're worth: Namespaces could be one-to-one with registries, which in turn could work like Homebrew taps. Say there are two registries, JuliaVegetables and JuliaGreens, that each have a package called Broccoli. If a user has opted into the JuliaVegetables registry and not JuliaGreens, they can do A safe option may be to require the fully qualified |
Isn't the package metadata a good place to disambiguate between registries? So instead of:
You would write:
|
I believe namespaces are important, so the next-generation packaging system should include namespacing mechanism. It will make it easy for developers/organizers to create "biotopes" to cultivate special-interested packages there. A real-world example is Bioconductor, which includes thousands of R packages, but it has a dedicated package manager because its release schedule is different from R. I think this should not happen in Julia.
One-to-one relation with registries sounds reasonable. I want the BioJulia registry and it would be enough.
Always requiring namespace prefixes looks a little bit verbose to me, but may be consistent. |
A reason not to make namespaces and registries one-to-one is that we want to allow people to use their GitHub usernames (for example) as namespaces and still publish their packages. But maybe that's too fine-grained a level for namespacing and that use case should instead be handled by improved support for installing unregistered packages. |
Can we have "implicit registries" based on a github account ("tbreloff" or "JuliaML") or alternate directory/url? I suppose it depends what you require a registry defines, but at a minimum there should be an automated way to initialize a registry for an existing account/directory/url using the repos that exist there. I think it's fine to be one-to-one as long as registries are dirt-simple to create and manage. Some related ideas: tbreloff/MetaPkg.jl#5 |
The package manager must offer clean and tidy management behind corporate walls. There may exist contractual constraints or turf-protective limits on interdepartmental access. Distinct versions of a package may not permit the same package manager activities. Package access, use, testing, upgrading, may be subject to legal obligations and the existence of those obligations may be confidential. Permissions and restrictions that may apply to upgrading for direct use may not apply to upgrading that same package happens indirectly in support of another project. The ability to tell systems "keep [these packages] just as they are" and "keep [these packages] up to date" and "[these packages] should be kept in sync with the latest stable [patch] to [version]" helps. Namespaces improve that help. Checkpoints augment the helpfulness of the help. As I understand it, Julia's Registrating, Namespacing and Checkpointing are mutually informing and jointly supporting. The availability of one simplifies some parts of the others. They should co-exist. |
I've recently been working on generating AWS Julia API packages from the Amazon JSON service description files. My work-in-progress output results in 170 kloc across 102 service interface packages: Currently there are no types, no input/output validation or translation, just one-line wrapper functions and docstrings for each service operation (i.e. the size of the packages will probably grow). I'm mentioning this here as a potential use-case for package namespaces. Will Pkg3 namespaces allow all the 100+ Amazon*.jl packages to be neatly grouped together? |
Great thoughts @samoconnor; I've had similar thoughts recently w/ HTTP.jl. Currently, it has code for URI parsing, handling cookies, client-side requests, a server, etc. all built in under the same package. I could split these "subpackages" out into stand-alone packages, but it's actually kind of nice having them all under one roof from a maintenance & development standpoint. It'd be great if they (the submodules/packages) could be registered and used individually, while using HTTP.jl would bring them all in. |
Do you guys have any thoughts on how this would look and work? I.e. how would one use a namespaced package and what would it mean? Are you imagining |
If there is a package named HTTP/Server imo it should only be used as HTTP.Server because if it were accessed as Server that opens up the potential for conflict with e.g. Task/Server. |
Ok, it seems like this may just be a layer of hierarchy in package names. This usage suggests that the Julia-side syntax probably be |
Here's a few of my thoughts:
So just clarify, I would imagine my package directory looking like:
So it'd be a way to have my package live inside the directory of another package, so if someone depends on |
imo
and I agree with the "just get what you need" thought above |
I agree with @quinnj ; one feature I definitely want is to have multiple packages in one repo, and have them be separate modules (not submodules). That is already a kind of namespace mechanism; is it enough? If namespace = repo, adding a package from a separate repo to a namespace can be done by adding a git submodule to the namespace repo. If that's not workable, then namespaces could just be a naming convention, e.g. some package names have
|
I'd stick with using the fully qualified name for I prefer I don't see any reason for grouped packages to be sub-modules. In fact a package group may not be a module at all. e.g. You might have It might be nice to have a shortcut like My initial problem was not wanting to pollute the package directory list at https://pkg.julialang.org with 100+ I would definitely like to have multiple packages in a single git repo. But this would have to be implemented such that |
WRT I think the hierarchy should be structured primarily for the convenience of the end user rather than the package developer. We don't want to rename |
So how do you want to access the module brought in by |
I guess the options might be: using HTTP/Server
Server.listen(...) using HTTP/Server
HTTP/Server.listen(...) using HTTP/Server as HTTPServer
HTTPServer.listen(...) Maybe it's up to the package author to decide if the unqualified name is likely to make sense in the global namespace? e.g. In some cases the conflicting unqualified name might be a good thing: using OpenSSL/Digest
Digest.sha1(...)
using MbedTLS/Digest
WARNING: redefining module Digest |
+1. Also related to whatever mechanism we come up with for supporting a Julia "standard library" that ships with Julia but is on a separate release cycle. The Julia stdlib can be separate modules under the same repo? The Python world had this PEP - https://www.python.org/dev/peps/pep-0413/#abstract - I do think it is the right approach though it it was finally unimplemented. Because they got a decent package manager which was expected to speed up development/management of alternative implementations. I don't think that addressed the issues raised in the above PEP, which I believe will be a good approach for Julia. |
@samoconnor: of those the only viable option is |
That's a good idea. I realized at some point that when package versions are associated with git tree objects (or more generally, source trees hashed with various secure hashes in the same manner as git uses SHA1 to hash source trees), then you can quite easily tag multiple different packages from the same git repo. Using that for Julia development makes a fair bit of sense and would allow us to continue checking out, updating and testing Julia and its standard packages all together. |
For a long time I've wanted to see Julia drop the one-repo-one-module assumption which I think will be key for scalability of large projects. I like @quinnj's design with separate @StefanKarpinski, does the form |
A module is just a container of a bunch of bindings. How would such a proposed The real point I was getting at is that if you write |
I think there's only one truly important feature needed, as stated by @quinnj upthread:
if |
Not necessarily – |
In that case, you may want a syntactic distinction between "create an empty |
|
Bump. Were multi-module packages ever implemented? I cannot find a reference to this in the @StefanKarpinski: Do we actually need package namespaces in Julia proper? Would it not be sufficient for the package manager to understand that a single package can include multiple modules? Enhancing
|
I don't think that was ever really the concept behind package namespaces. The idea was more to allow more than one package with the same name to be distinguished based on the namespace they come from so that e.g. you could do The design of Pkg3 already allows those two different packages with the same name to coexist. Given that, the need for namespaces is considerably lessened. Namespaces would still be useful for a few things, however:
Of course, if a project uses both |
I see. I guess I was side-tracked by @samoconnor 's issue description where he would like to distribute multi-module packages in a single Git repo to simplify his "Amazon" solution. I have similar issues where half a dozen modules need to be developed simultaneously in order for the solution to be functional. Having independent modules in a single Git repository simplifies the development & the distribution of a coherent (working) solution as an atomic event. If implemented carefully, it could also provide a reasonable solution for conditional modules (through layering instead of conditional
A multi-module solution could therefore allow InspectDR to work on JuliaBox - where Gtk is not currently supported. Questions
|
Pkg3 supports multi-package repositories, i.e. a single repo containing multiple packages as subtrees of the main repo tree. This is already done in JuliaLang's own |
The current proposal doesn't mention namespaces anywhere. This issue is to discuss how namespaces could fit into the proposal and Julia's own namespacing in general.
The text was updated successfully, but these errors were encountered: