scheinerman / Permutations.jl

Permutations class for Julia.
Other
51 stars 14 forks source link

Release? #16

Closed cscherrer closed 4 years ago

cscherrer commented 4 years ago

Hi Ed,

The current release depends on Combinatorics 0.7.0, which keeps some other packages from being able to move forward. Would you mind tagging a new release so we can update downstream?

Thanks for all your work on this and SimpleWorld :)

scheinerman commented 4 years ago

I would be delighted to do that, but I have no clue as to how! I really don't understand the whole package management business in Julia. Are there good "idiot proof" directions somewhere?

cscherrer commented 4 years ago

I think the easiest way is with the Registrator bot. I've only done this through Github. In that case you update the version number in the Project.toml and push the commit to master, then comment on the commit.

You have to install the app first, which is really just clicking through on Github to authorize it. There are some instructions here:

https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app

I haven't tried the web interface, but maybe that's easier? Happy to help if you get stuck :)

cscherrer commented 4 years ago

Oh and you need to edit the first few lines of your Project.toml. For a template, here are mine for Soss:

name = "Soss"
uuid = "8ce77f84-9b61-11e8-39ff-d17a774bf41c"
author = ["Chad Scherrer <chad.scherrer@gmail.com>"]
version = "0.11.0"

I think you just need to add something for your third and fourth lines, it probably won't work without a version number

scheinerman commented 4 years ago

Chad: I'm still having a rotten time. I edited the Project.toml file; that was easy. Then I went to the Regisrator page https://pkg.julialang.org/registrator/select and entered the URL for this package, namely: https://github.com/scheinerman/Permutations.jl.git and clicked SUBMIT, only to get this message: ERROR: Repository was not found

cscherrer commented 4 years ago

Not sure, but I think it needs to be https://github.com/scheinerman/Permutations.jl (without the .git)

scheinerman commented 4 years ago

Thanks. Sorry for the delay. I tried again and this time is says it worked. Can you let me know if it looks right for you?

scheinerman commented 4 years ago

It failed. I'll try to figure out how to fix it.

scheinerman commented 4 years ago

Here's the email I got:

Your new version pull request does not meet the following guidelines for auto-merging:

Does not meet sequential version number guideline: version 0.9.0 skips over 0.4.0 The following dependencies do not have a compat entry that has an upper bound: Combinatorics, julia. You may find CompatHelper helpful for keeping your compat entries up-to-date.Note: If your package works for the current version x.y.z of a dependency foo, then a compat entry foo = x.y.z implies a compatibility upper bound for packages following semver. You can additionally include earlier versions your package is compatible with. See https://julialang.github.io/Pkg.jl/v1/compatibility/ for details.

I changed 0.9.0 to 0.4.0 in the Project.toml file, but haveno idea what "compat entry" means or how to fix. Do I need to edit the Project.toml file somehow?

cscherrer commented 4 years ago

Making progress!

This stuff can be kind of confusing, and most of the docs seem to be written for people with a lot of devops experience. Here's the high-level from what I've learned so far:

We need to be able to reason about dependencies for things in the registry. The Project.toml always has the package IDs, but it's very helpful to also know what versions of those dependencies a given package can work with.

So, for example, Soss has some lines like this in Project.toml:

[deps]
SimpleGraphs = "55797a34-41de-5266-9ec1-32ac4eb504d3"
SimplePartitions = "ec83eff0-a5b5-5643-ae32-5cbf6eedec9d"
SimplePosets = "b2aef97b-4721-5af9-b440-0bad754dc5ba"

[compat]
SimpleGraphs = "0.3"
SimplePartitions = "0.2"
SimplePosets = "0.0"

We have the IDs in the deps section, and "version bounds" in the compat section. If your package has version bounds, new releases can be automatically merged into the registry (no human intervention required from registry maintainers) so it saves them some work, and updates go through faster.

So, compat version bounds are really nice in this way. But now say one of the dependencies gets a new version. We need a way for downstream dependencies to be alerted, so we can update. This is the point of CompatHelper. If there's a new version of, say SimpleGraphs, I'll automatically see a pull request from the CompatHelper bot asking me to update my compat section. I make sure it doesn't break anything, then merge the PR.

I can start a PR for version bounds in case that's helpful :)

cscherrer commented 4 years ago

Looking more closely at this, adding one line to the compat section of Project.toml might do it:

Combinatorics = "1.0"
scheinerman commented 4 years ago

OK. I only sort of understand the long explanation but I certainly was able to add that one line to my Project.toml. I sent it to the registrator again. With luck, this did it! One question though. Should I have (as you suggest) Combinatorics = "1.0" or would it be better to have Combinatorics = "≥1.0" so I don't have to change anything if Combinatorics gets updates. Or is the point that I really shouldn't do this in case there are significant changes?

In any case, please let me know if this worked and THANK YOU for all your help.

cscherrer commented 4 years ago

In Julia, Combinatorics = "1.0" is equivalent to Combinatorics = "^1.0". In "semantic versioning", the ^ means something like "compatible versions starting at...", so ^1.0 represents the half-open interval [1.0, 2.0).

I'd recommend Combinatorics = "1.0", since otherwise an incompatible 2.0 would break things without letting you know there could be a problem.

I see Permutations 0.4 if I pull from master, but not yet from the registry. But maybe this still takes some time. Did you get a reference of some sort for the pending request?

scheinerman commented 4 years ago

I got this message:

@JuliaRegistrator pushed 1 commit.

ced412e New version: Permutations v0.4.0

And this time did not receive an email alerting me to errors. So I suppose that's good?!

JuliaRegistrator commented 4 years ago

Error while trying to register: Action not recognized: pushed

cscherrer commented 4 years ago

I think I see the issue, I've added a PR https://github.com/scheinerman/Permutations.jl/pull/17 to (hopefully) take care of this

scheinerman commented 4 years ago

Thanks. I merged the pull request. Do I need to do the Regisrator again? And perhaps I shouldn't worry about Julia's below 1.0 and just make the line julia = "1"?

cscherrer commented 4 years ago

I think julia = "1" would be fine. Yes, I think you do need to register it again

scheinerman commented 4 years ago

I think we have success! I got this link in a message: https://github.com/JuliaRegistries/General/pull/14500 Does that mean we win? Thank you very much for your help. No way I could have done it otherwise.

cscherrer commented 4 years ago

I think we win!! Glad I could help. I'm pretty new to the devops side of things myself, definitely takes some spinning up. Thanks for working through it!