-
Notifications
You must be signed in to change notification settings - Fork 430
Add support for x-maintenance-intent in dune-project #11274
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dcc7a48
Add support for opam x-maintenance-intent in dune-project
art-w 3cb35fe
Add tests for maintenance_intent
art-w daf7b72
Document maintenance_intent
art-w e777da3
Default maintenance_intent to (latest)
art-w 263bf0b
No x-maintenance-intent in opam files for dune<3.18
art-w File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Support for opam `(maintenance_intent ...)` in dune-project (#11274, @art-w) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,13 +81,15 @@ For example, if your opam file looks like: | |
"conduit-async" { >= "1.0.3" } | ||
"async" { >= "v0.10.0" } | ||
] | ||
x-maintenance-intent: [ "(latest)" ] | ||
|
||
You can express this as:: | ||
|
||
(source (github mirage/ocaml-cohttp)) | ||
(license ISC) | ||
(authors "Anil Madhavapeddy" "Rudi Grinberg") | ||
(maintainers "[email protected]") | ||
(maintenance_intent "(latest)") | ||
|
||
(package | ||
(name cohttp-async) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,19 @@ defined in the project: | |
"Jane Doe <[email protected]>" | ||
"John Doe <[email protected]>") | ||
|
||
.. _maintenance_intent: | ||
.. describe:: (maintenance_intent <strings>) | ||
|
||
.. versionadded:: 3.18 | ||
|
||
Specify the `opam maintenance intent <https://github.com/ocaml/opam-repository/blob/master/governance/policies/archiving.md#specification-of-the-x--fields-used-in-the-archiving-process>`__. | ||
|
||
Example: | ||
|
||
.. code:: dune | ||
|
||
(maintenance_intent "(latest)") | ||
|
||
.. describe:: (source ...) | ||
|
||
.. versionadded:: 1.7 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,21 +20,27 @@ module Dune_config = struct | |
type t = | ||
{ authors : string list option | ||
; maintainers : string list option | ||
; maintenance_intent : string list option | ||
; license : string list option | ||
} | ||
|
||
let decode = | ||
fields | ||
(let+ authors = field_o "authors" (repeat string) | ||
and+ maintainers = field_o "maintainers" (repeat string) | ||
and+ maintenance_intent = field_o "maintenance_intent" (repeat string) | ||
and+ license = field_o "license" (repeat string) in | ||
{ authors; maintainers; license }) | ||
{ authors; maintainers; maintenance_intent; license }) | ||
;; | ||
|
||
let to_dyn t = | ||
let f = Dyn.(option (list string)) in | ||
Dyn.record | ||
[ "authors", f t.authors; "maintainers", f t.maintainers; "license", f t.license ] | ||
[ "authors", f t.authors | ||
; "maintainers", f t.maintainers | ||
; "maintenance_intent", f t.maintenance_intent | ||
; "license", f t.license | ||
] | ||
;; | ||
end | ||
|
||
|
@@ -359,6 +365,7 @@ module Dune_config = struct | |
; project_defaults = | ||
{ authors = Some [ "Author Name <[email protected]>" ] | ||
; maintainers = Some [ "Maintainer Name <[email protected]>" ] | ||
; maintenance_intent = None | ||
; license = Some [ "LICENSE" ] | ||
} | ||
; experimental = [] | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a link to the global field? The global field has the links to the documentation which is nice, so being able to go there directly without having to search for it would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to link to an anchor with rst?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Leonidas-from-XIV for uniformity, I don't think this is what we want. If you look above, there is no link to global.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@art-w No, I don't think so, at least not easily. I think the other file would need to define a named reference at the location where the field is defined and we would need to link to that. Or use a plugin which automatically creates these anchors. If you find an easier way, I'd love to know about it, it does feel like an odd omission in reST/RTD.
@maiste I understand your uniformity argument but I think it should not prevent us from making the documentation easier to navigate. I think it is always better to add a link (and we could do that for other fields that allow overriding as well, or say "all the fields are overrides of the global, link here", though that's not really true as you can't have global
depends
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, my argument makes more sense regarding the code than the documentation. I'm fine with both in the end 😄