Skip to content

Commit dce9324

Browse files
authored
Merge pull request #257 from tmcgilchrist/cohttp_4
Support Cohttp 4.0
2 parents c521510 + b89d763 commit dce9324

File tree

9 files changed

+160
-110
lines changed

9 files changed

+160
-110
lines changed

dune-project

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
(lang dune 1.10)
1+
(lang dune 2.7)
22
(name github)
33

44
(generate_opam_files true)
5+
(formatting disabled)
56

67
(license MIT)
78
(maintainers "Anil Madhavapeddy <[email protected]>")
@@ -15,12 +16,12 @@
1516
(name github)
1617
(tags (org:mirage org:xapi-project git))
1718
(depends
18-
(ocaml (>= 4.03.0))
19-
(dune (>= 1.10))
19+
(ocaml (>= 4.08.0))
2020
(uri (>= 1.9.0))
21-
(cohttp (and (>= 0.99.0) (< 3.0.0)))
22-
(cohttp-lwt (and (>= 0.99.0) (< 3.0.0)))
21+
(cohttp (>= 4.0.0))
22+
(cohttp-lwt-jsoo (>= 4.0.0))
2323
(lwt (>= 2.4.4))
24+
(cohttp-lwt (>= 4.0.0))
2425
(github-data (= :version))
2526
(yojson (>= 1.6.0))
2627
stringext)
@@ -35,11 +36,10 @@ JavaScript via [js_of_ocaml](http://ocsigen.org/js_of_ocaml)."))
3536
(name github-jsoo)
3637
(tags (org:mirage org:xapi-project git))
3738
(depends
38-
(ocaml (>= 4.03.0))
39-
(dune (>= 1.10))
39+
(ocaml (>= 4.08.0))
4040
(github (= :version))
41-
(cohttp (and (>= 0.99.0) (< 3.0.0)))
42-
(cohttp-lwt-jsoo (and (>= 0.99.0) (< 3.0.0)))
41+
(cohttp (>= 4.0.0))
42+
(cohttp-lwt-jsoo (>= 4.0.0))
4343
(js_of_ocaml-lwt (>= 3.4.0)))
4444
(synopsis "GitHub APIv3 JavaScript library")
4545
(description "This library provides an OCaml interface to the [GitHub APIv3](https://docs.github.com/rest/)
@@ -49,11 +49,10 @@ JavaScript via [js_of_ocaml](http://ocsigen.org/js_of_ocaml)."))
4949
(name github-unix)
5050
(tags (org:mirage org:xapi-project git))
5151
(depends
52-
(ocaml (>= 4.03.0))
53-
(dune (>= 1.10))
52+
(ocaml (>= 4.08.0))
5453
(github (= :version))
55-
(cohttp (and (>= 0.99.0) (< 3.0.0)))
56-
(cohttp-lwt-unix (and (>= 0.99.0) (< 3.0.0)))
54+
(cohttp (>= 4.0.0))
55+
(cohttp-lwt-unix (>= 4.0.0))
5756
stringext
5857
(cmdliner (>= 0.9.8))
5958
base-unix
@@ -66,9 +65,8 @@ JavaScript via [js_of_ocaml](http://ocsigen.org/js_of_ocaml)."))
6665
(name github-data)
6766
(tags (org:mirage org:xapi-project git))
6867
(depends
69-
(ocaml (>= 4.03.0))
70-
(dune (>= 1.10))
71-
(yojson (>= 1.6.0))
68+
(ocaml (>= 4.08.0))
69+
(yojson (>= 1.7.0))
7270
(atdgen (>= 2.0.0)))
7371
(synopsis "GitHub APIv3 data library")
7472
(description "This library provides an OCaml interface to the [GitHub APIv3](https://docs.github.com/rest/)

github-data.opam

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# This file is generated by dune, edit dune-project instead
22
opam-version: "2.0"
3-
build: [
4-
["dune" "subst"] {pinned}
5-
["dune" "build" "-p" name "-j" jobs]
6-
["dune" "runtest" "-p" name "-j" jobs] {with-test}
7-
["dune" "build" "-p" name "@doc"] {with-doc}
8-
]
3+
synopsis: "GitHub APIv3 data library"
4+
description: """
5+
This library provides an OCaml interface to the [GitHub APIv3](https://docs.github.com/rest/)
6+
(JSON). This package installs the data conversion library."""
97
maintainer: ["Anil Madhavapeddy <[email protected]>"]
108
authors: [
119
"Anil Madhavapeddy"
@@ -18,18 +16,30 @@ authors: [
1816
"Jeremy Yallop"
1917
"Dave Tucker"
2018
]
21-
bug-reports: "https://github.com/mirage/ocaml-github/issues"
19+
license: "MIT"
20+
tags: ["org:mirage" "org:xapi-project" "git"]
2221
homepage: "https://github.com/mirage/ocaml-github"
2322
doc: "https://mirage.github.io/ocaml-github/"
24-
license: "MIT"
25-
dev-repo: "git+https://github.com/mirage/ocaml-github.git"
26-
synopsis: "GitHub APIv3 data library"
27-
description: """
28-
This library provides an OCaml interface to the [GitHub APIv3](https://docs.github.com/rest/)
29-
(JSON). This package installs the data conversion library."""
23+
bug-reports: "https://github.com/mirage/ocaml-github/issues"
3024
depends: [
31-
"ocaml" {>= "4.03.0"}
32-
"dune" {>= "1.10"}
33-
"yojson" {>= "1.6.0"}
25+
"dune" {>= "2.7"}
26+
"ocaml" {>= "4.08.0"}
27+
"yojson" {>= "1.7.0"}
3428
"atdgen" {>= "2.0.0"}
29+
"odoc" {with-doc}
30+
]
31+
build: [
32+
["dune" "subst"] {dev}
33+
[
34+
"dune"
35+
"build"
36+
"-p"
37+
name
38+
"-j"
39+
jobs
40+
"@install"
41+
"@runtest" {with-test}
42+
"@doc" {with-doc}
43+
]
3544
]
45+
dev-repo: "git+https://github.com/mirage/ocaml-github.git"

github-jsoo.opam

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# This file is generated by dune, edit dune-project instead
22
opam-version: "2.0"
3-
build: [
4-
["dune" "subst"] {pinned}
5-
["dune" "build" "-p" name "-j" jobs]
6-
["dune" "runtest" "-p" name "-j" jobs] {with-test}
7-
["dune" "build" "-p" name "@doc"] {with-doc}
8-
]
3+
synopsis: "GitHub APIv3 JavaScript library"
4+
description: """
5+
This library provides an OCaml interface to the [GitHub APIv3](https://docs.github.com/rest/)
6+
(JSON). This library installs the JavaScript version, which uses [js_of_ocaml](http://ocsigen.org/js_of_ocaml)."""
97
maintainer: ["Anil Madhavapeddy <[email protected]>"]
108
authors: [
119
"Anil Madhavapeddy"
@@ -18,20 +16,32 @@ authors: [
1816
"Jeremy Yallop"
1917
"Dave Tucker"
2018
]
21-
bug-reports: "https://github.com/mirage/ocaml-github/issues"
19+
license: "MIT"
20+
tags: ["org:mirage" "org:xapi-project" "git"]
2221
homepage: "https://github.com/mirage/ocaml-github"
2322
doc: "https://mirage.github.io/ocaml-github/"
24-
license: "MIT"
25-
dev-repo: "git+https://github.com/mirage/ocaml-github.git"
26-
synopsis: "GitHub APIv3 JavaScript library"
27-
description: """
28-
This library provides an OCaml interface to the [GitHub APIv3](https://docs.github.com/rest/)
29-
(JSON). This library installs the JavaScript version, which uses [js_of_ocaml](http://ocsigen.org/js_of_ocaml)."""
23+
bug-reports: "https://github.com/mirage/ocaml-github/issues"
3024
depends: [
31-
"ocaml" {>= "4.03.0"}
32-
"dune" {>= "1.10"}
25+
"dune" {>= "2.7"}
26+
"ocaml" {>= "4.08.0"}
3327
"github" {= version}
34-
"cohttp" {>= "0.99.0" & < "3.0.0"}
35-
"cohttp-lwt-jsoo" {>= "0.99.0" & < "3.0.0"}
28+
"cohttp" {>= "4.0.0"}
29+
"cohttp-lwt-jsoo" {>= "4.0.0"}
3630
"js_of_ocaml-lwt" {>= "3.4.0"}
31+
"odoc" {with-doc}
32+
]
33+
build: [
34+
["dune" "subst"] {dev}
35+
[
36+
"dune"
37+
"build"
38+
"-p"
39+
name
40+
"-j"
41+
jobs
42+
"@install"
43+
"@runtest" {with-test}
44+
"@doc" {with-doc}
45+
]
3746
]
47+
dev-repo: "git+https://github.com/mirage/ocaml-github.git"

github-unix.opam

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# This file is generated by dune, edit dune-project instead
22
opam-version: "2.0"
3-
build: [
4-
["dune" "subst"] {pinned}
5-
["dune" "build" "-p" name "-j" jobs]
6-
["dune" "runtest" "-p" name "-j" jobs] {with-test}
7-
["dune" "build" "-p" name "@doc"] {with-doc}
8-
]
3+
synopsis: "GitHub APIv3 Unix library"
4+
description: """
5+
This library provides an OCaml interface to the [GitHub APIv3](https://docs.github.com/rest/)
6+
(JSON). This package installs the Unix (Lwt) version."""
97
maintainer: ["Anil Madhavapeddy <[email protected]>"]
108
authors: [
119
"Anil Madhavapeddy"
@@ -18,23 +16,35 @@ authors: [
1816
"Jeremy Yallop"
1917
"Dave Tucker"
2018
]
21-
bug-reports: "https://github.com/mirage/ocaml-github/issues"
19+
license: "MIT"
20+
tags: ["org:mirage" "org:xapi-project" "git"]
2221
homepage: "https://github.com/mirage/ocaml-github"
2322
doc: "https://mirage.github.io/ocaml-github/"
24-
license: "MIT"
25-
dev-repo: "git+https://github.com/mirage/ocaml-github.git"
26-
synopsis: "GitHub APIv3 Unix library"
27-
description: """
28-
This library provides an OCaml interface to the [GitHub APIv3](https://docs.github.com/rest/)
29-
(JSON). This package installs the Unix (Lwt) version."""
23+
bug-reports: "https://github.com/mirage/ocaml-github/issues"
3024
depends: [
31-
"ocaml" {>= "4.03.0"}
32-
"dune" {>= "1.10"}
25+
"dune" {>= "2.7"}
26+
"ocaml" {>= "4.08.0"}
3327
"github" {= version}
34-
"cohttp" {>= "0.99.0" & < "3.0.0"}
35-
"cohttp-lwt-unix" {>= "0.99.0" & < "3.0.0"}
28+
"cohttp" {>= "4.0.0"}
29+
"cohttp-lwt-unix" {>= "4.0.0"}
3630
"stringext"
3731
"cmdliner" {>= "0.9.8"}
3832
"base-unix"
3933
"lwt"
34+
"odoc" {with-doc}
35+
]
36+
build: [
37+
["dune" "subst"] {dev}
38+
[
39+
"dune"
40+
"build"
41+
"-p"
42+
name
43+
"-j"
44+
jobs
45+
"@install"
46+
"@runtest" {with-test}
47+
"@doc" {with-doc}
48+
]
4049
]
50+
dev-repo: "git+https://github.com/mirage/ocaml-github.git"

github.opam

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# This file is generated by dune, edit dune-project instead
22
opam-version: "2.0"
3-
build: [
4-
["dune" "subst"] {pinned}
5-
["dune" "build" "-p" name "-j" jobs]
6-
["dune" "runtest" "-p" name "-j" jobs] {with-test}
7-
["dune" "build" "-p" name "@doc"] {with-doc}
8-
]
3+
synopsis: "GitHub APIv3 OCaml library"
4+
description: """
5+
This library provides an OCaml interface to the
6+
[GitHub APIv3](https://docs.github.com/rest/) (JSON).
7+
8+
It is compatible with [MirageOS](https://mirage.io) and also compiles to pure
9+
JavaScript via [js_of_ocaml](http://ocsigen.org/js_of_ocaml)."""
910
maintainer: ["Anil Madhavapeddy <[email protected]>"]
1011
authors: [
1112
"Anil Madhavapeddy"
@@ -18,26 +19,36 @@ authors: [
1819
"Jeremy Yallop"
1920
"Dave Tucker"
2021
]
21-
bug-reports: "https://github.com/mirage/ocaml-github/issues"
22+
license: "MIT"
23+
tags: ["org:mirage" "org:xapi-project" "git"]
2224
homepage: "https://github.com/mirage/ocaml-github"
2325
doc: "https://mirage.github.io/ocaml-github/"
24-
license: "MIT"
25-
dev-repo: "git+https://github.com/mirage/ocaml-github.git"
26-
synopsis: "GitHub APIv3 OCaml library"
27-
description: """
28-
This library provides an OCaml interface to the
29-
[GitHub APIv3](https://docs.github.com/rest/) (JSON).
30-
31-
It is compatible with [MirageOS](https://mirage.io) and also compiles to pure
32-
JavaScript via [js_of_ocaml](http://ocsigen.org/js_of_ocaml)."""
26+
bug-reports: "https://github.com/mirage/ocaml-github/issues"
3327
depends: [
34-
"ocaml" {>= "4.03.0"}
35-
"dune" {>= "1.10"}
28+
"dune" {>= "2.7"}
29+
"ocaml" {>= "4.08.0"}
3630
"uri" {>= "1.9.0"}
37-
"cohttp" {>= "0.99.0" & < "3.0.0"}
38-
"cohttp-lwt" {>= "0.99.0" & < "3.0.0"}
31+
"cohttp" {>= "4.0.0"}
32+
"cohttp-lwt-jsoo" {>= "4.0.0"}
3933
"lwt" {>= "2.4.4"}
34+
"cohttp-lwt" {>= "4.0.0"}
4035
"github-data" {= version}
4136
"yojson" {>= "1.6.0"}
4237
"stringext"
38+
"odoc" {with-doc}
4339
]
40+
build: [
41+
["dune" "subst"] {dev}
42+
[
43+
"dune"
44+
"build"
45+
"-p"
46+
name
47+
"-j"
48+
jobs
49+
"@install"
50+
"@runtest" {with-test}
51+
"@doc" {with-doc}
52+
]
53+
]
54+
dev-repo: "git+https://github.com/mirage/ocaml-github.git"

js/github.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ module Env = struct
2424
let debug = false
2525
end
2626

27-
module Github' = Github_core.Make(Env)(Time)(Cohttp_lwt_xhr.Client)
27+
module Github' = Github_core.Make(Env)(Time)(Cohttp_lwt_jsoo.Client)
2828
include Github'
2929

lib_test/dune

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,43 @@
11
(executables
22
(libraries cohttp-lwt-unix github_unix atdgen stringext cmdliner)
33
(names
4+
checks
5+
contributors
46
current_user
57
current_user_orgs
6-
organizations
8+
get_token
9+
issues
10+
labels
11+
milestones
712
organization_repos
8-
checks
9-
rwo
10-
get_token
11-
repo_info
12-
repo_stats
13-
contributors
14-
releases
15-
user_type))
13+
organizations
14+
pulls
15+
releases
16+
repo_info
17+
repo_stats
18+
rwo
19+
tags
20+
user_type))
1621

1722
(rule (copy config.ml.in config.ml))
1823

1924
(alias
2025
(name DEFAULT)
2126
(deps
27+
checks.exe
28+
contributors.exe
2229
current_user.exe
2330
current_user_orgs.exe
24-
organizations.exe
31+
get_token.exe
32+
issues.exe
33+
labels.exe
34+
milestones.exe
2535
organization_repos.exe
26-
checks.exe
27-
rwo.exe
28-
get_token.exe
29-
repo_info.exe
30-
repo_stats.exe
31-
releases.exe
32-
contributors.exe
33-
user_type.exe))
36+
organizations.exe
37+
pulls.exe
38+
releases.exe
39+
repo_info.exe
40+
repo_stats.exe
41+
rwo.exe
42+
tags.exe
43+
user_type.exe))

0 commit comments

Comments
 (0)