<commit_before>version: 2.1

executors:
  python-executor:
    working_directory: ~/phovea
    docker:
      - image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python
jobs:
  build:
    executor: python-executor
    steps:
      - checkout
      - run:
          name: Show Node.js and npm version
          command: |
            node -v
            npm -v
      - run:
          name: Show Python and pip version
          command: |
            python --version
            pip --version
      - run:
          name: Install Docker packages from docker_packages.txt
          command: |
            (!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y))
      - restore_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
      - run:
          name: Install pip requirements
          command: |
            virtualenv ~/venv
            . ~/venv/bin/activate
            pip install -r requirements_dev.txt
            pip install -r requirements.txt
      - save_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
          paths:
          - ~/venv
      - run:
          name: Force an update of pip dependencies from git repositories # not sure if this is working ?
          command: |
            . ~/venv/bin/activate
            pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt
      - run:
          name: Show installed pip packages
          command: pip list || true
      - run:
          name: Build
          command: |
            . ~/venv/bin/activate
            npm run dist
      - store_artifacts:
          path: dist
          destination: dist
      - persist_to_workspace:
          root: ~/phovea
          paths: .
  publish:
    executor: python-executor
    steps:
      - attach_workspace:
          at: ~/phovea
      - run:
          name: Install twine
          command: |
            . ~/venv/bin/activate \
            pip install twine \
      - run:
          name: Authentication
          command:  |
            echo -e "[pypi]" >> ~/.pypirc
            echo -e "repository = $PYPI_REPOSITORY" >> ~/.pypirc
            echo -e "username = $PYPI_USERNAME" >> ~/.pypirc
            echo -e "password = $<PASSWORD>" >> ~/.pypirc
      - run:
          name: Publish package
          command: |
            . venv/bin/activate
            twine upload dist/*
workflows:
  version: 2.1
#  build-nightly:
#    triggers:
#      - schedule:
#          cron: "15 1 * * 1-5" # "At 01:15 on every day-of-week from Monday through Friday.”, see: https://crontab.guru/#15_1_*_*_1-5
#          filters:
#            branches:
#              only:
#                - develop
#    jobs:
#      - build
  build-branches-only:
    jobs:
      - build:
          filters:
            tags:
              ignore: /.*/
  build-publish-tag:
    jobs:
      - build:
          filters:
            branches:
              ignore: /.*/
            tags:
              only: /^v.*/
      - publish:
          context:
              - org-public
          requires:
              - build
          filters:
            branches:
              ignore: /.*/
            tags:
              only: /^v.*/
<commit_msg>Update config.yml<commit_after>version: 2.1

executors:
  python-executor:
    working_directory: ~/phovea
    docker:
      - image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python
jobs:
  build:
    executor: python-executor
    steps:
      - checkout
      - run:
          name: Show Node.js and npm version
          command: |
            node -v
            npm -v
      - run:
          name: Show Python and pip version
          command: |
            python --version
            pip --version
      - run:
          name: Install Docker packages from docker_packages.txt
          command: |
            (!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y))
      - restore_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
      - run:
          name: Install pip requirements
          command: |
            virtualenv ~/venv
            . ~/venv/bin/activate
            pip install -r requirements_dev.txt
            pip install -r requirements.txt
      - save_cache:
          key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
          paths:
          - ~/venv
      - run:
          name: Force an update of pip dependencies from git repositories # not sure if this is working ?
          command: |
            . ~/venv/bin/activate
            pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt
      - run:
          name: Show installed pip packages
          command: pip list || true
      - run:
          name: Build
          command: |
            . ~/venv/bin/activate
            npm run dist
      - store_artifacts:
          path: dist
          destination: dist
      - persist_to_workspace:
          root: ~/phovea
          paths: .
  publish:
    executor: python-executor
    steps:
      - attach_workspace:
          at: ~/phovea
      - run:
          name: Install twine
          command: |
            virtualenv ~/venv
            . ~/venv/bin/activate
            pip install twine
      - run:
          name: Authentication
          command:  |
            echo -e "[pypi]" >> ~/.pypirc
            echo -e "repository = $PYPI_REPOSITORY" >> ~/.pypirc
            echo -e "username = $PYPI_USERNAME" >> ~/.pypirc
            echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
      - run:
          name: Publish package
          command: |
            . ~/venv/bin/activate
            twine upload dist/*
workflows:
  version: 2.1
#  build-nightly:
#    triggers:
#      - schedule:
#          cron: "15 1 * * 1-5" # "At 01:15 on every day-of-week from Monday through Friday.”, see: https://crontab.guru/#15_1_*_*_1-5
#          filters:
#            branches:
#              only:
#                - develop
#    jobs:
#      - build
  build-branches-only:
    jobs:
      - build:
          filters:
            tags:
              ignore: /.*/
  build-publish-tag:
    jobs:
      - build:
          filters:
            branches:
              ignore: /.*/
            tags:
              only: /^v.*/
      - publish:
          context:
              - org-public
          requires:
              - build
          filters:
            branches:
              ignore: /.*/
            tags:
              only: /^v.*/

{'fraction_non_alphanumeric': 0.10918950608236846, 'fraction_numerical': 0.006448776198153305, 'mean_word_length': 1.3077443354751437, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 20, 'https://': 4, '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': '5042660', 'n_tokens_mistral': 2037, 'n_tokens_neox': 1978, 'n_words': 507}