Skip to content

Commit 397695b

Browse files
authored
Merge pull request #539 from yuvipanda/v3.7
Bump default python version to 3.7
2 parents adfd8c4 + de36584 commit 397695b

File tree

19 files changed

+135
-90
lines changed

19 files changed

+135
-90
lines changed

docs/source/conf.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,19 @@ def setup(app):
8080
# built documents.
8181
#
8282
# The short X.Y version.
83-
version = '0.1'
83+
import repo2docker
84+
version = repo2docker.__version__
8485
# The full version, including alpha/beta/rc tags.
85-
release = '0.1'
86+
release = version
87+
88+
from repo2docker.buildpacks.conda import CondaBuildPack
89+
90+
default_python = CondaBuildPack.major_pythons['3']
91+
92+
rst_prolog = """
93+
.. |default_python| replace:: **Python {default_python}**
94+
.. |default_python_version| replace:: {default_python}
95+
""".format(default_python=default_python)
8696

8797
# The language for content autogenerated by Sphinx. Refer to documentation
8898
# for a list of supported languages.

docs/source/config_files.rst

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ Below is a list of supported configuration files (roughly in the order of build
2828
``environment.yml`` - Install a Python environment
2929
==================================================
3030

31-
``environment.yml`` is the standard configuration file used by Anaconda, conda,
32-
and miniconda that lets you install packages in the data analytics stack (it
33-
primarily installs Python packages, though can be used to install a range of
34-
non-Python packages as well).
31+
``environment.yml`` is the standard configuration file used by `conda <https://conda.io>`_
32+
that lets you install any kind of package,
33+
including Python, R, and C/C++ packages.
3534

3635
.. note::
3736

@@ -41,17 +40,19 @@ non-Python packages as well).
4140
file.
4241

4342
You can also specify which Python version to install in your built environment
44-
with ``environment.yml``. By default, ``repo2docker`` **installs
45-
Python 3.6** with your ``environment.yml`` unless you include the version of
46-
Python in the file. ``conda`` supports Python versions 3.6, 3.5, 3.4, and 2.7.
47-
``repo2docker`` support is best with Python 3.6, 3.5, and 2.7.
43+
with ``environment.yml``. By default, ``repo2docker`` installs
44+
|default_python| with your ``environment.yml`` unless you include the version of
45+
Python in this file. ``conda`` supports all versions of Python,
46+
though ``repo2docker`` support is best with Python 3.7, 3.6, 3.5 and 2.7.
4847

4948
.. warning::
5049
If you include a Python version in a ``runtime.txt`` file in addition to your
5150
``environment.yml``, your ``runtime.txt`` will be ignored.
5251

5352
.. _requirements.txt:
5453

54+
.. _requirements.txt:
55+
5556
``requirements.txt`` - Install a Python environment
5657
===================================================
5758

@@ -61,6 +62,8 @@ environment. Our
6162
on GitHub shows a typical requirements file.
6263

6364

65+
.. _setup.py:
66+
6467
``setup.py`` - Install Python packages
6568
======================================
6669

@@ -70,6 +73,8 @@ To install your repository like a Python package, you may include a
7073

7174
.. _REQUIRE:
7275

76+
.. _REQUIRE:
77+
7378
``REQUIRE`` - Install a Julia environment
7479
=========================================
7580

@@ -78,6 +83,8 @@ Julia repository with ``REQUIRE`` and ``environment.yml``,
7883
visit `binder-examples/julia-python <https://github.com/binder-examples/julia-python>`_.
7984

8085

86+
.. _install.R:
87+
8188
``install.R`` - Install an R/RStudio environment
8289
================================================
8390

@@ -87,6 +94,8 @@ To set the date of the snapshot add a runtime.txt_.
8794
For an example ``install.R`` file, visit our `example install.R file <https://github.com/binder-examples/r/blob/master/install.R>`_.
8895

8996

97+
.. _apt.txt:
98+
9099
``apt.txt`` - Install packages with apt-get
91100
===========================================
92101

@@ -97,6 +106,8 @@ We use ``apt.txt``, for example, to install LaTeX in our
97106
`example apt.txt for LaTeX <https://github.com/binder-examples/latex/blob/master/apt.txt>`_.
98107

99108

109+
.. _DESCRIPTION:
110+
100111
``DESCRIPTION`` - Install an R package
101112
======================================
102113

@@ -108,6 +119,9 @@ You also need to have a ``runtime.txt`` file that is formatted as
108119
``r-<YYYY>-<MM>-<DD>``, where YYYY-MM-DD is a snapshot of MRAN that will be
109120
used for your R installation.
110121

122+
123+
.. _manifest.xml:
124+
111125
``manifest.xml`` - Install Stencila
112126
===================================
113127

@@ -156,21 +170,29 @@ If you only need to run things once during the build phase use :ref:`postBuild`.
156170

157171

158172
.. TODO: Discuss runtime limits, best practices, etc.
159-
Also, point to an example.
160173
161174
.. _runtime.txt:
162175

163176
``runtime.txt`` - Specifying runtimes
164177
=====================================
165178

166-
This allows you to control the runtime of Python or R.
179+
Sometimes you want to specify the version of the runtime
180+
(e.g. the version of Python or R),
181+
but the environment specification format don't let you specify this information
182+
(e.g. requirements.txt or install.R).
183+
For these cases, we have a special file, ``runtime.txt``.
184+
185+
.. note::
186+
187+
``runtime.txt`` is only supported when used with environment specifications
188+
that do not already support specifying the runtime
189+
(e.g. when using ``environment.yml`` for conda or ``REQUIRE`` for Julia,
190+
``runtime.txt`` will be ignored).
167191

168192
To use python-2.7: add ``python-2.7`` in runtime.txt file.
169-
The repository will run in a virtualenv with
193+
The repository will run in an env with
170194
Python 2 installed. To see a full example repository, visit our
171195
`Python2 example <https://github.com/binder-examples/python2_runtime/blob/master/runtime.txt>`_.
172-
**Python versions in** ``runtime.txt`` **are ignored when** ``environment.yml`` **is
173-
present in the same folder**.
174196

175197
repo2docker uses R libraries pinned to a specific snapshot on
176198
`MRAN <https://mran.microsoft.com/documents/rro/reproducibility>`_.

docs/source/faq.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ and have found an answer, send a PR to add it here!
99
How should I specify another version of Python?
1010
-----------------------------------------------
1111

12-
One can specify a Python version in the ``environment.yml`` file of a repository.
12+
One can specify a Python version in the ``environment.yml`` file of a repository
13+
or ``runtime.txt`` file if using ``requirements.txt`` instead of ``environment.yml``.
1314

1415
What versions of Python (or R or Julia...) are supported?
1516
---------------------------------------------------------
@@ -21,8 +22,8 @@ Repo2docker officially supports the following versions of Python
2122
(specified in your :ref:`environment.yml <environment.yml>` or
2223
:ref:`runtime.txt <runtime.txt>` file):
2324

24-
- 3.7 (added in 0.7)
25-
- 3.6 (default)
25+
- 3.7 (added in 0.7, default in 0.8)
26+
- 3.6 (default in 0.7 and earlier)
2627
- 3.5
2728
- 2.7
2829

docs/source/howto/languages.rst

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,41 @@ you use one of the following configuration files:
1616
* ``requirements.txt``
1717
* ``environment.yml``
1818

19-
Note that by default, the environment will have **Python 3** installed.
19+
.. note::
2020

21-
Specifying a version of Python
22-
------------------------------
21+
By default, the environment will have |default_python|.
2322

24-
To specify a specific version of Python, you have two options:
23+
.. versionchanged:: 0.8
2524

26-
* Use ``runtime.txt``. Include a line that specifies the Python version in
27-
this file. This line takes the following form::
25+
Upgraded default Python from 3.6 to 3.7.
2826

29-
python=X.X
3027

31-
For example,::
28+
Specifying a version of Python
29+
------------------------------
30+
31+
To specify a specific version of Python, you have two options:
3232

33-
python=2.7
34-
* Use ``environment.yml``. The Anaconda distribution also lets you define
35-
the Python environment within ``environment.yml``. To do so, add ``python=X.X``
36-
to your dependencies section, like so::
33+
* Use :ref:`environment.yml <environment.yml>`. Conda environments let you define
34+
the Python version in ``environment.yml``.
35+
To do so, add ``python=X.X`` to your dependencies section, like so::
3736

3837
name: python 2.7
3938
dependencies:
4039
- python=2.7
4140
- numpy
4241

42+
* Use :ref:`runtime.txt <runtime.txt>` with :ref:`requirements.txt <requirements.txt>`.
43+
If you are using ``requirements.txt`` instead of ``environment.yml``,
44+
you can specify the Python runtime version in a separate file called ``runtime.txt``.
45+
This file contains a single line of the following form::
46+
47+
python-X.X
48+
49+
For example::
50+
51+
python-3.6
52+
53+
4354
The R Language
4455
==============
4556

repo2docker/buildpacks/conda/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def get_build_scripts(self):
7777

7878
major_pythons = {
7979
'2': '2.7',
80-
'3': '3.6',
80+
'3': '3.7',
8181
}
8282

8383
def get_build_script_files(self):

repo2docker/buildpacks/conda/environment.frozen.yml

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# AUTO GENERATED FROM environment.py-3.6.yml, DO NOT MANUALLY MODIFY
2-
# Frozen on 2019-01-30 18:42:13 UTC
1+
# AUTO GENERATED FROM environment.py-3.7.yml, DO NOT MANUALLY MODIFY
2+
# Frozen on 2019-02-11 20:26:36 UTC
33
name: r2d
44
channels:
55
- conda-forge
@@ -9,65 +9,66 @@ dependencies:
99
- attrs=18.2.0=py_0
1010
- backcall=0.1.0=py_0
1111
- bleach=3.1.0=py_0
12+
- bzip2=1.0.6=h14c3975_1002
1213
- ca-certificates=2018.11.29=ha4d7672_0
13-
- certifi=2018.11.29=py36_1000
14+
- certifi=2018.11.29=py37_1000
1415
- decorator=4.3.2=py_0
1516
- defusedxml=0.5.0=py_1
16-
- entrypoints=0.3=py36_1000
17+
- entrypoints=0.3=py37_1000
1718
- gmp=6.1.2=hf484d3e_1000
18-
- ipykernel=5.1.0=py36h24bf2e0_1002
19-
- ipython=7.2.0=py36h24bf2e0_1000
19+
- ipykernel=5.1.0=py37h24bf2e0_1002
20+
- ipython=7.2.0=py37h24bf2e0_1000
2021
- ipython_genutils=0.2.0=py_1
21-
- ipywidgets=7.2.1=py36_1
22-
- jedi=0.13.2=py36_1000
22+
- jedi=0.13.2=py37_1000
2323
- jinja2=2.10=py_1
24-
- jsonschema=3.0.0a3=py36_1000
24+
- jsonschema=3.0.0a3=py37_1000
2525
- jupyter_client=5.2.4=py_1
2626
- jupyter_core=4.4.0=py_0
27-
- jupyterlab=0.34.9=py36_0
2827
- jupyterlab_launcher=0.13.1=py_2
2928
- libffi=3.2.1=hf484d3e_1005
3029
- libgcc-ng=7.3.0=hdf63c60_0
3130
- libsodium=1.0.16=h14c3975_1001
3231
- libstdcxx-ng=7.3.0=hdf63c60_0
33-
- markupsafe=1.1.0=py36h14c3975_1000
34-
- mistune=0.8.4=py36h14c3975_1000
32+
- markupsafe=1.1.0=py37h14c3975_1000
33+
- mistune=0.8.4=py37h14c3975_1000
3534
- nbconvert=5.4.0=1
3635
- nbformat=4.4.0=py_1
3736
- ncurses=6.1=hf484d3e_1002
38-
- notebook=5.7.4=py36_1000
37+
- notebook=5.7.4=py37_1000
3938
- openssl=1.0.2p=h14c3975_1002
4039
- pandoc=1.19.2=0
4140
- pandocfilters=1.4.2=py_1
42-
- parso=0.3.2=py_0
43-
- pexpect=4.6.0=py36_1000
44-
- pickleshare=0.7.5=py36_1000
45-
- pip=19.0.1=py36_0
41+
- parso=0.3.3=py_0
42+
- pexpect=4.6.0=py37_1000
43+
- pickleshare=0.7.5=py37_1000
44+
- pip=19.0.2=py37_0
4645
- prometheus_client=0.5.0=py_0
4746
- prompt_toolkit=2.0.8=py_0
48-
- ptyprocess=0.6.0=py36_1000
47+
- ptyprocess=0.6.0=py37_1000
4948
- pygments=2.3.1=py_0
50-
- pyrsistent=0.14.9=py36h14c3975_1000
51-
- python=3.6.7=hd21baee_1001
52-
- python-dateutil=2.7.5=py_0
53-
- pyzmq=17.1.2=py36h6afc9c9_1001
49+
- pyrsistent=0.14.10=py37h14c3975_0
50+
- python=3.7.1=hd21baee_1000
51+
- python-dateutil=2.8.0=py_0
52+
- pyzmq=17.1.2=py37h6afc9c9_1001
5453
- readline=7.0=hf8c457e_1001
5554
- send2trash=1.5.0=py_0
56-
- setuptools=40.7.1=py36_0
57-
- six=1.12.0=py36_1000
55+
- setuptools=40.8.0=py37_0
56+
- six=1.12.0=py37_1000
5857
- sqlite=3.26.0=h67949de_1000
59-
- terminado=0.8.1=py36_1001
60-
- testpath=0.4.2=py36_1000
58+
- terminado=0.8.1=py37_1001
59+
- testpath=0.4.2=py37_1000
6160
- tk=8.6.9=h84994c4_1000
62-
- tornado=5.1.1=py36h14c3975_1000
63-
- traitlets=4.3.2=py36_1000
61+
- tornado=5.1.1=py37h14c3975_1000
62+
- traitlets=4.3.2=py37_1000
6463
- wcwidth=0.1.7=py_1
6564
- webencodings=0.5.1=py_1
66-
- wheel=0.32.3=py36_0
67-
- widgetsnbextension=3.2.1=py36_1
65+
- wheel=0.32.3=py37_0
66+
- widgetsnbextension=3.4.2=py37_1000
6867
- xz=5.2.4=h14c3975_1001
6968
- zeromq=4.2.5=hf484d3e_1006
7069
- zlib=1.2.11=h14c3975_1004
70+
- ipywidgets=7.2.1=py37_0
71+
- jupyterlab=0.34.9=py37_0
7172
- pip:
7273
- alembic==1.0.7
7374
- async-generator==1.10
@@ -77,7 +78,7 @@ dependencies:
7778
- mako==1.0.7
7879
- nteract-on-jupyter==2.0.0
7980
- pamela==1.0.0
80-
- python-editor==1.0.3
81+
- python-editor==1.0.4
8182
- python-oauth2==1.1.0
8283
- requests==2.21.0
8384
- sqlalchemy==1.2.17

repo2docker/buildpacks/conda/environment.py-2.7.frozen.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTO GENERATED FROM environment.py-2.7.yml, DO NOT MANUALLY MODIFY
2-
# Frozen on 2019-01-30 18:36:55 UTC
2+
# Frozen on 2019-02-11 20:20:33 UTC
33
name: r2d
44
channels:
55
- conda-forge
@@ -28,16 +28,16 @@ dependencies:
2828
- pathlib2=2.3.3=py27_1000
2929
- pexpect=4.6.0=py27_1000
3030
- pickleshare=0.7.5=py27_1000
31-
- pip=19.0.1=py27_0
31+
- pip=19.0.2=py27_0
3232
- prompt_toolkit=1.0.15=py_1
3333
- ptyprocess=0.6.0=py27_1000
3434
- pygments=2.3.1=py_0
3535
- python=2.7.15=h938d71a_1006
36-
- python-dateutil=2.7.5=py_0
36+
- python-dateutil=2.8.0=py_0
3737
- pyzmq=17.1.2=py27h6afc9c9_1001
3838
- readline=7.0=hf8c457e_1001
3939
- scandir=1.9.0=py27h14c3975_1000
40-
- setuptools=40.7.1=py27_0
40+
- setuptools=40.8.0=py27_0
4141
- simplegeneric=0.8.1=py_1
4242
- singledispatch=3.4.0.3=py27_1000
4343
- six=1.12.0=py27_1000

0 commit comments

Comments
 (0)