Skip to content

Commit 9e3540d

Browse files
downgrade pre-commit for pip installation so that it is the last version that supports python2, which is the system installation on the travis image
1 parent 34a5d37 commit 9e3540d

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
env:
5151
- EXTERNAL_INSTALLATION="TRUE"
5252
before_script:
53-
- pip install pre-commit --user
53+
- pip install pre-commit==v1.21.0 --user
5454
- R -q -e 'tic::before_script()'
5555
- R -q -e 'remove.packages("reticulate")' # only used for installation and uninstallation.
5656
- name: macOS_brew # install pre-commit outside
@@ -67,7 +67,7 @@ jobs:
6767
env:
6868
- EXTERNAL_INSTALLATION="TRUE"
6969
before_script:
70-
- pip install pre-commit --user
70+
- pip install pre-commit==v1.21.0 --user
7171
- R -q -e 'tic::before_script()'
7272
- R -q -e 'remove.packages("reticulate")' # only used for installation and uninstallation.
7373

tests/testthat/test-assumptions.R

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
test_that("documentation regarding desc is still accurate", {
22
skip_on_cran()
3-
versions <- versions::available.versions("desc")
4-
if (max(as.package_version(versions$desc$version)) > "1.2") {
5-
rlang::abort("newer version of desc on CRAN. Adapt the warning and maybe add minimal version requirement?")
6-
}
3+
versions <- versions::available.versions("desc")
4+
if (max(as.package_version(versions$desc$version)) > "1.2") {
5+
rlang::abort("newer version of desc on CRAN. Adapt the warning and maybe add minimal version requirement?")
6+
}
7+
})
8+
9+
test_that("use python3 with pip installations", {
10+
if (Sys.Date() > as.Date("2020-09-30")) {
11+
rlang::abort(paste0(
12+
"Please unpin version requirement for pre-commit in .travis.yml ",
13+
"for pip installations and make things work with Python3. Currently ",
14+
"pinned version 1.21 is the last with python2 support, which is the ",
15+
"system python in the travis R image as of May 2020."
16+
))
17+
}
718
})

0 commit comments

Comments
 (0)