-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
RFC: Pkg scaffolding and versioning API #1668
Conversation
Actually, looking at pkg.jl, skeleton should probably call create()? Or maybe merge the two? |
Metadata.gen_hashes("PkgName") also has the same problems, it runs in the current directory rather than in the julia_pkg_dir |
Yes, |
I might have a go. |
I didn't push this directly because I'd like to make sure I'm doing the METADATA stuff somewhat correctly. However, it does work insofar as |
Nice. I'm very happy to have you hacking on this :-) I generally like to make an initial empty commit in all repos because git gets very weird about root commits, so I try to make sure there's an empty root commits that serves as an ancestor to everything interesting. Making the METADATA entry right away feels off. I think that maybe the I'm kind of thinking this:
|
Yes, the best thing is to hand this off to API as much as possible; a versioning API would simplify this. I don't like the immediate METADATA commit either, but This should also print a brief, informative message telling you what you should do next and where. |
Please do edit |
Another option would be not to rely on |
I'll have to read that line more carefully. I thought you were using the hash that |
It's currently looking at tagged versions in the installed package repo (not in METADATA). Maybe that's not the right thing to do. Maybe the hashes directory should just be an inversion of the version => sha1 map that's included under each pkg/versions directory. Also possible it should just be kept in memory and recomputed from pkg/versions every time instead of on disk in the hashes directory. |
The hash => version map isn't super important, btw. It's currently only used to print nice readable version names when installing, removing or up/downgrading. Nice to have, but not crucial. |
Changed the
This also throws in Versioning API will be next, I guess, and I'll rewrite I need to port my existing |
Build failure is #1682, only on clang, and the failure is in the linalg tests. |
Did most of the versioning API and rebased the patchset on top. Note that the patch bb3c224 contains a horrific workaround due to |
This test failure was #1652 this time. |
The dependence of each_tagged_version() on `git ls-tree` induces a requirement that scaffolded packages needed to be checked into METADATA. That isn't a friendly thing to do automatically, and there's no obvious reason to use and parse ls-tree.
Pkg.version(pkg, ver) is the general entry point, tagging the package and making the proper METADATA entries for that revision. The .patch(pkg), .minor(pkg), and .major(pkg) provide convenience methods which increment the appropriate level of the version number.
Fixed horrific workaround after Jeff beat some sense into me. |
Bikeshedding might be called for on this most recent one. |
Oops. Initial version of this most recent one had a blindingly obvious injection vulnerability. |
#1682 again. |
I was going to implement |
Pkg.new() creates a scaffolded package in .julia and the required directory structure for METADATA.
Pkg versioning API and scaffolding methods
Thanks for this flurry of work on Pkg, @pao. It's great to have you working on it.
I don't want to tie package repos or metadata repos in general to GitHub, but since the "official" METADATA.jl will be on GitHub for the foreseeable future, automatically making pull requests when appropriate is probably desirable. A sane strategy would be to try pushing first, no matter what, and only if that fails and the URL is a GitHub one, use their API to create a pull request. For now, we can probably just try to push and provide a helpful message if that fails. |
I just see that getting annoying. I'd like to think about it a bit. Meanwhile, I'm going to try to package some stuff. I just needed to get the minimum tooling to not make me want to throttle Pkg in a fit of rage. But I need to actually use it a bit. Incidentally, while a full fledged Requests package would be nice, I'll probably hack together an expedient PkgHub that just calls out to defunkt/hub. Julia calls the GitHub API via a Ruby script using command invocation. It's a match made in hell. |
How would it be annoying? I'm talking about doing it automatically – as in the Pkg.publish command tries to push and then if that fails, opens a pull request.
I appreciate that you're directing your rage at the code and not at me!
Hahaha. Yes, we really ought to get a proper Requests package working. Shouldn't be so awful. In its place, we could actually just have a package that calls |
Opening a pull request requires making the changes public on GitHub, which in general isn't a trivial matter, and it's logic PkgHub will need anyways. I'd rather the plain
Ah yes, |
Yeah, ok. So maybe this is configurable with an environment variable, which, if set causes a pull request to be issued instead. Speaking of which, we need some way of making it easy to switch protocols across the board from git:https:// to https:// or http:https://. Any bright ideas on how to do that? I figure since you're one of the people behind a firewall, you might have some thoughts. |
Is there a reason the |
That's a very good idea. We could then parse it as a list of URL strings. |
Just leaving this here so I can find it later (germane to |
That's an interesting idea. We could automatically update METADATA based on pushes to package repos with a specific format like that. At the very least, we could automatically create pull requests or something like that. Of course, we'd have to run a service to do all of that, which I generally try to avoid. |
You wouldn't need to; the service in this case is GitHub, which would be running the required post-commit hook and calling its own API. |
Oh, that's extra cool. Very, very nice. That would be a good way to do it. |
[original title: Pkg.skeleton() creates package directory in current directory]
Pkg.skeleton creates a directory in the current working directory, which is typically the directory that julia is started from. It should instead create the new directory within the package directory (typically .julia)