kopia lustrzana https://github.com/jupyterhub/repo2docker
Merge branch 'add/circleci' of github.com:vsoch/repo2docker into add/circleci
commit
07f8de0585
|
@ -20,8 +20,8 @@ repo2docker is called with this command::
|
||||||
|
|
||||||
where ``<URL-or-path to repo>`` is a URL or path to the source repository.
|
where ``<URL-or-path to repo>`` is a URL or path to the source repository.
|
||||||
|
|
||||||
For example, use the following to build an image of the
|
For example, use the following to build an image of Peter Norvig's
|
||||||
`Python Pytudes notebook <https://github.com/norvig/pytudes>`_::
|
`Pytudes <https://github.com/norvig/pytudes/>`_::
|
||||||
|
|
||||||
jupyter-repo2docker https://github.com/norvig/pytudes
|
jupyter-repo2docker https://github.com/norvig/pytudes
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ Python 3.6 unless you include the version of Python in your
|
||||||
Python 2.7, 3.5, and 3.6. In the case of this repo, a Python version is not
|
Python 2.7, 3.5, and 3.6. In the case of this repo, a Python version is not
|
||||||
specified in their configuation files and Python 3.6 is installed.
|
specified in their configuation files and Python 3.6 is installed.
|
||||||
|
|
||||||
`Python Pytudes Repository <https://github.com/norvig/pytudes>`_
|
`Pytudes <https://github.com/norvig/pytudes>`_
|
||||||
uses a `requirements.txt file <https://github.com/norvig/pytudes/blob/master/requirements.txt>`_
|
uses a `requirements.txt file <https://github.com/norvig/pytudes/blob/master/requirements.txt>`_
|
||||||
to specify its Python environment. ``repo2docker`` uses ``pip`` to install
|
to specify its Python environment. ``repo2docker`` uses ``pip`` to install
|
||||||
dependencies listed in the ``requirement.txt`` in the image. To learn more about
|
dependencies listed in the ``requirement.txt`` in the image. To learn more about
|
||||||
|
|
|
@ -217,6 +217,7 @@ class Repo2Docker(Application):
|
||||||
def get_argparser(self):
|
def get_argparser(self):
|
||||||
"""Get arguments that may be used by repo2docker"""
|
"""Get arguments that may be used by repo2docker"""
|
||||||
argparser = argparse.ArgumentParser()
|
argparser = argparse.ArgumentParser()
|
||||||
|
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
'--config',
|
'--config',
|
||||||
default='repo2docker_config.py',
|
default='repo2docker_config.py',
|
||||||
|
@ -342,6 +343,14 @@ class Repo2Docker(Application):
|
||||||
type=str,
|
type=str,
|
||||||
help=self.traits()['appendix'].help,
|
help=self.traits()['appendix'].help,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
argparser.add_argument(
|
||||||
|
'--version',
|
||||||
|
dest='version',
|
||||||
|
action='store_true',
|
||||||
|
help='Print the repo2docker version and exit.'
|
||||||
|
)
|
||||||
|
|
||||||
return argparser
|
return argparser
|
||||||
|
|
||||||
def json_excepthook(self, etype, evalue, traceback):
|
def json_excepthook(self, etype, evalue, traceback):
|
||||||
|
@ -357,6 +366,13 @@ class Repo2Docker(Application):
|
||||||
"""Init repo2docker configuration before start"""
|
"""Init repo2docker configuration before start"""
|
||||||
if argv is None:
|
if argv is None:
|
||||||
argv = sys.argv[1:]
|
argv = sys.argv[1:]
|
||||||
|
|
||||||
|
# version must be checked before parse, as repo/cmd are required and
|
||||||
|
# will spit out an error if allowed to be parsed first.
|
||||||
|
if '--version' in argv:
|
||||||
|
print(self.version)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
args = self.get_argparser().parse_args(argv)
|
args = self.get_argparser().parse_args(argv)
|
||||||
|
|
||||||
if args.debug:
|
if args.debug:
|
||||||
|
|
|
@ -5,7 +5,7 @@ import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from traitlets import Integer
|
from traitlets import Integer, TraitError
|
||||||
|
|
||||||
|
|
||||||
def execute_cmd(cmd, capture=False, **kwargs):
|
def execute_cmd(cmd, capture=False, **kwargs):
|
||||||
|
|
Ładowanie…
Reference in New Issue