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

Generic, extensible package metadata file #11955

Closed
IainNZ opened this issue Jun 30, 2015 · 21 comments
Closed

Generic, extensible package metadata file #11955

IainNZ opened this issue Jun 30, 2015 · 21 comments
Labels
domain:packages Package management and loading

Comments

@IainNZ
Copy link
Member

IainNZ commented Jun 30, 2015

I think the time may have come to expand from just REQUIRE and to move to a more rich file that contains various properties of a package.

A short list:

This is fairly simple data, just lists and strings, so ideally we can settle on a simple format. An option is to have the file be a Julia dict + array literal. Other thing to be bikeshed is the filename, and finally whether the file is reflected into METADATA.jl as well (like the current REQUIRE/requires situation).

@IainNZ IainNZ added the domain:packages Package management and loading label Jun 30, 2015
@ScottPJones
Copy link
Contributor

JSON maybe? Good ideas here

@JeffBezanson
Copy link
Sponsor Member

All else being equal, JSON would be a good choice. That would probably require putting a JSON parser in Base. Not necessarily a bad thing: it's arguably as important (or more) than csv or delimited files these days. .INI or java .properties are other candidates; very easy to parse.

@IainNZ
Copy link
Member Author

IainNZ commented Jun 30, 2015

We could bring JSON.jl into Base I suppose, the package is fairly stable.

@tkelman
Copy link
Contributor

tkelman commented Jun 30, 2015

I think a declarative metadata format, a la conda, is a better install-time option for packages than what we have now with executing an arbitrary deps/build.jl script. Not thrilled about bringing a json parser into base, but json would be the natural format choice here. Perhaps by the time this kind of thing gets fleshed out we will have done more experimentation with installed-by-default packages.

@dcjones
Copy link
Contributor

dcjones commented Jun 30, 2015

👍 to putting everything (including REQUIRE) in one package.json (or similar) file. With separate files for every piece of metadata we'll eventually want, and separate mechanisms for consuming that metadata, making packages is going to become complex and aggravating.

TOML is another option that's arguably nicer to write than JSON without being as bonkers as YAML.

@IainNZ
Copy link
Member Author

IainNZ commented Jun 30, 2015

TOML was definitely more what I was thinking of, instead of JSON, but there is utility I guess in that JSON is so widely recognized.

@kmsquire
Copy link
Member

kmsquire commented Jun 30, 2015 via email

@carnaval
Copy link
Contributor

What about a julia literal you would just eval ?

@carnaval
Copy link
Contributor

Oups sorry didn't read the whole issue

@StefanKarpinski
Copy link
Sponsor Member

What about just using files with simple formats – i.e. one line per keyword for keywords, a file that happens to contain markdown text for description, the license can be a file with a license indicator from a known set, etc.

@IainNZ
Copy link
Member Author

IainNZ commented Jun 30, 2015

Is anyone other than @carnaval and I into the Julia literal? It seems so extremely simple and lightweight.

@malmaud
Copy link
Contributor

malmaud commented Jun 30, 2015

I'm more into it than I've ever been into anything
On Tue, Jun 30, 2015 at 5:21 PM Iain Dunning notifications@github.com
wrote:

Is anyone other than @carnaval https://github.com/carnaval and I into
the Julia literal? It seems so extremely simple and lightweight.


Reply to this email directly or view it on GitHub
#11955 (comment).

@dcjones
Copy link
Contributor

dcjones commented Jun 30, 2015

It it possible/practical for it to be a julia literal without it becoming arbitrary julia code that needs to be executed to read a package's metadata?

@StefanKarpinski
Copy link
Sponsor Member

It it possible/practical for it to be a julia literal without it becoming arbitrary julia code that needs to be executed to read a package's metadata?

It is not – there is no such thing as JLSON (yet). This would require a modified / restricted parser that only handles the "safe" part of Julia that only constructs objects.

@JeffBezanson
Copy link
Sponsor Member

-1 for something turing complete. I suspect we'd regret that.

@carnaval
Copy link
Contributor

JLSON could reuse the base parser, essentially doing a one pass over the AST constructing only safe literals (list,dict,symbol,numbers,strings). The function "parsing" the AST to the nested structure is probably 10 lines of code so it's probably lighter than having JSON in base.

@wildart
Copy link
Member

wildart commented Jun 30, 2015

I would like to see something similar to SBT syntax with Julia specifics.

@StefanKarpinski
Copy link
Sponsor Member

Completely agree that we'd very likely regret choosing a turing complete format for providing pure data.

@StefanKarpinski
Copy link
Sponsor Member

JLSON could reuse the base parser

Fair point, although there's some sketchy stuff like emitting macros for large numbers. Of course, if you can't define a macro, then it's not obvious how you can take advantage of that.

@tkelman
Copy link
Contributor

tkelman commented Dec 19, 2015

For version number constraints specifically (#7763), a scheme like https://github.com/Masterminds/semver#basic-comparisons might be more intuitive and more flexible (in that it allows disjunctive constraints) than what we have right now.

Another thing we might need to consider is conditional dependencies (#6884) - some dependency package is only needed when running in a given Julia version, that kind of thing. Right now this requires maintaining separate branches in the dependency package for different Julia versions.

@IainNZ
Copy link
Member Author

IainNZ commented Jun 2, 2018

Tidying up old issues/PRs.

@IainNZ IainNZ closed this as completed Jun 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:packages Package management and loading
Projects
None yet
Development

No branches or pull requests

10 participants