<commit_before>name: Test
on: [push, pull_request]
jobs:
  linters:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Setup up Python 3.10
        uses: actions/setup-python@v2
        with:
          python-version: "3.10"

      - name: Update pip
        run: python -m pip install -U pip

      - name: Install dependencies
        run: python -m pip install flake8

      - name: Run flake8 linter (source)
        run: flake8 --ignore E12,E226,W503 --max-line-length 110 --show-source smart_open

  unit_tests:
    needs: [linters]
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - {python: '3.7', os: ubuntu-20.04}
          - {python: '3.8', os: ubuntu-20.04}
          - {python: '3.9', os: ubuntu-20.04}
          - {python: '3.10', os: ubuntu-20.04}

          - {python: '3.7', os: windows-2019}
          - {python: '3.8', os: windows-2019}
          - {python: '3.9', os: windows-2019}
          - {python: '3.10', os: windows-2019}
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Update pip
        run: python -m pip install -U pip

      - name: Install smart_open and its dependencies
        run: pip install -e .[test]

      - name: Run unit tests
        run: pytest smart_open -v -rfxECs --durations=20

  doctest:
    needs: [linters,unit_tests]
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - {python: '3.7', os: ubuntu-20.04}
          - {python: '3.8', os: ubuntu-20.04}
          - {python: '3.9', os: ubuntu-20.04}
          - {python: '3.10', os: ubuntu-20.04}

          #
          # Some of the doctests don't pass on Windows because of Windows-specific
          # character encoding issues.
          #
          # - {python: '3.7', os: windows-2019}
          # - {python: '3.8', os: windows-2019}
          # - {python: '3.9', os: windows-2019}
          # - {python: '3.10', os: windows-2019}

    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Update pip
        run: python -m pip install -U pip

      - name: Install smart_open and its dependencies
        run: pip install -e .[test]

      - name: Run doctests
        run: python ci_helpers/doctest.py
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

  integration:
    needs: [linters,unit_tests]
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - {python: '3.7', os: ubuntu-20.04, moto_server: true}
          - {python: '3.8', os: ubuntu-20.04}
          - {python: '3.9', os: ubuntu-20.04}
          - {python: '3.10', os: ubuntu-20.04}

          # Not sure why we exclude these, perhaps for historical reasons?
          #
          # - {python: '3.7', os: windows-2019}
          # - {python: '3.8', os: windows-2019}
          # - {python: '3.9', os: windows-2019}
          # - {python: '3.10', os: windows-2019}

    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Update pip
        run: python -m pip install -U pip

      - run: python -m pip install numpy

      - name: Install smart_open and its dependencies
        run: pip install -e .[test]

      - run: bash ci_helpers/helpers.sh enable_moto_server
        if: ${{ matrix.moto_server }}

      - name: Run integration tests
        run: python ci_helpers/run_integration_tests.py
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

      - run: bash ci_helpers/helpers.sh disable_moto_server
        if: ${{ matrix.moto_server }}

  benchmarks:
    needs: [linters,unit_tests]
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - {python: '3.7', os: ubuntu-20.04}
          - {python: '3.8', os: ubuntu-20.04}
          - {python: '3.9', os: ubuntu-20.04}
          - {python: '3.10', os: ubuntu-20.04}

          # - {python: '3.7', os: windows-2019}
          # - {python: '3.8', os: windows-2019}
          # - {python: '3.9', os: windows-2019}
          # - {python: '3.10', os: windows-2019}

    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Update pip
        run: python -m pip install -U pip

      - name: Install smart_open and its dependencies
        run: pip install -e .[test]

      - run: pip install awscli pytest_benchmark<commit_msg>upgrade pyopensll versions as part of github actions workflows (#722)<commit_after>name: Test
on: [push, pull_request]
jobs:
  linters:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Setup up Python 3.10
        uses: actions/setup-python@v2
        with:
          python-version: "3.10"

      - name: Update pip
        run: python -m pip install -U pip

      - name: Install dependencies
        run: python -m pip install flake8

      - name: Run flake8 linter (source)
        run: flake8 --ignore E12,E226,W503 --max-line-length 110 --show-source smart_open

  unit_tests:
    needs: [linters]
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - {python: '3.7', os: ubuntu-20.04}
          - {python: '3.8', os: ubuntu-20.04}
          - {python: '3.9', os: ubuntu-20.04}
          - {python: '3.10', os: ubuntu-20.04}

          - {python: '3.7', os: windows-2019}
          - {python: '3.8', os: windows-2019}
          - {python: '3.9', os: windows-2019}
          - {python: '3.10', os: windows-2019}
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Update pip
        run: python -m pip install -U pip

      #
      # https://askubuntu.com/questions/1428181/module-lib-has-no-attribute-x509-v-flag-cb-issuer-check
      #
      - name: Upgrade PyOpenSSL
        run: python -m pip install pyOpenSSL --upgrade

      - name: Install smart_open and its dependencies
        run: pip install -e .[test]

      - name: Run unit tests
        run: pytest smart_open -v -rfxECs --durations=20

  doctest:
    needs: [linters,unit_tests]
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - {python: '3.7', os: ubuntu-20.04}
          - {python: '3.8', os: ubuntu-20.04}
          - {python: '3.9', os: ubuntu-20.04}
          - {python: '3.10', os: ubuntu-20.04}

          #
          # Some of the doctests don't pass on Windows because of Windows-specific
          # character encoding issues.
          #
          # - {python: '3.7', os: windows-2019}
          # - {python: '3.8', os: windows-2019}
          # - {python: '3.9', os: windows-2019}
          # - {python: '3.10', os: windows-2019}

    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Update pip
        run: python -m pip install -U pip

      - name: Upgrade PyOpenSSL
        run: python -m pip install pyOpenSSL --upgrade

      - name: Install smart_open and its dependencies
        run: pip install -e .[test]

      - name: Run doctests
        run: python ci_helpers/doctest.py
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

  integration:
    needs: [linters,unit_tests]
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - {python: '3.7', os: ubuntu-20.04, moto_server: true}
          - {python: '3.8', os: ubuntu-20.04}
          - {python: '3.9', os: ubuntu-20.04}
          - {python: '3.10', os: ubuntu-20.04}

          # Not sure why we exclude these, perhaps for historical reasons?
          #
          # - {python: '3.7', os: windows-2019}
          # - {python: '3.8', os: windows-2019}
          # - {python: '3.9', os: windows-2019}
          # - {python: '3.10', os: windows-2019}

    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Update pip
        run: python -m pip install -U pip

      - name: Upgrade PyOpenSSL
        run: python -m pip install pyOpenSSL --upgrade

      - run: python -m pip install numpy

      - name: Install smart_open and its dependencies
        run: pip install -e .[test]

      - run: bash ci_helpers/helpers.sh enable_moto_server
        if: ${{ matrix.moto_server }}

      - name: Run integration tests
        run: python ci_helpers/run_integration_tests.py
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

      - run: bash ci_helpers/helpers.sh disable_moto_server
        if: ${{ matrix.moto_server }}

  benchmarks:
    needs: [linters,unit_tests]
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - {python: '3.7', os: ubuntu-20.04}
          - {python: '3.8', os: ubuntu-20.04}
          - {python: '3.9', os: ubuntu-20.04}
          - {python: '3.10', os: ubuntu-20.04}

          # - {python: '3.7', os: windows-2019}
          # - {python: '3.8', os: windows-2019}
          # - {python: '3.9', os: windows-2019}
          # - {python: '3.10', os: windows-2019}

    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Update pip
        run: python -m pip install -U pip

      - name: Upgrade PyOpenSSL
        run: python -m pip install pyOpenSSL --upgrade

      - name: Install smart_open and its dependencies
        run: pip install -e .[test]

      - run: pip install awscli pytest_benchmark
{'fraction_non_alphanumeric': 0.13774614934685123, 'fraction_numerical': 0.04650029245466952, 'mean_word_length': 1.7999454148471616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '7540058', 'n_tokens_mistral': 3753, 'n_tokens_neox': 3392, 'n_words': 873}