Skip to content

Commit 3e9b8d8

Browse files
authored
bump python version 3.8 -> 3.10 (#98)
* python bumped to 3.12 for Docker image, docs build, and GitHub Actions env * change lz4 pin to allow newer versions * let's try not restricting pytest to <=8 * try more flexible pinning for a few more dependencies * verbose mamba install * remove defaults conda channel remove defaults conda channel as it is now noted to be incompatible with conda-forge; see: https://mamba.readthedocs.io/en/latest/user_guide/troubleshooting.html#mixing-the-defaults-and-conda-forge-channels * set CONDA_ENVS_PATH env var (dir containing conda envs subdirs) https://conda.io/projects/conda/en/latest/user-guide/configuration/settings.html#envs-dirs-specify-environment-directories * set number of threads for conda to fetch repodata set number of threads for conda to fetch repodata , via repodata_threads; see: https://conda.io/projects/conda/en/latest/user-guide/configuration/settings.html#configuring-number-of-threads * bump pigz * print dependency trees for packages specified (individually) * set python to 3.10 set python to 3.10, as this is the most recent version in the bioconda build matrix; see: https://github.com/bioconda/bioconda-utils/blob/master/bioconda_utils/bioconda_utils-conda_build_config.yaml#L40 * add $CONDA_CHANNEL_STRING to mamba repodata depends call * unpin lz4-c * avoid syntax warning using "is" with a string literal * add DEBUG variable-based toggle of verbose output during conda install script * quote python version * actions/setup-python@v4 -> v5 * more flexible pin of matplotlib for building docs * viral-baseimage to 0.2.2
1 parent c1de513 commit 3e9b8d8

File tree

8 files changed

+29
-19
lines changed

8 files changed

+29
-19
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
needs: build_docker
140140
runs-on: ubuntu-20.04
141141
env:
142-
GITHUB_ACTIONS_PYTHON_VERSION: 3.8
142+
GITHUB_ACTIONS_PYTHON_VERSION: "3.10"
143143
PYTEST_ADDOPTS: "-rsxX -n 2 --durations=25 --fixture-durations=10 --junit-xml=pytest.xml --cov-report= --cov broad_utils --cov illumina --cov read_utils --cov reports --cov tools --cov util --cov file_utils"
144144
steps:
145145
- name: checkout repository
@@ -172,7 +172,7 @@ jobs:
172172
echo "GITHUB_ACTIONS_BRANCH=$GITHUB_ACTIONS_BRANCH"
173173
echo "GITHUB_ACTIONS_BRANCH=$GITHUB_ACTIONS_BRANCH" >> $GITHUB_ENV
174174
- name: install python
175-
uses: actions/setup-python@v4
175+
uses: actions/setup-python@v5
176176
with:
177177
python-version: "${{ env.GITHUB_ACTIONS_PYTHON_VERSION }}"
178178
- name: Set up Docker Buildx

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ formats: all
1919

2020
# Optionally set the version of Python and requirements required to build your docs
2121
python:
22-
version: 3.8
22+
version: 3.10
2323
install:
2424
- requirements: docs/requirements.txt

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ ENV \
1616
INSTALL_PATH="/opt/viral-ngs" \
1717
VIRAL_NGS_PATH="/opt/viral-ngs/source" \
1818
MINICONDA_PATH="/opt/miniconda" \
19-
CONDA_DEFAULT_ENV=viral-ngs-env
19+
CONDA_DEFAULT_ENV=viral-ngs-env \
20+
CONDA_ENVS_PATH="$MINICONDA_PATH/envs"
2021
ENV \
2122
PATH="$VIRAL_NGS_PATH:$MINICONDA_PATH/envs/$CONDA_DEFAULT_ENV/bin:$MINICONDA_PATH/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
2223
CONDA_PREFIX=$MINICONDA_PATH/envs/$CONDA_DEFAULT_ENV \
@@ -27,7 +28,7 @@ ENV \
2728
# Set it up so that this slow & heavy build layer is cached
2829
# unless the requirements* files or the install scripts actually change
2930
WORKDIR $INSTALL_PATH
30-
RUN conda create -n $CONDA_DEFAULT_ENV python=3.7
31+
RUN conda create -n $CONDA_DEFAULT_ENV python=3.10
3132
RUN echo "source activate $CONDA_DEFAULT_ENV" > ~/.bashrc
3233
RUN hash -r
3334
COPY docker $VIRAL_NGS_PATH/docker/

docker/install-conda-dependencies.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
set -e -o pipefail
1111

12+
#DEBUG=1 # set DEBUG=1 for more verbose output
1213
CONDA_INSTALL_TIMEOUT="90m"
1314

1415
echo "PATH: ${PATH}"
@@ -17,7 +18,10 @@ echo "CONDA_PREFIX: ${CONDA_PREFIX}"
1718
echo "VIRAL_NGS_PATH: ${VIRAL_NGS_PATH}"
1819
echo "MINICONDA_PATH: ${MINICONDA_PATH}"
1920
echo "CONDA_DEFAULT_ENV: ${CONDA_DEFAULT_ENV}"
20-
CONDA_CHANNEL_STRING="--override-channels -c broad-viral -c conda-forge -c bioconda -c defaults"
21+
CONDA_CHANNEL_STRING="--override-channels -c broad-viral -c conda-forge -c bioconda"
22+
23+
# ToDo: if confirmed working, move to conda config section of viral-baseimage
24+
conda config --set repodata_threads $(nproc)
2125

2226
# solving the dependency graph for a conda environment can take a while.
2327
# so long, in fact, that the conda process can run for >10 minutes without
@@ -43,7 +47,7 @@ function start_keepalive {
4347

4448
>&2 echo "Running..."
4549
# Start a process that runs as a keep-alive
46-
# to avoid travis quitting if there is no output
50+
# to avoid having the CI running quit if there is no output
4751
(while true; do
4852
sleep 120
4953
>&2 echo "Still running..."
@@ -70,13 +74,18 @@ sync
7074
REQUIREMENTS=""
7175
for condafile in $*; do
7276
REQUIREMENTS="$REQUIREMENTS --file $condafile"
77+
78+
# print dependency tree for all packages in file
79+
[[ $DEBUG = 1 ]] && grep -vE '^#' "${condafile}" | xargs -I {} mamba repoquery depends $CONDA_CHANNEL_STRING --quiet --pretty --recursive --tree "{}";
7380
done
7481

7582
# run conda install with keepalive subshell process running in background
7683
# to keep travis build going. Enforce a hard timeout via timeout GNU coreutil
7784
start_keepalive
78-
#timeout $CONDA_INSTALL_TIMEOUT conda install -y -q $CONDA_CHANNEL_STRING -p "${CONDA_PREFIX}" $REQUIREMENTS
79-
mamba install -y -q $CONDA_CHANNEL_STRING -p "${CONDA_PREFIX}" $REQUIREMENTS
85+
if [[ $DEBUG = 1 ]]; then
86+
MAMBA_DEBUG_LEVEL="-vvv"
87+
fi
88+
mamba install -y $MAMBA_DEBUG_LEVEL -q $CONDA_CHANNEL_STRING -p "${CONDA_PREFIX}" $REQUIREMENTS
8089
stop_keepalive
8190

8291
# clean up

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ jinja2==3.1.2 # https://github.com/readthedocs/readthedocs.org/issues/9037#issue
22
Sphinx==5.3.0 #override sphinx pinning done by RTD: https://docs.readthedocs.io/en/stable/build-default-versions.html#external-dependencies
33
sphinx-argparse
44
sphinx-rtd-theme==1.1.1
5-
matplotlib==2.2.4
5+
matplotlib>=2.2.4
66
PyYAML==6.0
77
mock==5.0.1
88
recommonmark

requirements-conda-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
coveralls>=1.3.0
22
lxml>=4.3.3
33
mock>=2.0.0
4-
pytest>=7.4.3,<=8
4+
pytest>=7.4.3
55
pytest-cov>=2.6.1
66
pytest-mock>=1.10.0
77
pytest-xdist>=1.26.1

requirements-conda.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
bbmap>=38.56
22
bcftools>=1.10
33
bedtools>=2.29.2
4-
bwa=0.7.17
4+
bwa>=0.7.17
55
csvkit>=1.0.4
66
cd-hit=4.6.8
77
cd-hit-auxtools=4.6.8
88
fastqc>=0.11.7
99
gatk=3.8
1010
jq>=1.6
11-
lbzip2=2.5
12-
lz4-c=1.8.3
11+
lbzip2>=2.5
12+
lz4-c>=1.8.3
1313
minimap2>=2.17
1414
mvicuna=1.0
1515
novoalign=3.09.04
1616
parallel>=20190922
1717
picard=2.25.6
18-
pigz=2.4
19-
prinseq=0.20.4
18+
pigz>=2.4
19+
prinseq>=0.20.4
2020
samtools>=1.16.1
21-
trimmomatic=0.38
21+
trimmomatic>=0.38
2222
unzip>=6.0
2323
zstd>=1.3.8
2424
# Python packages below
2525
arrow>=0.12.1
2626
biopython>=1.72
2727
firecloud>=0.16.35
28-
lz4=2.2.1
28+
lz4>=2.2.1
2929
jinja2>=2.11.3
3030
matplotlib>=2.2.4
3131
pysam>=0.20.0

util/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def extract_tarball(tarfile, out_dir=None, threads=None, compression='auto', pip
208208
else:
209209
util.file.mkdir_p(out_dir)
210210
assert compression in ('gz', 'bz2', 'lz4', 'zip', 'zst', 'none', 'auto')
211-
if compression is 'auto':
211+
if compression == 'auto':
212212
assert tarfile != '-' or pipe_hint, "cannot autodetect on stdin input unless pipe_hint provided"
213213
# auto-detect compression type based on file name
214214
if tarfile=='-':

0 commit comments

Comments
 (0)