-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add project compat entry viewing & editing #2702
Add project compat entry viewing & editing #2702
Conversation
It would be easier to realize the existence of edit mode if there's one line description after/before Another question: is the compat edit affecting immediately, or it saves onto some in-memory struct and only changes the "Project.toml" until you quit the edit mode? I'm thinking of the second one because it provides some rollback mechanism (sort of dry run) besides fewer IO operations. |
Yeah I wondered about adding a note on edit mode. It's not done for any other
It acts immediately on the file but complies with the |
a0084d8
to
237105a
Compare
This is very cool and useful. Let's punt on the tip thing for now. People can RTFM or be told about |
237105a
to
39b6b03
Compare
Yeah that sounds good. I've switched |
Seems worth a go? My only remaining thought is whether the API occupies space that might be better used for something else? |
Personally, I can't think of another meaning for |
I know that @GunnarFarneback has built similar functionality in a package. He might be able to comment on any lessons or best practices that have been learned from the package and its users. |
Also, there is at least one open issue requesting this feature, so I think that this pull request would close that issue. |
Yeah I think this closes #341. |
Yes, PackageCompatUI. The feedback can mostly be summarized as 50 likes on the discourse announcement, 23 stars on the Github repo and an appreciation on slack. |
Oh cool! The version selection through radio menu and automatic collapsing of version spec is really nice! It would've been nice if I'd found that sooner 😬 I'm not sure what to do now. Is there a reason you didn't consider developing that as part of Pkg @GunnarFarneback ? Some thoughts if this PR goes forward:
|
Interactivity is cool but for the specific case of adding compat, I don't really see that big of an advantage over just specifying the package and the compat string directly (or just using a normal text editor). Let's take Some other thoughts: One question is if
The |
The main reason for not doing it inside Pkg is that I wanted the feature to show the registration date of package versions, which seemed unreasonable to include in Pkg as it requires a git clone of the registry and is somewhat slow, plus more freedom to try things out.
The primary advantage of the menu selection is that the user gets a correct compat entry without knowing the version specifier format. The main disadvantage is that some things can't really be expressed that way, e.g. compat with Julia 1.7 before it's released. |
Replying to @KristofferC I'll add the basic I still think there's a benefit to prompting the edit with the current string for manipulation, as it would be a lot to expect the user to retype/copy-paste the current entry in, to insert a new version. It may also also be error-prone. Perhaps a form All of those additions could be CI tested. Come to think of it, so can the full menu, by pre-loading the stdin buffer before running the menu. |
Tab completion! That's the way to do it probably. |
39b6b03
to
c5981c1
Compare
Strongly agree with this. I'd be happy to run this to capture the current versions as lower bounds but I'd be annoyed to have to look up what version each dep is on and add the bound manually. |
e16eec9
to
8fb1c8d
Compare
8fb1c8d
to
5df0283
Compare
Update
|
6940b68
to
97051c8
Compare
Mergeable? |
I think there's support in this current form, so I'll merge this at the weekend if I don't hear otherwise |
433f07a
to
c5ac694
Compare
c5ac694
to
c3ea92e
Compare
Updated: Was
-e|--edit
and defaulted to the static version.Adds a Project compat section viewer via
pkg> compat
and an interactive editor viapkg> compat -l|--list
.Also some API endpoints
Pkg.compat!()
: equivalent topkg> compat
(errors early if run in a non-interactive terminal)Pkg.compat()
: equivalent topkg> compat -l
Pkg.compat("Foo")
: Return compat entry for Foo (nothing
if no entry)Pkg.compat!("Foo", "1.2")
: Set entry for Foo (usenothing
or""
to remove the entry)I think there a few benefits to adding this:
compat
entries according to current installed versions #2463)0.4,0.5,0.7,0.8
Todo (if approved of)