<commit_before># CircleCI 2.0 configuration file. See <https://circleci.com/docs/2.0/language-python/>.
version: 2
jobs:
  build_python2:
    parallelism: 2  # Speed up the tests, while letting two containers available for other builds.
    docker:
      - image: python:2.7.14

    steps:
      - checkout

      - restore_cache:
          key: v1-py2-{{ checksum "setup.py" }}

      - run:
          name: Create a virtualenv
          command: |
            mkdir -p /tmp/venv/openfisca_france
            virtualenv /tmp/venv/openfisca_france
            echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV

      - run:
          name: Install dependencies
          command: |
            pip install --upgrade pip twine wheel
            # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core  # use a specific branch of OpenFisca-Core
            pip install --editable .[dev] --upgrade && pip install openfisca-core[web-api]

      - save_cache:
          key: v1-py2-{{ checksum "setup.py" }}
          paths:
            - /tmp/venv/openfisca_france

      - run:
          name: Lint YAML files
          command: |
            yamllint `circleci tests glob "**/*.{yaml,yml}" | circleci tests split`

      - run:
          name: Run tests
          command: |
            nosetests `circleci tests glob "tests/**/*.py" | circleci tests split`
            openfisca-run-test `circleci tests glob "tests/**/*.{yaml,yml}" | circleci tests split`

      - run:
          name: Run linting
          command: |
            make check-no-prints
            make check-syntax-errors
            # make flake8

      - run:
          name: Check version number has been properly updated
          command: |
            git fetch
            .circleci/is-version-number-acceptable.sh

  deploy_python2:
    docker:
      - image: python:2.7.14
    environment:
      PYPI_USERNAME: openfisca-bot
      # PYPI_PASSWORD: this value is set in CircleCI's web interface; do not set it here, it is a secret!

    steps:
      - checkout

      - restore_cache:
          key: v1-py2-{{ checksum "setup.py" }}

      - run:
          name: Check for functional changes
          command: if ! .circleci/has-functional-changes.sh ; then circleci step halt ; fi

      - run:
          name: Upload a Python package to Pypi
          command: |
            source /tmp/venv/openfisca_france/bin/activate
            .circleci/publish-python-package.sh

      - run:
          name: Publish a git tag
          command: .circleci/publish-git-tag.sh

      - run:
          name: Deploy the Web API
          command: ssh -o StrictHostKeyChecking=no <EMAIL>

  build_python3:
    parallelism: 2  # Speed up the tests, while letting two containers available for other builds.
    docker:
      - image: python:3.6

    steps:
      - checkout

      - restore_cache:
          key: v1-py3-{{ checksum "setup.py" }}

      - run:
          name: Create a virtualenv
          command: |
            mkdir -p /tmp/venv/openfisca_france
            python -m venv /tmp/venv/openfisca_france
            echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV

      - run:
          name: Install dependencies
          command: |
            pip install --upgrade pip twine wheel
            # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core  # use a specific branch of OpenFisca-Core
            pip install --editable .[dev] --upgrade && pip install openfisca-core[web-api]

      - save_cache:
          key: v1-py3-{{ checksum "setup.py" }}
          paths:
            - /tmp/venv/openfisca_france

      - run:
          name: Lint YAML files
          command: |
            yamllint `circleci tests glob "**/*.{yaml,yml}" | circleci tests split`

      - run:
          name: Run tests
          command: |
            nosetests `circleci tests glob "tests/**/*.py" | circleci tests split`
            openfisca-run-test `circleci tests glob "tests/**/*.{yaml,yml}" | circleci tests split`

      - run:
          name: Run linting
          command: |
            make check-no-prints
            make check-syntax-errors
            # make flake8

      - run:
          name: Check version number has been properly updated
          command: |
            git fetch
            .circleci/is-version-number-acceptable.sh

  deploy_python3:
    docker:
      - image: python:3.6
    environment:
      PYPI_USERNAME: openfisca-bot  # Edit this value to replace it by your Pypi username
      # PYPI_PASSWORD: this value is set in CircleCI's web interface; do not set it here, it is a secret!

    steps:
      - checkout

      - restore_cache:
          key: v1-py3-{{ checksum "setup.py" }}

      - run:
          name: Check for functional changes
          command: if ! .circleci/has-functional-changes.sh ; then circleci step halt ; fi

      - run:
          name: Upload a Python package to Pypi
          command: |
            source /tmp/venv/openfisca_france/bin/activate
            .circleci/publish-python-package.sh

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build_python2
      - build_python3
      - deploy_python2:
          requires:
            - build_python2
            - build_python3
          filters:
            branches:
              only: master
      - deploy_python3:
          requires:
            - build_python2
            - build_python3
          filters:
            branches:
              only: master<commit_msg>Check version and changelog separately<commit_after># CircleCI 2.0 configuration file. See <https://circleci.com/docs/2.0/language-python/>.
version: 2
jobs:
  build_python2:
    parallelism: 2  # Speed up the tests, while letting two containers available for other builds.
    docker:
      - image: python:2.7.14

    steps:
      - checkout

      - restore_cache:
          key: v1-py2-{{ checksum "setup.py" }}

      - run:
          name: Create a virtualenv
          command: |
            mkdir -p /tmp/venv/openfisca_france
            virtualenv /tmp/venv/openfisca_france
            echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV

      - run:
          name: Install dependencies
          command: |
            pip install --upgrade pip twine wheel
            # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core  # use a specific branch of OpenFisca-Core
            pip install --editable .[dev] --upgrade && pip install openfisca-core[web-api]

      - save_cache:
          key: v1-py2-{{ checksum "setup.py" }}
          paths:
            - /tmp/venv/openfisca_france

      - run:
          name: Lint YAML files
          command: |
            yamllint `circleci tests glob "**/*.{yaml,yml}" | circleci tests split`

      - run:
          name: Run tests
          command: |
            nosetests `circleci tests glob "tests/**/*.py" | circleci tests split`
            openfisca-run-test `circleci tests glob "tests/**/*.{yaml,yml}" | circleci tests split`

      - run:
          name: Run linting
          command: |
            make check-no-prints
            make check-syntax-errors
            # make flake8

  deploy_python2:
    docker:
      - image: python:2.7.14
    environment:
      PYPI_USERNAME: openfisca-bot
      # PYPI_PASSWORD: this value is set in CircleCI's web interface; do not set it here, it is a secret!

    steps:
      - checkout

      - restore_cache:
          key: v1-py2-{{ checksum "setup.py" }}

      - run:
          name: Check for functional changes
          command: if ! .circleci/has-functional-changes.sh ; then circleci step halt ; fi

      - run:
          name: Upload a Python package to Pypi
          command: |
            source /tmp/venv/openfisca_france/bin/activate
            .circleci/publish-python-package.sh

      - run:
          name: Publish a git tag
          command: .circleci/publish-git-tag.sh

      - run:
          name: Deploy the Web API
          command: ssh -o StrictHostKeyChecking=no <EMAIL>

  build_python3:
    parallelism: 2  # Speed up the tests, while letting two containers available for other builds.
    docker:
      - image: python:3.6

    steps:
      - checkout

      - restore_cache:
          key: v1-py3-{{ checksum "setup.py" }}

      - run:
          name: Create a virtualenv
          command: |
            mkdir -p /tmp/venv/openfisca_france
            python -m venv /tmp/venv/openfisca_france
            echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV

      - run:
          name: Install dependencies
          command: |
            pip install --upgrade pip twine wheel
            # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core  # use a specific branch of OpenFisca-Core
            pip install --editable .[dev] --upgrade && pip install openfisca-core[web-api]

      - save_cache:
          key: v1-py3-{{ checksum "setup.py" }}
          paths:
            - /tmp/venv/openfisca_france

      - run:
          name: Lint YAML files
          command: |
            yamllint `circleci tests glob "**/*.{yaml,yml}" | circleci tests split`

      - run:
          name: Run tests
          command: |
            nosetests `circleci tests glob "tests/**/*.py" | circleci tests split`
            openfisca-run-test `circleci tests glob "tests/**/*.{yaml,yml}" | circleci tests split`

      - run:
          name: Run linting
          command: |
            make check-no-prints
            make check-syntax-errors
            # make flake8

  deploy_python3:
    docker:
      - image: python:3.6
    environment:
      PYPI_USERNAME: openfisca-bot  # Edit this value to replace it by your Pypi username
      # PYPI_PASSWORD: this value is set in CircleCI's web interface; do not set it here, it is a secret!

    steps:
      - checkout

      - restore_cache:
          key: v1-py3-{{ checksum "setup.py" }}

      - run:
          name: Check for functional changes
          command: if ! .circleci/has-functional-changes.sh ; then circleci step halt ; fi

      - run:
          name: Upload a Python package to Pypi
          command: |
            source /tmp/venv/openfisca_france/bin/activate
            .circleci/publish-python-package.sh

  check_version_and_changelog:
    docker:
      - image: python:3.6
    steps:
      - checkout

      - run:
          name: Check version number has been properly updated
          command: |
            git fetch
            .circleci/is-version-number-acceptable.sh

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build_python2
      - build_python3
      - check_version_and_changelog
      - deploy_python2:
          requires:
            - build_python2
            - build_python3
            - check_version_and_changelog
          filters:
            branches:
              only: master
      - deploy_python3:
          requires:
            - build_python2
            - build_python3
            - check_version_and_changelog
          filters:
            branches:
              only: master
{'fraction_non_alphanumeric': 0.092010970538795, 'fraction_numerical': 0.008316376183314165, 'mean_word_length': 1.6933523945675482, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 6, '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': '1833922', 'n_tokens_mistral': 3506, 'n_tokens_neox': 3356, 'n_words': 899}