Skip to content

Commit b1c682a

Browse files
Merge pull request #207 from davenverse/ce3
Update for Cats-Effect 3
2 parents cd58df6 + 643d876 commit b1c682a

19 files changed

Lines changed: 75 additions & 77 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
matrix:
2525
os: [ubuntu-latest]
26-
scala: [2.12.10, 2.13.6, 3.0.1]
26+
scala: [2.12.10, 2.13.6]
2727
java: [adopt@1.8, adopt@1.11]
2828
runs-on: ${{ matrix.os }}
2929
steps:
@@ -76,7 +76,7 @@ jobs:
7676
strategy:
7777
matrix:
7878
os: [ubuntu-latest]
79-
scala: [3.0.1]
79+
scala: [2.13.6]
8080
java: [adopt@1.8]
8181
runs-on: ${{ matrix.os }}
8282
steps:

build.sbt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
22

3-
ThisBuild / crossScalaVersions := Seq("2.12.10", "2.13.6", "3.0.1")
3+
ThisBuild / crossScalaVersions := Seq("2.12.10", "2.13.6")
44

55
val catsV = "2.6.1"
6-
val catsEffectV = "2.5.2"
7-
val fs2V = "2.5.9"
8-
val http4sV = "0.22.1"
6+
val catsEffectV = "3.2.1"
7+
val fs2V = "3.0.6"
8+
val http4sV = "0.23.0"
99
val circeV = "0.14.1"
10-
val catsEffectTestingV = "0.5.4"
11-
val log4catsV = "1.3.1"
10+
val catsEffectTestingV = "1.0.0-M1"
11+
val log4catsV = "2.1.1"
1212
val logbackClassicV = "1.2.3"
1313

14-
val specs2V = "4.9.2"
14+
val specs2V = "4.12.3"
1515

16-
val kindProjectorV = "0.11.0"
17-
val betterMonadicForV = "0.3.1"
1816

1917
lazy val `github` = project.in(file("."))
2018
.disablePlugins(MimaPlugin)
@@ -48,7 +46,7 @@ lazy val core = project.in(file("core"))
4846

4947
("org.specs2" %% "specs2-core" % specs2V % Test).cross(CrossVersion.for3Use2_13),
5048
("org.specs2" %% "specs2-scalacheck" % specs2V % Test).cross(CrossVersion.for3Use2_13),
51-
"com.codecommit" %% "cats-effect-testing-specs2" % catsEffectTestingV % Test
49+
("com.codecommit" %% "cats-effect-testing-specs2" % catsEffectTestingV % Test).cross(CrossVersion.for3Use2_13)
5250
)
5351
)
5452

core/src/main/scala/io/chrisdavenport/github/endpoints/Gists.scala

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import java.time.ZonedDateTime
2020

2121
object Gists {
2222

23-
def list[F[_]: Sync](
23+
def list[F[_]: Concurrent](
2424
username: String,
2525
since: Option[ZonedDateTime],
2626
auth: Option[Auth]
@@ -35,7 +35,7 @@ object Gists {
3535
* List all public gists sorted by most recently updated to least recently updated.
3636
* https://developer.github.com/v3/gists/#list-all-public-gists
3737
*/
38-
def allPublic[F[_]: Sync](
38+
def allPublic[F[_]: Concurrent](
3939
since: Option[ZonedDateTime],
4040
auth: Option[Auth]
4141
): Kleisli[Stream[F, *], Client[F], List[Gist]] =
@@ -49,7 +49,7 @@ object Gists {
4949
* List starred gists by the authenticated user
5050
* https://developer.github.com/v3/gists/#list-starred-gists
5151
*/
52-
def starred[F[_]: Sync](
52+
def starred[F[_]: Concurrent](
5353
since: Option[ZonedDateTime],
5454
auth: Auth
5555
): Kleisli[Stream[F, *], Client[F], List[Gist]] =
@@ -63,7 +63,7 @@ object Gists {
6363
* Get a single gist by its id
6464
* https://developer.github.com/v3/gists/#get-a-single-gist
6565
*/
66-
def get[F[_]: Sync](
66+
def get[F[_]: Concurrent](
6767
gistId: String,
6868
auth: Option[Auth]
6969
): Kleisli[F, Client[F], Gist] =
@@ -77,7 +77,7 @@ object Gists {
7777
* Get a specific revision of a gist
7878
* https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist
7979
*/
80-
def getRevision[F[_]: Sync](
80+
def getRevision[F[_]: Concurrent](
8181
gistId: String,
8282
sha: String,
8383
auth: Option[Auth]
@@ -92,7 +92,7 @@ object Gists {
9292
* Creates a new gist
9393
* https://developer.github.com/v3/gists/#create-a-gist
9494
*/
95-
def create[F[_]: Sync](
95+
def create[F[_]: Concurrent](
9696
newGist: CreateGist,
9797
auth: Auth
9898
): Kleisli[F, Client[F], Gist] =
@@ -107,7 +107,7 @@ object Gists {
107107
* Edit a gist
108108
* https://developer.github.com/v3/gists/#edit-a-gist
109109
*/
110-
def editGist[F[_]: Sync](
110+
def editGist[F[_]: Concurrent](
111111
gistId: String,
112112
editGist: EditGist,
113113
auth: Auth
@@ -123,7 +123,7 @@ object Gists {
123123
* List commits history for a gist
124124
* https://developer.github.com/v3/gists/#list-gist-commits
125125
*/
126-
def listCommits[F[_]: Sync](
126+
def listCommits[F[_]: Concurrent](
127127
gistId: String,
128128
auth: Auth
129129
): Kleisli[F, Client[F], List[GistCommit]] =
@@ -137,21 +137,21 @@ object Gists {
137137
* Star a gist
138138
* https://developer.github.com/v3/gists/#star-a-gist
139139
*/
140-
def star[F[_]: Sync](
140+
def star[F[_]: Concurrent](
141141
gistId: String,
142142
auth: Auth
143143
): Kleisli[F, Client[F], Unit] =
144144
RequestConstructor.runRequestWithNoBody[F, Unit](
145145
auth.some,
146146
Method.PUT,
147147
uri"gists" / gistId / "star"
148-
)(Sync[F], EntityDecoder.void[F])
148+
)(Concurrent[F], EntityDecoder.void[F])
149149

150150
/**
151151
* Check if a gist is starred
152152
* https://developer.github.com/v3/gists/#check-if-a-gist-is-starred
153153
*/
154-
def checkStarred[F[_]: Sync](
154+
def checkStarred[F[_]: Concurrent](
155155
gistId: String,
156156
auth: Auth
157157
): Kleisli[F, Client[F], Boolean] =
@@ -160,7 +160,7 @@ object Gists {
160160
auth.some,
161161
Method.GET,
162162
uri"gists" / gistId / "star"
163-
)(Sync[F], EntityDecoder.void[F])
163+
)(Concurrent[F], EntityDecoder.void[F])
164164
.map(_ => true)
165165
.recover {
166166
case ghError: RequestConstructor.GithubError if ghError.status == Status.NotFound => false
@@ -170,7 +170,7 @@ object Gists {
170170
* Fork a gist
171171
* https://developer.github.com/v3/gists/#fork-a-gist
172172
*/
173-
def fork[F[_]: Sync](
173+
def fork[F[_]: Concurrent](
174174
gistId: String,
175175
auth: Auth
176176
): Kleisli[F, Client[F], Gist] =
@@ -184,7 +184,7 @@ object Gists {
184184
* List all gist's forks
185185
* https://developer.github.com/v3/gists/#list-gist-forks
186186
*/
187-
def listForks[F[_]: Sync](
187+
def listForks[F[_]: Concurrent](
188188
gistId: String,
189189
auth: Auth
190190
): Kleisli[F, Client[F], List[GistFork]] =
@@ -198,13 +198,13 @@ object Gists {
198198
* Delete an existing gist
199199
* https://developer.github.com/v3/gists/#delete-a-gist
200200
*/
201-
def delete[F[_]: Sync](
201+
def delete[F[_]: Concurrent](
202202
gistId: String,
203203
auth: Auth
204204
): Kleisli[F, Client[F], Unit] =
205205
RequestConstructor.runRequestWithNoBody[F, Unit](
206206
auth.some,
207207
Method.DELETE,
208208
uri"gists" / gistId
209-
)(Sync[F], EntityDecoder.void[F])
209+
)(Concurrent[F], EntityDecoder.void[F])
210210
}

core/src/main/scala/io/chrisdavenport/github/endpoints/PullRequests.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import io.chrisdavenport.github.internals.RequestConstructor
1313

1414
object PullRequests {
1515

16-
def pullRequestsFor[F[_]: Sync](
16+
def pullRequestsFor[F[_]: Concurrent](
1717
owner: String,
1818
name: String,
1919
auth: Option[Auth]
@@ -22,7 +22,7 @@ object PullRequests {
2222
uri"repos" / owner / name / "pulls"
2323
)
2424

25-
def pullRequest[F[_]: Sync](
25+
def pullRequest[F[_]: Concurrent](
2626
owner: String,
2727
name: String,
2828
issueNumber: Issues.IssueNumber,
@@ -33,7 +33,7 @@ object PullRequests {
3333
uri"repos" / owner / name / "pulls" / issueNumber.toInt.toString
3434
)
3535

36-
def createPullRequest[F[_]: Sync](
36+
def createPullRequest[F[_]: Concurrent](
3737
owner: String,
3838
name: String,
3939
createPullRequest: CreatePullRequest,
@@ -45,7 +45,7 @@ object PullRequests {
4545
createPullRequest
4646
)
4747

48-
def updatePullRequest[F[_]: Sync](
48+
def updatePullRequest[F[_]: Concurrent](
4949
owner: String,
5050
name: String,
5151
issueNumber: Issues.IssueNumber,

core/src/main/scala/io/chrisdavenport/github/endpoints/Repositories.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import io.chrisdavenport.github.internals.RequestConstructor
1414

1515
object Repositories {
1616

17-
def repository[F[_]: Sync](
17+
def repository[F[_]: Concurrent](
1818
owner: String,
1919
repo: String,
2020
auth: Option[Auth]
@@ -27,7 +27,7 @@ object Repositories {
2727
)
2828
}
2929

30-
def createRepo[F[_]: Sync](
30+
def createRepo[F[_]: Concurrent](
3131
newRepo: NewRepo,
3232
auth: Auth
3333
): Kleisli[F, Client[F], Repo] = {
@@ -40,7 +40,7 @@ object Repositories {
4040
)
4141
}
4242

43-
def createOrganizationRepo[F[_]: Sync](
43+
def createOrganizationRepo[F[_]: Concurrent](
4444
org: String,
4545
newRepo: NewRepo,
4646
auth: Auth
@@ -54,7 +54,7 @@ object Repositories {
5454
)
5555
}
5656

57-
def edit[F[_]: Sync](
57+
def edit[F[_]: Concurrent](
5858
owner: String,
5959
repo: String,
6060
editRepo: EditRepo,
@@ -72,7 +72,7 @@ object Repositories {
7272
/**
7373
* Deleting a repository requires admin access. If OAuth is used, the delete_repo scope is required.
7474
**/
75-
def delete[F[_]: Sync](
75+
def delete[F[_]: Concurrent](
7676
owner: String,
7777
repo: String,
7878
auth: Auth

core/src/main/scala/io/chrisdavenport/github/endpoints/Search.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ object Search {
2323
* @param auth The authentication mechanism
2424
* @tparam F The effect type
2525
*/
26-
def repository[F[_]: Sync](
26+
def repository[F[_]: Concurrent](
2727
q: String,
2828
sort: Option[Sort.Repository],
2929
order: Option[Order],
@@ -46,7 +46,7 @@ object Search {
4646
* @param auth The authentication mechanism
4747
* @tparam F The effect type
4848
*/
49-
def users[F[_]: Sync](
49+
def users[F[_]: Concurrent](
5050
q: String,
5151
sort: Option[Sort.User],
5252
order: Option[Order],

core/src/main/scala/io/chrisdavenport/github/endpoints/Users.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ import io.chrisdavenport.github.internals.RequestConstructor
1515

1616
object Users {
1717

18-
def userInfoFor[F[_]: Sync](username: String, auth: Option[Auth]): Kleisli[F, Client[F], User] =
18+
def userInfoFor[F[_]: Concurrent](username: String, auth: Option[Auth]): Kleisli[F, Client[F], User] =
1919
RequestConstructor.runRequestWithNoBody[F, User](
2020
auth,
2121
Method.GET,
2222
uri"users" / username
2323
)
2424

25-
def ownerInfoFor[F[_]: Sync](owner: String, auth: Option[Auth]): Kleisli[F, Client[F], Owner] =
25+
def ownerInfoFor[F[_]: Concurrent](owner: String, auth: Option[Auth]): Kleisli[F, Client[F], Owner] =
2626
RequestConstructor.runRequestWithNoBody[F, Owner](
2727
auth,
2828
Method.GET,
2929
uri"users" / owner
3030
)
3131

32-
def userInfoAuthenticatedUser[F[_]: Sync](auth: Auth): Kleisli[F, Client[F], User] =
32+
def userInfoAuthenticatedUser[F[_]: Concurrent](auth: Auth): Kleisli[F, Client[F], User] =
3333
RequestConstructor.runRequestWithNoBody[F, User](
3434
auth.some,
3535
Method.GET,
@@ -39,7 +39,7 @@ object Users {
3939
// We expose this as the returned list for each request
4040
// that way users can monitor how many requests they make
4141
// and can know where they stand in regards to their cap.
42-
def getAllUsers[F[_]: Sync](
42+
def getAllUsers[F[_]: Concurrent](
4343
since: Option[String],
4444
auth: Option[Auth]
4545
): Kleisli[({ type S[A] = Stream[F, A]})#S, Client[F], List[SimpleOwner]] =
@@ -52,7 +52,7 @@ object Users {
5252
// if null values are removed entirely, so
5353
// for the first draft dropNull values
5454
// possibly in the future rework
55-
def updateAuthenticatedUser[F[_]: Sync](
55+
def updateAuthenticatedUser[F[_]: Concurrent](
5656
auth: Auth,
5757
name: Option[String],
5858
email: Option[String],

core/src/main/scala/io/chrisdavenport/github/endpoints/gitdata/Blobs.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ object Blobs {
2323
*
2424
* Note: This API supports blobs up to 100 megabytes in size.
2525
**/
26-
def getBlob[F[_]: Sync](
26+
def getBlob[F[_]: Concurrent](
2727
owner: String,
2828
repo: String,
2929
sha: String,
@@ -43,7 +43,7 @@ object Blobs {
4343
* content string Required. The new blob's content.
4444
* encoding string The encoding used for content. Currently, "utf-8" and "base64" are supported. Default: "utf-8".
4545
*/
46-
def createBlob[F[_]: Sync](
46+
def createBlob[F[_]: Concurrent](
4747
owner: String,
4848
repo: String,
4949
createBlob: CreateBlob,

core/src/main/scala/io/chrisdavenport/github/endpoints/gitdata/Commits.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ object Commits {
2929
* GET /repos/:owner/:repo/git/commits/:commit_sha
3030
*
3131
**/
32-
def getCommit[F[_]: Sync](
32+
def getCommit[F[_]: Concurrent](
3333
owner: String,
3434
repo: String,
3535
commitSha: String,
@@ -48,7 +48,7 @@ object Commits {
4848
*
4949
* POST /repos/:owner/:repo/git/commits
5050
**/
51-
def createCommit[F[_]: Sync](
51+
def createCommit[F[_]: Concurrent](
5252
owner: String,
5353
repo: String,
5454
createCommit: CreateCommit,

0 commit comments

Comments
 (0)