Skip to content

Commit 852eb83

Browse files
authored
Merge pull request #174 from readthedocs/humitos/py310b-miniconda3-4.9.2
2 parents 048fc78 + d6d0247 commit 852eb83

File tree

6 files changed

+81
-43
lines changed

6 files changed

+81
-43
lines changed

.circleci/config.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
3+
jobs:
4+
tests:
5+
docker:
6+
- image: circleci/python:3.6
7+
environment:
8+
PIPENV_VENV_IN_PROJECT=1
9+
PIPENV_IGNORE_VIRTUALENVS=1
10+
steps:
11+
- checkout
12+
- setup_remote_docker:
13+
version: 20.10.6
14+
docker_layer_caching: true
15+
- run:
16+
name: Setup
17+
command: |
18+
pip install pipenv
19+
pipenv install
20+
- run:
21+
name: Build Docker image
22+
command: docker build -t readthedocs/build:7.0 .
23+
- run:
24+
name: Run tests
25+
command: pipenv run pytest -m image_70
26+
27+
workflows:
28+
version: 2
29+
tests:
30+
jobs:
31+
- tests

.travis.yml

-23
This file was deleted.

Dockerfile

+35-13
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@ ENV PYTHON_VERSION_36 3.6.12
1414
ENV PYTHON_VERSION_37 3.7.9
1515
ENV PYTHON_VERSION_38 3.8.6
1616
ENV PYTHON_VERSION_39 3.9.1
17+
ENV PYTHON_VERSION_310 3.10.0b4
1718
ENV PYPY_VERSION_35 pypy3.5-7.0.0
18-
# Note: 4.7.12.1 drastically increases memory usage
19-
ENV CONDA_VERSION 4.6.14
19+
# Latest miniconda version is Miniconda3-py39_4.10.1, but it's not available for x86_64
20+
ENV CONDA_PYTHON_VERSION py39
21+
ENV CONDA_VERSION 4.9.2
2022
LABEL python.version_27=$PYTHON_VERSION_27
2123
LABEL python.version_35=$PYTHON_VERSION_35
2224
LABEL python.version_36=$PYTHON_VERSION_36
2325
LABEL python.version_37=$PYTHON_VERSION_37
2426
LABEL python.version_38=$PYTHON_VERSION_38
2527
LABEL python.version_39=$PYTHON_VERSION_39
28+
LABEL python.version_310=$PYTHON_VERSION_310
2629
LABEL pypy.version_35=$PYPY_VERSION_35
2730
LABEL conda.version=$CONDA_VERSION
31+
LABEL conda.python_version=$CONDA_PYTHON_VERSION
2832

2933
# System dependencies
3034
RUN apt-get -y update
@@ -75,6 +79,7 @@ RUN apt-get install -y \
7579
libncurses5-dev \
7680
libncursesw5-dev \
7781
libssl-dev \
82+
libxmlsec1-dev \
7883
llvm \
7984
make \
8085
python-openssl \
@@ -141,14 +146,6 @@ RUN apt-get -y install \
141146
auxlib \
142147
virtualenv==$RTD_VIRTUALENV_VERSION
143148

144-
# sphinx-js dependencies: jsdoc and typedoc (TypeScript support)
145-
RUN apt-get -y install \
146-
nodejs \
147-
npm \
148-
&& npm install --global \
149-
jsdoc \
150-
typedoc
151-
152149
# UID and GID from readthedocs/user
153150
RUN groupadd --gid 205 docs
154151
RUN useradd -m --uid 1005 --gid 205 docs
@@ -157,10 +154,10 @@ USER docs
157154
WORKDIR /home/docs
158155

159156
# Install Conda
160-
RUN curl -L -O https://repo.continuum.io/miniconda/Miniconda2-${CONDA_VERSION}-Linux-x86_64.sh
161-
RUN bash Miniconda2-${CONDA_VERSION}-Linux-x86_64.sh -b -p /home/docs/.conda/
157+
RUN curl -L -O https://repo.continuum.io/miniconda/Miniconda3-${CONDA_PYTHON_VERSION}_${CONDA_VERSION}-Linux-x86_64.sh && \
158+
bash Miniconda3-${CONDA_PYTHON_VERSION}_${CONDA_VERSION}-Linux-x86_64.sh -b -p /home/docs/.conda/ && \
159+
rm -f Miniconda3-${CONDA_PYTHON_VERSION}_${CONDA_VERSION}-Linux-x86_64.sh
162160
ENV PATH $PATH:/home/docs/.conda/bin
163-
RUN rm -f Miniconda2-${CONDA_VERSION}-Linux-x86_64.sh
164161

165162
# Install Rust
166163
ENV RTD_RUST_VERSION 1.46.0
@@ -177,6 +174,7 @@ ENV PATH /home/docs/.pyenv/shims:$PATH:/home/docs/.pyenv/bin
177174

178175
# Install supported Python versions
179176
RUN pyenv install $PYTHON_VERSION_27 && \
177+
pyenv install $PYTHON_VERSION_310 && \
180178
pyenv install $PYTHON_VERSION_39 && \
181179
pyenv install $PYTHON_VERSION_38 && \
182180
pyenv install $PYTHON_VERSION_37 && \
@@ -185,6 +183,7 @@ RUN pyenv install $PYTHON_VERSION_27 && \
185183
pyenv install $PYPY_VERSION_35 && \
186184
pyenv global \
187185
$PYTHON_VERSION_27 \
186+
$PYTHON_VERSION_310 \
188187
$PYTHON_VERSION_39 \
189188
$PYTHON_VERSION_38 \
190189
$PYTHON_VERSION_37 \
@@ -202,6 +201,13 @@ RUN pyenv local $PYTHON_VERSION_27 && \
202201

203202
ENV RTD_PIP_VERSION 20.0.2
204203
ENV RTD_SETUPTOOLS_VERSION 45.2.0
204+
205+
# NOTE: numpy is not installed by default because it's not built for Python 3.10 yet
206+
RUN pyenv local $PYTHON_VERSION_310 && \
207+
pyenv exec pip install --no-cache-dir -U pip==$RTD_PIP_VERSION && \
208+
pyenv exec pip install --no-cache-dir -U setuptools==$RTD_SETUPTOOLS_VERSION && \
209+
pyenv exec pip install --no-cache-dir virtualenv==$RTD_VIRTUALENV_VERSION
210+
205211
RUN pyenv local $PYTHON_VERSION_39 && \
206212
pyenv exec pip install --no-cache-dir -U pip==$RTD_PIP_VERSION && \
207213
pyenv exec pip install --no-cache-dir -U setuptools==$RTD_SETUPTOOLS_VERSION && \
@@ -238,6 +244,22 @@ RUN pyenv local $PYPY_VERSION_35 && \
238244
pyenv exec pip install --no-cache-dir -U setuptools==$RTD_SETUPTOOLS_VERSION && \
239245
pyenv exec pip install --no-cache-dir virtualenv==$RTD_VIRTUALENV_VERSION
240246

247+
# NOTE: this is moved to the bottom because apt-get finds some incompatibilities
248+
# between packages and uninstall them:
249+
# The following packages will be REMOVED:
250+
# libmysqlclient-dev libssl-dev libxmlsec1-dev
251+
# As libssl-dev and libxmlsec1-dev are required to build Python with pyenv,
252+
# we first build Python versions and then install these packages
253+
# sphinx-js dependencies: jsdoc and typedoc (TypeScript support)
254+
USER root
255+
RUN apt-get -y install \
256+
nodejs \
257+
npm \
258+
&& npm install --global \
259+
260+
261+
262+
USER docs
241263
WORKDIR /
242264

243265
CMD ["/bin/bash"]

tests/test_dependencies.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ def test_miniconda():
1414
base_url = 'https://repo.continuum.io/miniconda'
1515
dockerfile = get_dockerfile()
1616
conda_version = dockerfile.envs.get('CONDA_VERSION')
17+
conda_python_version = dockerfile.envs.get('CONDA_PYTHON_VERSION')
1718
latest = requests.head(
18-
'{base}/Miniconda2-latest-Linux-x86_64.sh'.format(
19+
'{base}/Miniconda3-latest-Linux-x86_64.sh'.format(
1920
base=base_url
2021
)
2122
)
2223
current = requests.head(
23-
'{base}/Miniconda2-{version}-Linux-x86_64.sh'.format(
24+
'{base}/Miniconda3-{conda_python_version}_{conda_version}-Linux-x86_64.sh'.format(
2425
base=base_url,
25-
version=conda_version,
26+
conda_python_version=conda_python_version,
27+
conda_version=conda_version,
2628
)
2729
)
2830
assert current.headers['etag'] == latest.headers['etag']

tests/test_versions.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
from docker import APIClient
32

43
from .utils import run_command_in_container
54

@@ -57,6 +56,7 @@ def test_command_versions_image_master(command, expected_output):
5756
('python3.7 --version', 'Python 3.7.9'),
5857
('python3.8 --version', 'Python 3.8.6'),
5958
('python3.9 --version', 'Python 3.9.1'),
59+
('python3.10 --version', 'Python 3.10.0b4'),
6060
('pypy3.5 --version', 'Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)\n[PyPy 7.0.0 with GCC 8.2.0]'),
6161
# pip
6262
('python2 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/2.7.18/lib/python2.7/site-packages/pip (python 2.7)"),
@@ -65,26 +65,31 @@ def test_command_versions_image_master(command, expected_output):
6565
('python3.7 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/pip (python 3.7)"),
6666
('python3.8 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.8.6/lib/python3.8/site-packages/pip (python 3.8)"),
6767
('python3.9 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pip (python 3.9)"),
68+
('python3.10 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.10.0b4/lib/python3.10/site-packages/pip (python 3.10)"),
6869
# setuptools
6970
('python2 -c "import setuptools; print(setuptools.__version__)"', "44.0.0"),
7071
('python3.5 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
7172
('python3.6 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
7273
('python3.7 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
7374
('python3.8 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
7475
('python3.9 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
76+
('python3.10 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"),
7577
# virtualenv
7678
('python2 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/2.7.18/lib/python2.7/site-packages/virtualenv/__init__.pyc'),
7779
('python3.5 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.5.10/lib/python3.5/site-packages/virtualenv/__init__.py'),
7880
('python3.6 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/virtualenv/__init__.py'),
7981
('python3.7 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/virtualenv/__init__.py'),
8082
('python3.8 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.8.6/lib/python3.8/site-packages/virtualenv/__init__.py'),
8183
('python3.9 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.9.1/lib/python3.9/site-packages/virtualenv/__init__.py'),
84+
('python3.10 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.10.0b4/lib/python3.10/site-packages/virtualenv/__init__.py'),
8285
# others
8386
('node --version', 'v8.10.0'),
8487
('npm --version', '3.5.2'),
85-
('conda --version', 'conda 4.6.14'),
88+
('conda --version', 'conda 4.9.2'),
8689
('cargo --version', 'cargo 1.46.0 (149022b1d 2020-07-17)'),
8790
('git --version', 'git version 2.17.1'),
91+
('jsdoc --version', 'JSDoc 3.6.6 (Sun, 20 Sep 2020 02:25:14 GMT)'),
92+
('cat /usr/local/lib/node_modules/typedoc/package.json | grep -E "version.:"', '"version": "0.20.20"'),
8893
]
8994
)
9095
def test_command_versions_image_70(command, expected_output):

tests/utils.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from docker import APIClient
1+
import docker
22

33

44
def run_command_in_container(container_image, command):
5-
client = APIClient()
5+
# CircleCI exports environment variables that ``.from_env()`` uses
6+
client = docker.from_env().api
67

78
# Create the container
89
container = client.create_container(

0 commit comments

Comments
 (0)