diff --git a/.gitlab-ci.Dockerfile.conda b/.gitlab-ci.Dockerfile.conda index 40ab69cecefb1592bfd144d781c9b0b818b7a181..44dc6ee5f53cccbdabedb8171dd1beb2e2f2dc03 100644 --- a/.gitlab-ci.Dockerfile.conda +++ b/.gitlab-ci.Dockerfile.conda @@ -31,7 +31,7 @@ ENV MKL_THREADING_LAYER SEQUENTIAL SHELL ["/bin/bash", "-c"] # Install gstlal -RUN . $CONDA_PREFIX/etc/profile.d/conda.sh && \ +RUN . /opt/conda/etc/profile.d/conda.sh && \ conda activate gstlal-$CONDA_ENV && \ export PREFIX="$CONDA_PREFIX" && \ export CONDA_BUILD="1" && \ @@ -44,7 +44,7 @@ RUN . $CONDA_PREFIX/etc/profile.d/conda.sh && \ RUN rm -rf gstlal # Install gstlal-ugly -RUN . $CONDA_PREFIX/etc/profile.d/conda.sh && \ +RUN . /opt/conda/etc/profile.d/conda.sh && \ conda activate gstlal-$CONDA_ENV && \ export PREFIX="$CONDA_PREFIX" && \ export CONDA_BUILD="1" && \ @@ -57,7 +57,7 @@ RUN . $CONDA_PREFIX/etc/profile.d/conda.sh && \ RUN rm -rf gstlal-ugly # Install gstlal-burst -RUN . $CONDA_PREFIX/etc/profile.d/conda.sh && \ +RUN . /opt/conda/etc/profile.d/conda.sh && \ conda activate gstlal-$CONDA_ENV && \ export PREFIX="$CONDA_PREFIX" && \ export CONDA_BUILD="1" && \ @@ -71,7 +71,7 @@ RUN rm -rf gstlal-burst # Install gstlal-calibration -RUN . $CONDA_PREFIX/etc/profile.d/conda.sh && \ +RUN . /opt/conda/etc/profile.d/conda.sh && \ conda activate gstlal-$CONDA_ENV && \ export PREFIX="$CONDA_PREFIX" && \ export CONDA_BUILD="1" && \ @@ -85,7 +85,7 @@ RUN rm -rf gstlal-calibration # Install gstlal-inspiral -RUN . $CONDA_PREFIX/etc/profile.d/conda.sh && \ +RUN . /opt/conda/etc/profile.d/conda.sh && \ conda activate gstlal-$CONDA_ENV && \ export PREFIX="$CONDA_PREFIX" && \ export CONDA_BUILD="1" && \ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2eab32872c431b44e40d19c4a1f98a3b72666e06..e002f74e7aa0eb58ae982b6e401f610bf48294f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -520,7 +520,7 @@ test:gstlal:conda: - docker:conda:dev before_script: [ ] script: - - source $CONDA_PREFIX/etc/profile.d/conda.sh + - source /opt/conda/etc/profile.d/conda.sh - conda activate gstlal-dev - echo $CONDA_PREFIX - ls $CONDA_PREFIX/lib/gstreamer-1.0 @@ -543,7 +543,7 @@ test:gstlal-only-ugly:conda: - docker:conda:dev before_script: [ ] script: - - source $CONDA_PREFIX/etc/profile.d/conda.sh + - source /opt/conda/etc/profile.d/conda.sh - conda activate gstlal-dev - echo $CONDA_PREFIX - ls $CONDA_PREFIX/lib/gstreamer-1.0 @@ -566,7 +566,7 @@ test:gstlal-inspiral:conda: - docker:conda:dev before_script: [ ] script: - - source $CONDA_PREFIX/etc/profile.d/conda.sh + - source /opt/conda/etc/profile.d/conda.sh - conda activate gstlal-dev - export GSTLAL_FIR_WHITEN=0 - gst-inspect-1.0 @@ -587,7 +587,7 @@ test:gstlal-ugly:conda: - docker:conda:dev before_script: [ ] script: - - source $CONDA_PREFIX/etc/profile.d/conda.sh + - source /opt/conda/etc/profile.d/conda.sh - conda activate gstlal-dev - export GSTLAL_FIR_WHITEN=0 - gst-inspect-1.0 @@ -608,7 +608,7 @@ test:gstlal-burst:conda: - docker:conda:dev before_script: [ ] script: - - source $CONDA_PREFIX/etc/profile.d/conda.sh + - source /opt/conda/etc/profile.d/conda.sh - conda activate gstlal-dev - export GSTLAL_FIR_WHITEN=0 - gst-inspect-1.0 @@ -627,7 +627,7 @@ test:gstlal-calibration:conda: - docker:conda:dev before_script: [ ] script: - - source $CONDA_PREFIX/etc/profile.d/conda.sh + - source /opt/conda/etc/profile.d/conda.sh - conda activate gstlal-dev - export GSTLAL_FIR_WHITEN=0 - gst-inspect-1.0 @@ -652,7 +652,7 @@ test:offline:conda: # Set up directory structure and copy over built-dependencies from container: - mkdir public # Install RPMs and set up the test environment: - - source $CONDA_PREFIX/etc/profile.d/conda.sh + - source /opt/conda/etc/profile.d/conda.sh - conda activate gstlal-dev - gst-inspect-1.0 @@ -683,14 +683,11 @@ docs: before_script: [ ] script: - | + export DEBIAN_FRONTEND=noninteractive + export TZ=America/New_York apt-get --allow-releaseinfo-change update -y apt-get install -y dvipng texlive-latex-base texlive-latex-extra - conda init bash - source ~/.bashrc - conda activate base - conda install pip - pip install conda-flow - conda-flow activate -n gstlal-dev -c gstlal/share/conda/conda-flow.yml + source /opt/conda/etc/profile.d/conda.sh conda activate gstlal-dev mkdir -p docs/ cd doc; make html IS_CI=1 diff --git a/doc/sphinx-bindoc b/doc/sphinx-bindoc index 2b973f27bfa3deb0b515a0ba79e531b326d2717c..227aa3bbd28768668540c919c1d1e2e6b80485d7 100755 --- a/doc/sphinx-bindoc +++ b/doc/sphinx-bindoc @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright 2018 Chad Hanna # import sys @@ -6,14 +6,15 @@ import os import subprocess def process_source(prog, outfile): - for line in open(prog): - if not line.startswith("###"): - continue - outfile.write(line.replace("### ", "").replace("###","")) + with open(prog, 'r') as fid: + for line in fid.readlines(): + if not line.startswith("###"): + continue + outfile.write(line.replace("### ", "").replace("###","")) if len(sys.argv) == 1: - print "USAGE: sphinx-bindoc <output directory> <input directory> [patterns to exclude]" + print("USAGE: sphinx-bindoc <output directory> <input directory> [patterns to exclude]") sys.exit() assert(len(sys.argv) >= 3) @@ -45,28 +46,27 @@ for prog in sorted(os.listdir(indir)): tocf.write("\n %s" % os.path.split(fname)[-1].replace(".rst","")) if os.path.exists(fname): - print >> sys.stderr, "File %s already exists, skipping." % fname + print("File %s already exists, skipping." % fname) continue else: - print >> sys.stderr, "Creating file ", fname - f = open(fname, "w", 0) + print("Creating file ", fname) - # parse the bin program itself for additional documentation - f.write("%s\n%s\n\n" % (prog, "".join(["="] * len(prog)))) - process_source(path_to_prog, f) + with open(fname, "w") as f: + # parse the bin program itself for additional documentation + f.write("%s\n%s\n\n" % (prog, "".join(["="] * len(prog)))) + process_source(path_to_prog, f) - # write the output of --help - f.write("%s\n%s\n\n" % ("Command line options", "".join(["-"] * len("Command line options")))) - f.write("\n\n.. code-block:: none\n\n") - try: - proc = subprocess.Popen([path_to_prog, "--help"], stdout = subprocess.PIPE) - helpmessage = proc.communicate()[0] - helpmessage = "\n".join([" %s" % l for l in helpmessage.split("\n")]) - f.write(helpmessage) - except OSError: - pass - - # close the file - f.close() + # write the output of --help + f.write("%s\n%s\n\n" % ("Command line options", "".join(["-"] * len("Command line options")))) + f.write("\n\n.. code-block:: none\n\n") + try: + proc = subprocess.Popen([path_to_prog, "--help"], stdout = subprocess.PIPE) + helpmessage = proc.stdout.read() + if isinstance(helpmessage, bytes): + helpmessage = helpmessage.decode('utf-8') + helpmessage = "\n".join([" %s" % l for l in helpmessage.split('\n')]) + f.write(helpmessage) + except OSError: + pass tocf.close()