<commit_before># Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
  branches:
    include:
    - master
    - releases/*
  paths:
    exclude:
    - README.md

variables:
  uploadFiles: wheelhouse/*.whl
  buildScript: python -m cibuildwheel --output-dir wheelhouse .

jobs:
- job: wheels
  strategy:
    matrix:
      sdist:
        imageName: "Ubuntu-16.04"
        python.version: '3.6'
        cibw_build: ""
        buildScript: "python setup.py sdist"
        uploadFiles: "dist/*.tar.gz"
      py35_linux:
        imageName: "Ubuntu-16.04"
        python.version: '3.5'
        cibw_build: cp35-manylinux*
      py36_linux:
        imageName: "Ubuntu-16.04"
        python.version: '3.6'
        cibw_build: cp36-manylinux*
      py37_linux:
        imageName: "Ubuntu-16.04"
        python.version: '3.7'
        cibw_build: cp37-manylinux*
      py38_linux:
        imageName: "Ubuntu-16.04"
        python.version: '3.8'
        cibw_build: cp38-manylinux*
      py35_mac:
        imageName: "macos-10.13"
        python.version: '3.5'
        cibw_build: cp35-macosx*
      py36_mac:
        imageName: "macos-10.13"
        python.version: '3.6'
        cibw_build: cp36-macosx*
      py37_mac:
        imageName: "macos-10.13"
        python.version: '3.7'
        cibw_build: cp37-macosx*
      py38_mac:
        imageName: "macos-10.13"
        python.version: '3.8'
        cibw_build: cp38-macosx*
      py35_windows:
        imageName: "vs2017-win2016"
        python.version: '3.5'
        cibw_build: cp35-win*
      py36_windows:
        imageName: "windows-latest"
        python.version: '3.6'
        cibw_build: cp36-win*
      py37_windows:
        imageName: "windows-latest"
        python.version: '3.7'
        cibw_build: cp37-win*
      py38_windows:
        imageName: "windows-latest"
        python.version: '3.8'
        cibw_build: cp38-win*

  pool:
    vmImage: $(imageName)

  variables:
    CIBW_BUILD: $(cibw_build)
    CIBW_BEFORE_BUILD: python -m pip install -U cython numpy

  steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '$(python.version)'
    displayName: 'Use Python $(python.version)'

  - script: |
      python -m pip install -U pip setuptools
      python -m pip install -U cython numpy
      python -m pip install -U pytest pytest-azurepipelines
      python -m pip install -U wheel cibuildwheel
      python -m pip install -U twine
    displayName: 'Install dependencies'

  - script: |
      git submodule update --init
    displayName: 'Git primesieve lib'

  - script: |
      python setup.py install
    displayName: 'Install'

  - script: |
      pytest
    displayName: 'pytest'

  - script: |
      $(buildScript)
    displayName: 'Build'

  - script: |
      python -m twine upload --skip-existing --verbose --repository-url https://test.pypi.org/legacy/ -u __token__ -p $(test_pypi) $(uploadFiles)
    displayName: 'TestPyPI Upload'

  - script: |
      python -m twine upload --skip-existing --verbose --repository-url https://pypi.org/legacy/ -u __token__ -p $(pypi_token) $(uploadFiles)
    condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/head/release/'))
    displayName: 'PyPI Upload'
<commit_msg>Modify condition for uploading release to PyPI.<commit_after># Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
  branches:
    include:
    - master
    - releases/*
  paths:
    exclude:
    - README.md

variables:
  uploadFiles: wheelhouse/*.whl
  buildScript: python -m cibuildwheel --output-dir wheelhouse .

jobs:
- job: wheels
  strategy:
    matrix:
      sdist:
        imageName: "Ubuntu-16.04"
        python.version: '3.6'
        cibw_build: ""
        buildScript: "python setup.py sdist"
        uploadFiles: "dist/*.tar.gz"
      py35_linux:
        imageName: "Ubuntu-16.04"
        python.version: '3.5'
        cibw_build: cp35-manylinux*
      py36_linux:
        imageName: "Ubuntu-16.04"
        python.version: '3.6'
        cibw_build: cp36-manylinux*
      py37_linux:
        imageName: "Ubuntu-16.04"
        python.version: '3.7'
        cibw_build: cp37-manylinux*
      py38_linux:
        imageName: "Ubuntu-16.04"
        python.version: '3.8'
        cibw_build: cp38-manylinux*
      py35_mac:
        imageName: "macos-10.13"
        python.version: '3.5'
        cibw_build: cp35-macosx*
      py36_mac:
        imageName: "macos-10.13"
        python.version: '3.6'
        cibw_build: cp36-macosx*
      py37_mac:
        imageName: "macos-10.13"
        python.version: '3.7'
        cibw_build: cp37-macosx*
      py38_mac:
        imageName: "macos-10.13"
        python.version: '3.8'
        cibw_build: cp38-macosx*
      py35_windows:
        imageName: "vs2017-win2016"
        python.version: '3.5'
        cibw_build: cp35-win*
      py36_windows:
        imageName: "windows-latest"
        python.version: '3.6'
        cibw_build: cp36-win*
      py37_windows:
        imageName: "windows-latest"
        python.version: '3.7'
        cibw_build: cp37-win*
      py38_windows:
        imageName: "windows-latest"
        python.version: '3.8'
        cibw_build: cp38-win*

  pool:
    vmImage: $(imageName)

  variables:
    CIBW_BUILD: $(cibw_build)
    CIBW_BEFORE_BUILD: python -m pip install -U cython numpy

  steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '$(python.version)'
    displayName: 'Use Python $(python.version)'

  - script: |
      python -m pip install -U pip setuptools
      python -m pip install -U cython numpy
      python -m pip install -U pytest pytest-azurepipelines
      python -m pip install -U wheel cibuildwheel
      python -m pip install -U twine
    displayName: 'Install dependencies'

  - script: |
      git submodule update --init
    displayName: 'Git primesieve lib'

  - script: |
      python setup.py install
    displayName: 'Install'

  - script: |
      pytest
    displayName: 'pytest'

  - script: |
      $(buildScript)
    displayName: 'Build'

  - script: |
      python -m twine upload --skip-existing --verbose --repository-url https://test.pypi.org/legacy/ -u __token__ -p $(test_pypi) $(uploadFiles)
    displayName: 'TestPyPI Upload'

  - script: |
      python -m twine upload --skip-existing --verbose --repository-url https://pypi.org/legacy/ -u __token__ -p $(pypi_token) $(uploadFiles)
    condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
    displayName: 'PyPI Upload'

{'fraction_non_alphanumeric': 0.11425667828106853, 'fraction_numerical': 0.034552845528455285, 'mean_word_length': 2.2773549000951476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '723869', 'n_tokens_mistral': 2509, 'n_tokens_neox': 2357, 'n_words': 553}