From 8a359f9c0048b08c855f35263d889186f754650a Mon Sep 17 00:00:00 2001 From: Bartosz Kardas Date: Sun, 11 Dec 2022 01:11:21 +0100 Subject: [PATCH 1/7] Readded setuptools --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e09e62e0..7166cb19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN --mount=type=cache,target=${PIP_CACHE_DIR} \ FROM alpine:${ALPINE_VERSION} # install python, git, bash, mercurial -RUN apk add --no-cache git git-lfs python3 py3-pip bash docker mercurial +RUN apk add --no-cache git git-lfs python3 py3-pip py3-setuptools bash docker mercurial # repeat ARG from above ARG PIP_CACHE_DIR=/tmp/pip-cache From c3d257519bdc51cafb26af1a0e5f25aa6b7f5b03 Mon Sep 17 00:00:00 2001 From: Bartosz Kardas Date: Sun, 11 Dec 2022 22:00:41 +0100 Subject: [PATCH 2/7] Fixd shell command for buildpacks/r --- repo2docker/buildpacks/r.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repo2docker/buildpacks/r.py b/repo2docker/buildpacks/r.py index 0dc53357..217ac0e7 100644 --- a/repo2docker/buildpacks/r.py +++ b/repo2docker/buildpacks/r.py @@ -343,8 +343,8 @@ class RBuildPack(PythonBuildPack): ( "${NB_USER}", # Install a pinned version of devtools, IRKernel and shiny - r""" - EXPANDED_CRAN_MIRROR_URL="$(. /etc/os-release && echo {self.devtools_cran_mirror_url()} | envsubst)" && \ + rf""" + EXPANDED_CRAN_MIRROR_URL="$(. /etc/os-release && echo {cran_mirror_url} | envsubst)" && \ R --quiet -e "install.packages(c('devtools', 'IRkernel', 'shiny'), repos='${{EXPANDED_CRAN_MIRROR_URL}}')" && \ R --quiet -e "IRkernel::installspec(prefix='$NB_PYTHON_PREFIX')" """, From 76731c885b5ad99087060e2a03527897b1a6c581 Mon Sep 17 00:00:00 2001 From: Bartosz Kardas Date: Sun, 11 Dec 2022 22:08:18 +0100 Subject: [PATCH 3/7] Added setuptools --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7166cb19..6a1605af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG ALPINE_VERSION=3.16 FROM alpine:${ALPINE_VERSION} AS builder -RUN apk add --no-cache git python3 python3-dev py3-pip build-base +RUN apk add --no-cache git python3 python3-dev py3-pip py3-setuptools build-base # set pip's cache directory using this environment variable, and use # ARG instead of ENV to ensure its only set when the image is built From 21ad4cac543a456d65ba964939b5737064abbc70 Mon Sep 17 00:00:00 2001 From: Bartosz Kardas Date: Sun, 11 Dec 2022 23:04:03 +0100 Subject: [PATCH 4/7] Bump linux alpine to 3.17 due to setuptools bug --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6a1605af..dd4d8587 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.3 -ARG ALPINE_VERSION=3.16 +ARG ALPINE_VERSION=3.17 FROM alpine:${ALPINE_VERSION} AS builder RUN apk add --no-cache git python3 python3-dev py3-pip py3-setuptools build-base From 52e80769b0cfb7887613c7248dc729e4515a78d8 Mon Sep 17 00:00:00 2001 From: Bartosz Kardas Date: Sun, 11 Dec 2022 23:26:24 +0100 Subject: [PATCH 5/7] Renamed branch to main --- repo2docker/contentproviders/git.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repo2docker/contentproviders/git.py b/repo2docker/contentproviders/git.py index f35e9a88..1427bd09 100644 --- a/repo2docker/contentproviders/git.py +++ b/repo2docker/contentproviders/git.py @@ -45,10 +45,10 @@ class Git(ContentProvider): self.log.error( f"Failed to check out ref {ref}", extra=dict(phase=R2dState.FAILED) ) - if ref == "master": + if ref == "main": msg = ( - "Failed to check out the 'master' branch. " - "Maybe the default branch is not named 'master' " + "Failed to check out the 'main' branch. " + "Maybe the default branch is not named 'main' " "for this repository.\n\nTry not explicitly " "specifying `--ref`." ) From b85df8f9933b5b3294c8a4ce8fecce797d0a4602 Mon Sep 17 00:00:00 2001 From: Bartosz Kardas Date: Sun, 11 Dec 2022 23:38:27 +0100 Subject: [PATCH 6/7] Refactored R command --- repo2docker/buildpacks/r.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repo2docker/buildpacks/r.py b/repo2docker/buildpacks/r.py index 217ac0e7..9cb59f3f 100644 --- a/repo2docker/buildpacks/r.py +++ b/repo2docker/buildpacks/r.py @@ -344,9 +344,9 @@ class RBuildPack(PythonBuildPack): "${NB_USER}", # Install a pinned version of devtools, IRKernel and shiny rf""" - EXPANDED_CRAN_MIRROR_URL="$(. /etc/os-release && echo {cran_mirror_url} | envsubst)" && \ - R --quiet -e "install.packages(c('devtools', 'IRkernel', 'shiny'), repos='${{EXPANDED_CRAN_MIRROR_URL}}')" && \ - R --quiet -e "IRkernel::installspec(prefix='$NB_PYTHON_PREFIX')" + export EXPANDED_CRAN_MIRROR_URL="$(. /etc/os-release && echo {cran_mirror_url} | envsubst)" && \ + R --quiet -e "install.packages(c('devtools', 'IRkernel', 'shiny'), repos=Sys.getenv(\"EXPANDED_CRAN_MIRROR_URL\"))" && \ + R --quiet -e "IRkernel::installspec(prefix=Sys.getenv(\"NB_PYTHON_PREFIX\"))" """, ), ] From 0b9154ae2b3e213627e0971ae0b141f0406513de Mon Sep 17 00:00:00 2001 From: Bartosz Kardas Date: Mon, 12 Dec 2022 00:04:09 +0100 Subject: [PATCH 7/7] Updated master/main branches error info --- repo2docker/contentproviders/git.py | 6 +++--- tests/external/reproductions.repos.yaml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/repo2docker/contentproviders/git.py b/repo2docker/contentproviders/git.py index 1427bd09..905fa4ee 100644 --- a/repo2docker/contentproviders/git.py +++ b/repo2docker/contentproviders/git.py @@ -45,10 +45,10 @@ class Git(ContentProvider): self.log.error( f"Failed to check out ref {ref}", extra=dict(phase=R2dState.FAILED) ) - if ref == "main": + if ref == "master" or ref == "main": msg = ( - "Failed to check out the 'main' branch. " - "Maybe the default branch is not named 'main' " + f"Failed to check out the '{ref}' branch. " + f"Maybe the default branch is not named '{ref}' " "for this repository.\n\nTry not explicitly " "specifying `--ref`." ) diff --git a/tests/external/reproductions.repos.yaml b/tests/external/reproductions.repos.yaml index d019bc10..74f1085c 100644 --- a/tests/external/reproductions.repos.yaml +++ b/tests/external/reproductions.repos.yaml @@ -12,12 +12,12 @@ # Test that a full remote/ref works - name: Binder Examples - Requirements url: https://github.com/binder-examples/requirements - ref: origin/master + ref: origin/main verify: python -c 'import matplotlib' # Test that ref is added to branch if not present - name: Binder Examples - Requirements url: https://github.com/binder-examples/requirements - ref: master + ref: main verify: python -c 'import matplotlib' # Test that tags work + ref is added to tag if not present - name: Binder Examples - Requirements