kopia lustrzana https://github.com/jupyterhub/repo2docker
Update Dockerfile (ALPINE_VERSION=3.12.0 & install mercurial) + remove mercurial from install_requires
rodzic
c91ed4eec5
commit
96914545e1
12
Dockerfile
12
Dockerfile
|
@ -1,7 +1,7 @@
|
||||||
ARG ALPINE_VERSION=3.9.4
|
ARG ALPINE_VERSION=3.12.0
|
||||||
FROM alpine:${ALPINE_VERSION}
|
FROM alpine:${ALPINE_VERSION}
|
||||||
|
|
||||||
RUN apk add --no-cache git python3 python3-dev
|
RUN apk add --no-cache git python3 python3-dev py-pip
|
||||||
|
|
||||||
# build wheels in first image
|
# build wheels in first image
|
||||||
ADD . /tmp/src
|
ADD . /tmp/src
|
||||||
|
@ -15,8 +15,12 @@ RUN mkdir /tmp/wheelhouse \
|
||||||
|
|
||||||
FROM alpine:${ALPINE_VERSION}
|
FROM alpine:${ALPINE_VERSION}
|
||||||
|
|
||||||
# install python, git, bash
|
# install python, git, bash, mercurial
|
||||||
RUN apk add --no-cache git git-lfs python3 bash docker
|
RUN apk add --no-cache git git-lfs python3 py-pip bash docker mercurial
|
||||||
|
|
||||||
|
# install and activate the evolve and topic Mercurial extensions
|
||||||
|
RUN pip3 install hg-evolve --user --no-cache-dir
|
||||||
|
RUN mkdir -p /etc/mercurial/hgrc.d && echo -e "[extensions]\nevolve =\ntopic =\n" > /etc/mercurial/hgrc.d/evolve.rc
|
||||||
|
|
||||||
# install repo2docker
|
# install repo2docker
|
||||||
COPY --from=0 /tmp/wheelhouse /tmp/wheelhouse
|
COPY --from=0 /tmp/wheelhouse /tmp/wheelhouse
|
||||||
|
|
|
@ -4,16 +4,6 @@ from .base import ContentProvider, ContentProviderException
|
||||||
from ..utils import execute_cmd
|
from ..utils import execute_cmd
|
||||||
|
|
||||||
|
|
||||||
hg_config = [
|
|
||||||
"--config",
|
|
||||||
"extensions.hggit=!",
|
|
||||||
"--config",
|
|
||||||
"extensions.evolve=",
|
|
||||||
"--config",
|
|
||||||
"extensions.topic=",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class Mercurial(ContentProvider):
|
class Mercurial(ContentProvider):
|
||||||
"""Provide contents of a remote Mercurial repository."""
|
"""Provide contents of a remote Mercurial repository."""
|
||||||
|
|
||||||
|
@ -22,7 +12,8 @@ class Mercurial(ContentProvider):
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
subprocess.check_output(
|
subprocess.check_output(
|
||||||
["hg", "identify", source] + hg_config, stderr=subprocess.DEVNULL,
|
["hg", "identify", source, "--config", "extensions.hggit=!"],
|
||||||
|
stderr=subprocess.DEVNULL,
|
||||||
)
|
)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
return None
|
return None
|
||||||
|
@ -36,7 +27,6 @@ class Mercurial(ContentProvider):
|
||||||
# make a clone of the remote repository
|
# make a clone of the remote repository
|
||||||
try:
|
try:
|
||||||
cmd = ["hg", "clone", repo, output_dir]
|
cmd = ["hg", "clone", repo, output_dir]
|
||||||
cmd.extend(hg_config)
|
|
||||||
if ref is not None:
|
if ref is not None:
|
||||||
# don't update so the clone will include an empty working
|
# don't update so the clone will include an empty working
|
||||||
# directory, the given ref will be updated out later
|
# directory, the given ref will be updated out later
|
||||||
|
@ -55,7 +45,7 @@ class Mercurial(ContentProvider):
|
||||||
if ref is not None:
|
if ref is not None:
|
||||||
try:
|
try:
|
||||||
for line in execute_cmd(
|
for line in execute_cmd(
|
||||||
["hg", "update", "--clean", ref] + hg_config,
|
["hg", "update", "--clean", ref],
|
||||||
cwd=output_dir,
|
cwd=output_dir,
|
||||||
capture=yield_output,
|
capture=yield_output,
|
||||||
):
|
):
|
||||||
|
@ -67,7 +57,6 @@ class Mercurial(ContentProvider):
|
||||||
raise ValueError("Failed to update to ref {}".format(ref))
|
raise ValueError("Failed to update to ref {}".format(ref))
|
||||||
|
|
||||||
cmd = ["hg", "identify", "-i"]
|
cmd = ["hg", "identify", "-i"]
|
||||||
cmd.extend(hg_config)
|
|
||||||
sha1 = subprocess.Popen(cmd, stdout=subprocess.PIPE, cwd=output_dir)
|
sha1 = subprocess.Popen(cmd, stdout=subprocess.PIPE, cwd=output_dir)
|
||||||
self._node_id = sha1.stdout.read().decode().strip()
|
self._node_id = sha1.stdout.read().decode().strip()
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -55,8 +55,6 @@ setup(
|
||||||
"ruamel.yaml>=0.15",
|
"ruamel.yaml>=0.15",
|
||||||
"toml",
|
"toml",
|
||||||
"semver",
|
"semver",
|
||||||
"mercurial>=5.2",
|
|
||||||
"hg-evolve>=10.0",
|
|
||||||
],
|
],
|
||||||
python_requires=">=3.6",
|
python_requires=">=3.6",
|
||||||
author="Project Jupyter Contributors",
|
author="Project Jupyter Contributors",
|
||||||
|
|
Ładowanie…
Reference in New Issue