diff --git a/docs/source/conf.py b/docs/source/conf.py index 31384737..db48d094 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -80,9 +80,19 @@ author = 'Project Jupyter' # built documents. # # The short X.Y version. -version = '0.1' +import repo2docker +version = repo2docker.__version__ # The full version, including alpha/beta/rc tags. -release = '0.1' +release = version + +from repo2docker.buildpacks.conda import CondaBuildPack + +default_python = CondaBuildPack.major_pythons['3'] + +rst_prolog = """ +.. |default_python| replace:: **Python {default_python}** +.. |default_python_version| replace:: {default_python} +""".format(default_python=default_python) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/config_files.rst b/docs/source/config_files.rst index 1465742d..3e80a363 100644 --- a/docs/source/config_files.rst +++ b/docs/source/config_files.rst @@ -28,10 +28,9 @@ Below is a list of supported configuration files (roughly in the order of build ``environment.yml`` - Install a Python environment ================================================== -``environment.yml`` is the standard configuration file used by Anaconda, conda, -and miniconda that lets you install packages in the data analytics stack (it -primarily installs Python packages, though can be used to install a range of -non-Python packages as well). +``environment.yml`` is the standard configuration file used by `conda `_ +that lets you install any kind of package, +including Python, R, and C/C++ packages. .. note:: @@ -41,10 +40,10 @@ non-Python packages as well). file. You can also specify which Python version to install in your built environment -with ``environment.yml``. By default, ``repo2docker`` **installs -Python 3.6** with your ``environment.yml`` unless you include the version of -Python in the file. ``conda`` supports Python versions 3.6, 3.5, 3.4, and 2.7. -``repo2docker`` support is best with Python 3.6, 3.5, and 2.7. +with ``environment.yml``. By default, ``repo2docker`` installs +|default_python| with your ``environment.yml`` unless you include the version of +Python in this file. ``conda`` supports all versions of Python, +though ``repo2docker`` support is best with Python 3.7, 3.6, 3.5 and 2.7. .. warning:: If you include a Python version in a ``runtime.txt`` file in addition to your @@ -52,6 +51,8 @@ Python in the file. ``conda`` supports Python versions 3.6, 3.5, 3.4, and 2.7. .. _requirements.txt: +.. _requirements.txt: + ``requirements.txt`` - Install a Python environment =================================================== @@ -61,6 +62,8 @@ environment. Our on GitHub shows a typical requirements file. +.. _setup.py: + ``setup.py`` - Install Python packages ====================================== @@ -70,6 +73,8 @@ To install your repository like a Python package, you may include a .. _REQUIRE: +.. _REQUIRE: + ``REQUIRE`` - Install a Julia environment ========================================= @@ -78,6 +83,8 @@ Julia repository with ``REQUIRE`` and ``environment.yml``, visit `binder-examples/julia-python `_. +.. _install.R: + ``install.R`` - Install an R/RStudio environment ================================================ @@ -87,6 +94,8 @@ To set the date of the snapshot add a runtime.txt_. For an example ``install.R`` file, visit our `example install.R file `_. +.. _apt.txt: + ``apt.txt`` - Install packages with apt-get =========================================== @@ -97,6 +106,8 @@ We use ``apt.txt``, for example, to install LaTeX in our `example apt.txt for LaTeX `_. +.. _DESCRIPTION: + ``DESCRIPTION`` - Install an R package ====================================== @@ -108,6 +119,9 @@ You also need to have a ``runtime.txt`` file that is formatted as ``r---
``, where YYYY-MM-DD is a snapshot of MRAN that will be used for your R installation. + +.. _manifest.xml: + ``manifest.xml`` - Install Stencila =================================== @@ -156,21 +170,29 @@ If you only need to run things once during the build phase use :ref:`postBuild`. .. TODO: Discuss runtime limits, best practices, etc. - Also, point to an example. .. _runtime.txt: ``runtime.txt`` - Specifying runtimes ===================================== -This allows you to control the runtime of Python or R. +Sometimes you want to specify the version of the runtime +(e.g. the version of Python or R), +but the environment specification format don't let you specify this information +(e.g. requirements.txt or install.R). +For these cases, we have a special file, ``runtime.txt``. + +.. note:: + + ``runtime.txt`` is only supported when used with environment specifications + that do not already support specifying the runtime + (e.g. when using ``environment.yml`` for conda or ``REQUIRE`` for Julia, + ``runtime.txt`` will be ignored). To use python-2.7: add ``python-2.7`` in runtime.txt file. -The repository will run in a virtualenv with +The repository will run in an env with Python 2 installed. To see a full example repository, visit our `Python2 example `_. -**Python versions in** ``runtime.txt`` **are ignored when** ``environment.yml`` **is -present in the same folder**. repo2docker uses R libraries pinned to a specific snapshot on `MRAN `_. diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 7919eeb3..9fbfcfbb 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -9,7 +9,8 @@ and have found an answer, send a PR to add it here! How should I specify another version of Python? ----------------------------------------------- -One can specify a Python version in the ``environment.yml`` file of a repository. +One can specify a Python version in the ``environment.yml`` file of a repository +or ``runtime.txt`` file if using ``requirements.txt`` instead of ``environment.yml``. What versions of Python (or R or Julia...) are supported? --------------------------------------------------------- @@ -21,8 +22,8 @@ Repo2docker officially supports the following versions of Python (specified in your :ref:`environment.yml ` or :ref:`runtime.txt ` file): -- 3.7 (added in 0.7) -- 3.6 (default) +- 3.7 (added in 0.7, default in 0.8) +- 3.6 (default in 0.7 and earlier) - 3.5 - 2.7 diff --git a/docs/source/howto/languages.rst b/docs/source/howto/languages.rst index a71ec96f..7fa3bafb 100644 --- a/docs/source/howto/languages.rst +++ b/docs/source/howto/languages.rst @@ -16,30 +16,41 @@ you use one of the following configuration files: * ``requirements.txt`` * ``environment.yml`` -Note that by default, the environment will have **Python 3** installed. +.. note:: + + By default, the environment will have |default_python|. + +.. versionchanged:: 0.8 + + Upgraded default Python from 3.6 to 3.7. + Specifying a version of Python ------------------------------ To specify a specific version of Python, you have two options: -* Use ``runtime.txt``. Include a line that specifies the Python version in - this file. This line takes the following form:: - - python=X.X - - For example,:: - - python=2.7 -* Use ``environment.yml``. The Anaconda distribution also lets you define - the Python environment within ``environment.yml``. To do so, add ``python=X.X`` - to your dependencies section, like so:: +* Use :ref:`environment.yml `. Conda environments let you define + the Python version in ``environment.yml``. + To do so, add ``python=X.X`` to your dependencies section, like so:: name: python 2.7 dependencies: - python=2.7 - numpy +* Use :ref:`runtime.txt ` with :ref:`requirements.txt `. + If you are using ``requirements.txt`` instead of ``environment.yml``, + you can specify the Python runtime version in a separate file called ``runtime.txt``. + This file contains a single line of the following form:: + + python-X.X + + For example:: + + python-3.6 + + The R Language ============== diff --git a/repo2docker/buildpacks/conda/__init__.py b/repo2docker/buildpacks/conda/__init__.py index 38ac92ff..69a28be5 100644 --- a/repo2docker/buildpacks/conda/__init__.py +++ b/repo2docker/buildpacks/conda/__init__.py @@ -77,7 +77,7 @@ class CondaBuildPack(BaseImage): major_pythons = { '2': '2.7', - '3': '3.6', + '3': '3.7', } def get_build_script_files(self): diff --git a/repo2docker/buildpacks/conda/environment.frozen.yml b/repo2docker/buildpacks/conda/environment.frozen.yml index 506424f3..df1d8306 100644 --- a/repo2docker/buildpacks/conda/environment.frozen.yml +++ b/repo2docker/buildpacks/conda/environment.frozen.yml @@ -1,5 +1,5 @@ -# AUTO GENERATED FROM environment.py-3.6.yml, DO NOT MANUALLY MODIFY -# Frozen on 2019-01-30 18:42:13 UTC +# AUTO GENERATED FROM environment.py-3.7.yml, DO NOT MANUALLY MODIFY +# Frozen on 2019-02-11 20:26:36 UTC name: r2d channels: - conda-forge @@ -9,65 +9,66 @@ dependencies: - attrs=18.2.0=py_0 - backcall=0.1.0=py_0 - bleach=3.1.0=py_0 + - bzip2=1.0.6=h14c3975_1002 - ca-certificates=2018.11.29=ha4d7672_0 - - certifi=2018.11.29=py36_1000 + - certifi=2018.11.29=py37_1000 - decorator=4.3.2=py_0 - defusedxml=0.5.0=py_1 - - entrypoints=0.3=py36_1000 + - entrypoints=0.3=py37_1000 - gmp=6.1.2=hf484d3e_1000 - - ipykernel=5.1.0=py36h24bf2e0_1002 - - ipython=7.2.0=py36h24bf2e0_1000 + - ipykernel=5.1.0=py37h24bf2e0_1002 + - ipython=7.2.0=py37h24bf2e0_1000 - ipython_genutils=0.2.0=py_1 - - ipywidgets=7.2.1=py36_1 - - jedi=0.13.2=py36_1000 + - jedi=0.13.2=py37_1000 - jinja2=2.10=py_1 - - jsonschema=3.0.0a3=py36_1000 + - jsonschema=3.0.0a3=py37_1000 - jupyter_client=5.2.4=py_1 - jupyter_core=4.4.0=py_0 - - jupyterlab=0.34.9=py36_0 - jupyterlab_launcher=0.13.1=py_2 - libffi=3.2.1=hf484d3e_1005 - libgcc-ng=7.3.0=hdf63c60_0 - libsodium=1.0.16=h14c3975_1001 - libstdcxx-ng=7.3.0=hdf63c60_0 - - markupsafe=1.1.0=py36h14c3975_1000 - - mistune=0.8.4=py36h14c3975_1000 + - markupsafe=1.1.0=py37h14c3975_1000 + - mistune=0.8.4=py37h14c3975_1000 - nbconvert=5.4.0=1 - nbformat=4.4.0=py_1 - ncurses=6.1=hf484d3e_1002 - - notebook=5.7.4=py36_1000 + - notebook=5.7.4=py37_1000 - openssl=1.0.2p=h14c3975_1002 - pandoc=1.19.2=0 - pandocfilters=1.4.2=py_1 - - parso=0.3.2=py_0 - - pexpect=4.6.0=py36_1000 - - pickleshare=0.7.5=py36_1000 - - pip=19.0.1=py36_0 + - parso=0.3.3=py_0 + - pexpect=4.6.0=py37_1000 + - pickleshare=0.7.5=py37_1000 + - pip=19.0.2=py37_0 - prometheus_client=0.5.0=py_0 - prompt_toolkit=2.0.8=py_0 - - ptyprocess=0.6.0=py36_1000 + - ptyprocess=0.6.0=py37_1000 - pygments=2.3.1=py_0 - - pyrsistent=0.14.9=py36h14c3975_1000 - - python=3.6.7=hd21baee_1001 - - python-dateutil=2.7.5=py_0 - - pyzmq=17.1.2=py36h6afc9c9_1001 + - pyrsistent=0.14.10=py37h14c3975_0 + - python=3.7.1=hd21baee_1000 + - python-dateutil=2.8.0=py_0 + - pyzmq=17.1.2=py37h6afc9c9_1001 - readline=7.0=hf8c457e_1001 - send2trash=1.5.0=py_0 - - setuptools=40.7.1=py36_0 - - six=1.12.0=py36_1000 + - setuptools=40.8.0=py37_0 + - six=1.12.0=py37_1000 - sqlite=3.26.0=h67949de_1000 - - terminado=0.8.1=py36_1001 - - testpath=0.4.2=py36_1000 + - terminado=0.8.1=py37_1001 + - testpath=0.4.2=py37_1000 - tk=8.6.9=h84994c4_1000 - - tornado=5.1.1=py36h14c3975_1000 - - traitlets=4.3.2=py36_1000 + - tornado=5.1.1=py37h14c3975_1000 + - traitlets=4.3.2=py37_1000 - wcwidth=0.1.7=py_1 - webencodings=0.5.1=py_1 - - wheel=0.32.3=py36_0 - - widgetsnbextension=3.2.1=py36_1 + - wheel=0.32.3=py37_0 + - widgetsnbextension=3.4.2=py37_1000 - xz=5.2.4=h14c3975_1001 - zeromq=4.2.5=hf484d3e_1006 - zlib=1.2.11=h14c3975_1004 + - ipywidgets=7.2.1=py37_0 + - jupyterlab=0.34.9=py37_0 - pip: - alembic==1.0.7 - async-generator==1.10 @@ -77,7 +78,7 @@ dependencies: - mako==1.0.7 - nteract-on-jupyter==2.0.0 - pamela==1.0.0 - - python-editor==1.0.3 + - python-editor==1.0.4 - python-oauth2==1.1.0 - requests==2.21.0 - sqlalchemy==1.2.17 diff --git a/repo2docker/buildpacks/conda/environment.py-2.7.frozen.yml b/repo2docker/buildpacks/conda/environment.py-2.7.frozen.yml index e10f7380..ffc95300 100644 --- a/repo2docker/buildpacks/conda/environment.py-2.7.frozen.yml +++ b/repo2docker/buildpacks/conda/environment.py-2.7.frozen.yml @@ -1,5 +1,5 @@ # AUTO GENERATED FROM environment.py-2.7.yml, DO NOT MANUALLY MODIFY -# Frozen on 2019-01-30 18:36:55 UTC +# Frozen on 2019-02-11 20:20:33 UTC name: r2d channels: - conda-forge @@ -28,16 +28,16 @@ dependencies: - pathlib2=2.3.3=py27_1000 - pexpect=4.6.0=py27_1000 - pickleshare=0.7.5=py27_1000 - - pip=19.0.1=py27_0 + - pip=19.0.2=py27_0 - prompt_toolkit=1.0.15=py_1 - ptyprocess=0.6.0=py27_1000 - pygments=2.3.1=py_0 - python=2.7.15=h938d71a_1006 - - python-dateutil=2.7.5=py_0 + - python-dateutil=2.8.0=py_0 - pyzmq=17.1.2=py27h6afc9c9_1001 - readline=7.0=hf8c457e_1001 - scandir=1.9.0=py27h14c3975_1000 - - setuptools=40.7.1=py27_0 + - setuptools=40.8.0=py27_0 - simplegeneric=0.8.1=py_1 - singledispatch=3.4.0.3=py27_1000 - six=1.12.0=py27_1000 diff --git a/repo2docker/buildpacks/conda/environment.py-3.6.frozen.yml b/repo2docker/buildpacks/conda/environment.py-3.6.frozen.yml index 506424f3..65f724c8 100644 --- a/repo2docker/buildpacks/conda/environment.py-3.6.frozen.yml +++ b/repo2docker/buildpacks/conda/environment.py-3.6.frozen.yml @@ -1,5 +1,5 @@ # AUTO GENERATED FROM environment.py-3.6.yml, DO NOT MANUALLY MODIFY -# Frozen on 2019-01-30 18:42:13 UTC +# Frozen on 2019-02-11 20:22:50 UTC name: r2d channels: - conda-forge @@ -39,21 +39,21 @@ dependencies: - openssl=1.0.2p=h14c3975_1002 - pandoc=1.19.2=0 - pandocfilters=1.4.2=py_1 - - parso=0.3.2=py_0 + - parso=0.3.3=py_0 - pexpect=4.6.0=py36_1000 - pickleshare=0.7.5=py36_1000 - - pip=19.0.1=py36_0 + - pip=19.0.2=py36_0 - prometheus_client=0.5.0=py_0 - prompt_toolkit=2.0.8=py_0 - ptyprocess=0.6.0=py36_1000 - pygments=2.3.1=py_0 - - pyrsistent=0.14.9=py36h14c3975_1000 + - pyrsistent=0.14.10=py36h14c3975_0 - python=3.6.7=hd21baee_1001 - - python-dateutil=2.7.5=py_0 + - python-dateutil=2.8.0=py_0 - pyzmq=17.1.2=py36h6afc9c9_1001 - readline=7.0=hf8c457e_1001 - send2trash=1.5.0=py_0 - - setuptools=40.7.1=py36_0 + - setuptools=40.8.0=py36_0 - six=1.12.0=py36_1000 - sqlite=3.26.0=h67949de_1000 - terminado=0.8.1=py36_1001 @@ -77,7 +77,7 @@ dependencies: - mako==1.0.7 - nteract-on-jupyter==2.0.0 - pamela==1.0.0 - - python-editor==1.0.3 + - python-editor==1.0.4 - python-oauth2==1.1.0 - requests==2.21.0 - sqlalchemy==1.2.17 diff --git a/repo2docker/buildpacks/conda/environment.py-3.6.yml b/repo2docker/buildpacks/conda/environment.py-3.6.yml index bf38bad9..e7e92399 100644 --- a/repo2docker/buildpacks/conda/environment.py-3.6.yml +++ b/repo2docker/buildpacks/conda/environment.py-3.6.yml @@ -1,5 +1,5 @@ # AUTO GENERATED FROM environment.yml, DO NOT MANUALLY MODIFY -# Generated on 2019-01-30 18:42:13 UTC +# Generated on 2019-02-11 20:22:50 UTC dependencies: - python=3.6.* - ipywidgets==7.2.1 diff --git a/repo2docker/buildpacks/conda/environment.py-3.7.frozen.yml b/repo2docker/buildpacks/conda/environment.py-3.7.frozen.yml index db73da67..df1d8306 100644 --- a/repo2docker/buildpacks/conda/environment.py-3.7.frozen.yml +++ b/repo2docker/buildpacks/conda/environment.py-3.7.frozen.yml @@ -1,5 +1,5 @@ # AUTO GENERATED FROM environment.py-3.7.yml, DO NOT MANUALLY MODIFY -# Frozen on 2019-01-30 18:38:58 UTC +# Frozen on 2019-02-11 20:26:36 UTC name: r2d channels: - conda-forge @@ -38,21 +38,21 @@ dependencies: - openssl=1.0.2p=h14c3975_1002 - pandoc=1.19.2=0 - pandocfilters=1.4.2=py_1 - - parso=0.3.2=py_0 + - parso=0.3.3=py_0 - pexpect=4.6.0=py37_1000 - pickleshare=0.7.5=py37_1000 - - pip=19.0.1=py37_0 + - pip=19.0.2=py37_0 - prometheus_client=0.5.0=py_0 - prompt_toolkit=2.0.8=py_0 - ptyprocess=0.6.0=py37_1000 - pygments=2.3.1=py_0 - - pyrsistent=0.14.9=py37h14c3975_1000 + - pyrsistent=0.14.10=py37h14c3975_0 - python=3.7.1=hd21baee_1000 - - python-dateutil=2.7.5=py_0 + - python-dateutil=2.8.0=py_0 - pyzmq=17.1.2=py37h6afc9c9_1001 - readline=7.0=hf8c457e_1001 - send2trash=1.5.0=py_0 - - setuptools=40.7.1=py37_0 + - setuptools=40.8.0=py37_0 - six=1.12.0=py37_1000 - sqlite=3.26.0=h67949de_1000 - terminado=0.8.1=py37_1001 @@ -78,7 +78,7 @@ dependencies: - mako==1.0.7 - nteract-on-jupyter==2.0.0 - pamela==1.0.0 - - python-editor==1.0.3 + - python-editor==1.0.4 - python-oauth2==1.1.0 - requests==2.21.0 - sqlalchemy==1.2.17 diff --git a/repo2docker/buildpacks/conda/environment.py-3.7.yml b/repo2docker/buildpacks/conda/environment.py-3.7.yml index 522453a4..ef664280 100644 --- a/repo2docker/buildpacks/conda/environment.py-3.7.yml +++ b/repo2docker/buildpacks/conda/environment.py-3.7.yml @@ -1,5 +1,5 @@ # AUTO GENERATED FROM environment.yml, DO NOT MANUALLY MODIFY -# Generated on 2019-01-30 18:38:58 UTC +# Generated on 2019-02-11 20:26:36 UTC dependencies: - python=3.7.* - ipywidgets==7.2.1 diff --git a/repo2docker/buildpacks/conda/environment.yml b/repo2docker/buildpacks/conda/environment.yml index e58aa0f5..88ecadc1 100644 --- a/repo2docker/buildpacks/conda/environment.yml +++ b/repo2docker/buildpacks/conda/environment.yml @@ -1,5 +1,5 @@ dependencies: - - python=3.6.* + - python=3.7.* - ipywidgets==7.2.1 - jupyterlab==0.34.9 - nbconvert==5.4.0 diff --git a/repo2docker/buildpacks/conda/freeze.py b/repo2docker/buildpacks/conda/freeze.py index 2a0254d3..904ff4fb 100755 --- a/repo2docker/buildpacks/conda/freeze.py +++ b/repo2docker/buildpacks/conda/freeze.py @@ -107,7 +107,7 @@ def set_python(py_env_file, py): if __name__ == '__main__': # allow specifying which Pythons to update on argv - pys = sys.argv[1:] or ('2.7', '3.7', '3.5', '3.6') + pys = sys.argv[1:] or ('2.7', '3.5', '3.6', '3.7') for py in pys: env_file = ENV_FILE_T.format(py=py) set_python(env_file, py) diff --git a/tests/conda/requirements/verify b/tests/conda/requirements/verify index 09dcf196..cc4152b7 100755 --- a/tests/conda/requirements/verify +++ b/tests/conda/requirements/verify @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -assert sys.version_info[:2] == (3, 6), sys.version +assert sys.version_info[:2] == (3, 7), sys.version import numpy try: diff --git a/tests/conda/simple-py2/verify b/tests/conda/simple-py2/verify index 57f75c5e..a6adf3c3 100755 --- a/tests/conda/simple-py2/verify +++ b/tests/conda/simple-py2/verify @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -assert sys.version_info[:2] == (3, 6), sys.version +assert sys.version_info[:2] == (3, 7), sys.version # verify that we have Python 2 and Python 3 kernelspecs from jupyter_client.kernelspec import KernelSpecManager diff --git a/tests/conda/simple/verify b/tests/conda/simple/verify index 2269714c..54d39472 100755 --- a/tests/conda/simple/verify +++ b/tests/conda/simple/verify @@ -1,6 +1,6 @@ #!/usr/bin/env python import sys -assert sys.version_info[:2] == (3, 6), sys.version +assert sys.version_info[:2] == (3, 7), sys.version import numpy diff --git a/tests/external/reproductions.repos.yaml b/tests/external/reproductions.repos.yaml index b434d229..6ba3f5a7 100644 --- a/tests/external/reproductions.repos.yaml +++ b/tests/external/reproductions.repos.yaml @@ -22,7 +22,7 @@ # Test that tags work + ref is added to tag if not present - name: Binder Examples - Requirements url: https://github.com/binder-examples/requirements - ref: test + ref: python-3.7 verify: python -c 'import matplotlib' # Test that custom channels and downgrades don't # get blocked by pinning diff --git a/tests/venv/default/verify b/tests/venv/default/verify index 3be5a216..0d65593d 100755 --- a/tests/venv/default/verify +++ b/tests/venv/default/verify @@ -2,7 +2,7 @@ # Verify that the default just provides a py3 environment with jupyter import sys -assert sys.version_info[:2] == (3, 6), sys.version +assert sys.version_info[:2] == (3, 7), sys.version import jupyter with open('/tmp/appendix') as f: diff --git a/tests/venv/numpy/verify b/tests/venv/numpy/verify index 4ad54bfd..34769ecb 100755 --- a/tests/venv/numpy/verify +++ b/tests/venv/numpy/verify @@ -1,6 +1,6 @@ #!/usr/bin/env python import sys -assert sys.version_info[:2] == (3, 6) +assert sys.version_info[:2] == (3, 7) import numpy