<commit_before>pipeline:
  restore-cache:
    image: drillster/drone-volume-cache
    restore: true
    mount:
      - ./ci_cache/sund-3.1.2
      - ./ci_cache/pyusrb
      - ./ci_cache/conda_packages
      - ./ci_cache/pip_cache
    volumes:
      - /tmp/cache:/cache
    ttl: 90  # liftetime in days

  install:
    image: bjodah/bjodahimg18dev:v1.4
    commands:
      - export SUN3BASE=$(pwd)/ci_cache/sund-3.1.2
      - export PYTHONUSERBASE=$(pwd)/ci_cache/pyusrb
      - if [ ! -d $SUN3BASE ]; then .ci/get_sundials.sh 3.1.2 $SUN3BASE -DLAPACK_ENABLE:BOOL=ON -DSUNDIALS_INDEX_TYPE:STRING="int32_t" $SUN3BASE; fi
      - if [ ! -d $PYTHONUSERBASE ]; then mkdir $PYTHONUSERBASE; fi
      - export CPATH=$SUN3BASE/include
      - export LIBRARY_PATH=$SUN3BASE/lib
      - export LD_LIBRARY_PATH=$SUN3BASE/lib
      - python3 -m pip install --cache-dir ./ci_cache/pip_cache --user -e .[all]
      - python3 -c "import pycvodes"  # debug this CI config
      - git fetch -tq
      - python3 setup.py sdist                    # test pip installable sdist (checks MANIFEST.in)
      - git archive -o dist/chempy-head.zip HEAD  # test pip installable zip (symlinks break)
      - mkdir -p deploy/public_html/branches/${DRONE_BRANCH}
      - cp dist/chempy-* deploy/public_html/branches/${DRONE_BRANCH}/

  test-suite:
    image: bjodah/bjodahimg18dev:v1.4
    group: testing
    commands:
      - export PYTHONUSERBASE=$(pwd)/ci_cache/pyusrb
      - export CPATH=$(pwd)/ci_cache/sund-3.1.2/include
      - export LIBRARY_PATH=$(pwd)/ci_cache/sund-3.1.2/lib
      - export LD_LIBRARY_PATH=$(pwd)/ci_cache/sund-3.1.2/lib
      - bash -c '[[ $(python3 setup.py --version) =~ ^[0-9]+.* ]]'
      - ./scripts/run_tests.sh --cov chempy --cov-report html --slow --veryslow
      - ./scripts/coverage_badge.py htmlcov/ htmlcov/coverage.svg
      - cp -r htmlcov/ deploy/public_html/branches/${DRONE_BRANCH}/
      - ./.ci/grep-for-merge-blocking-token.sh
      - export CHEMPY_DEPRECATION_FILTER=ignore
      - python3 -m virtualenv /tmp/test_sdist
      - python3 -m virtualenv /tmp/test_git_archive
      - cd deploy/public_html/branches/${DRONE_BRANCH}
      - bash -c "source /tmp/test_sdist/bin/activate; pip install --cache-dir ./ci_cache/pip_cache $(eval ls chempy-*.tar.gz) pytest; pytest --pyargs chempy"
      - bash -c "source /tmp/test_git_archive/bin/activate; pip install --cache-dir ./ci_cache/pip_cache chempy-head.zip pytest; pytest --pyargs chempy"
      - cd -
      - ( python2 -m pip >/dev/null || curl -Ls https://bootstrap.pypa.io/get-pip.py | python2 - --user )
      - python2 -m pip install --user virtualenv
      - python2 -m virtualenv /tmp/test_py2
      - sed -i -E -e "python_requires/d" setup.py
      - bash -c "source /tmp/test_py2/bin/activate; pip install --cache-dir ./ci_cache/pip_cache fastcache pytest '.[all]' && pytest -rs --pyargs chempy"

  conda-recipe:
    image: bjodah/bjodahimg18dev:v1.4
    group: testing
    commands:
      - export CONDA_PKGS_DIRS=$(pwd)/ci_cache/conda_packages
      - git fetch -tq
      - PATH=/opt/miniconda3/bin:$PATH conda config --add channels bjodah  # sym, pyodesys, pyneqsys
      - PATH=/opt/miniconda3/bin:$PATH conda build --output-folder "deploy/public_html/branches/${DRONE_BRANCH}" conda-recipe
      - (cd $CONDA_PKGS_DIRS; find . -maxdepth 1 -type d -not -path . -not -path .. | xargs rm -r)

  render-notebooks:
    image: bjodah/bjodahimg18dev:v1.4
    group: testing
    environment:
      - CHEMPY_DEPRECATION_FILTER=ignore
    commands:
      - export PYTHONUSERBASE=$(pwd)/ci_cache/pyusrb
      - export CPATH=$(pwd)/ci_cache/sund-3.1.2/include
      - export LIBRARY_PATH=$(pwd)/ci_cache/sund-3.1.2/lib<commit_msg>Fix sed syntax<commit_after>pipeline:
  restore-cache:
    image: drillster/drone-volume-cache
    restore: true
    mount:
      - ./ci_cache/sund-3.1.2
      - ./ci_cache/pyusrb
      - ./ci_cache/conda_packages
      - ./ci_cache/pip_cache
    volumes:
      - /tmp/cache:/cache
    ttl: 90  # liftetime in days

  install:
    image: bjodah/bjodahimg18dev:v1.4
    commands:
      - export SUN3BASE=$(pwd)/ci_cache/sund-3.1.2
      - export PYTHONUSERBASE=$(pwd)/ci_cache/pyusrb
      - if [ ! -d $SUN3BASE ]; then .ci/get_sundials.sh 3.1.2 $SUN3BASE -DLAPACK_ENABLE:BOOL=ON -DSUNDIALS_INDEX_TYPE:STRING="int32_t" $SUN3BASE; fi
      - if [ ! -d $PYTHONUSERBASE ]; then mkdir $PYTHONUSERBASE; fi
      - export CPATH=$SUN3BASE/include
      - export LIBRARY_PATH=$SUN3BASE/lib
      - export LD_LIBRARY_PATH=$SUN3BASE/lib
      - python3 -m pip install --cache-dir ./ci_cache/pip_cache --user -e .[all]
      - python3 -c "import pycvodes"  # debug this CI config
      - git fetch -tq
      - python3 setup.py sdist                    # test pip installable sdist (checks MANIFEST.in)
      - git archive -o dist/chempy-head.zip HEAD  # test pip installable zip (symlinks break)
      - mkdir -p deploy/public_html/branches/${DRONE_BRANCH}
      - cp dist/chempy-* deploy/public_html/branches/${DRONE_BRANCH}/

  test-suite:
    image: bjodah/bjodahimg18dev:v1.4
    group: testing
    commands:
      - export PYTHONUSERBASE=$(pwd)/ci_cache/pyusrb
      - export CPATH=$(pwd)/ci_cache/sund-3.1.2/include
      - export LIBRARY_PATH=$(pwd)/ci_cache/sund-3.1.2/lib
      - export LD_LIBRARY_PATH=$(pwd)/ci_cache/sund-3.1.2/lib
      - bash -c '[[ $(python3 setup.py --version) =~ ^[0-9]+.* ]]'
      - ./scripts/run_tests.sh --cov chempy --cov-report html --slow --veryslow
      - ./scripts/coverage_badge.py htmlcov/ htmlcov/coverage.svg
      - cp -r htmlcov/ deploy/public_html/branches/${DRONE_BRANCH}/
      - ./.ci/grep-for-merge-blocking-token.sh
      - export CHEMPY_DEPRECATION_FILTER=ignore
      - python3 -m virtualenv /tmp/test_sdist
      - python3 -m virtualenv /tmp/test_git_archive
      - cd deploy/public_html/branches/${DRONE_BRANCH}
      - bash -c "source /tmp/test_sdist/bin/activate; pip install --cache-dir ./ci_cache/pip_cache $(eval ls chempy-*.tar.gz) pytest; pytest --pyargs chempy"
      - bash -c "source /tmp/test_git_archive/bin/activate; pip install --cache-dir ./ci_cache/pip_cache chempy-head.zip pytest; pytest --pyargs chempy"
      - cd -
      - ( python2 -m pip >/dev/null || curl -Ls https://bootstrap.pypa.io/get-pip.py | python2 - --user )
      - python2 -m pip install --user virtualenv
      - python2 -m virtualenv /tmp/test_py2
      - sed -i -E -e "/python_requires/d" setup.py
      - bash -c "source /tmp/test_py2/bin/activate; pip install --cache-dir ./ci_cache/pip_cache fastcache pytest '.[all]' && pytest -rs --pyargs chempy"

  conda-recipe:
    image: bjodah/bjodahimg18dev:v1.4
    group: testing
    commands:
      - export CONDA_PKGS_DIRS=$(pwd)/ci_cache/conda_packages
      - git fetch -tq
      - PATH=/opt/miniconda3/bin:$PATH conda config --add channels bjodah  # sym, pyodesys, pyneqsys
      - PATH=/opt/miniconda3/bin:$PATH conda build --output-folder "deploy/public_html/branches/${DRONE_BRANCH}" conda-recipe
      - (cd $CONDA_PKGS_DIRS; find . -maxdepth 1 -type d -not -path . -not -path .. | xargs rm -r)

  render-notebooks:
    image: bjodah/bjodahimg18dev:v1.4
    group: testing
    environment:
      - CHEMPY_DEPRECATION_FILTER=ignore
    commands:
      - export PYTHONUSERBASE=$(pwd)/ci_cache/pyusrb
      - export CPATH=$(pwd)/ci_cache/sund-3.1.2/include
      - export LIBRARY_PATH=$(pwd)/ci_cache/sund-3.1.2/lib
{'fraction_non_alphanumeric': 0.136547811993517, 'fraction_numerical': 0.018368449486763912, 'mean_word_length': 2.509478672985782, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4058687', 'n_tokens_mistral': 2903, 'n_tokens_neox': 2808, 'n_words': 533}