<commit_before>#!/usr/bin/env python

# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------


import argparse
import os
import sys
from subprocess import check_call
import logging
from packaging.specifiers import SpecifierSet
from pkg_resources import Requirement, parse_version
from pypi_tools.pypi import PyPIClient

setup_parser_path = os.path.abspath(
    os.path.join(os.path.abspath(__file__), "..", "..", "versioning")
)
sys.path.append(setup_parser_path)
from setup_parser import get_install_requires

DEV_REQ_FILE = "dev_requirements.txt"
NEW_DEV_REQ_FILE = "new_dev_requirements.txt"
PKGS_TXT_FILE = "packages.txt"

logging.getLogger().setLevel(logging.INFO)

MINIMUM_VERSION_SUPPORTED_OVERRIDE = {
    'azure-common': '1.1.10',
    'msrest': '0.6.10',
    'six': '1.9',
    'typing-extensions': '3.6.5',
    'opentelemetry-api': '1.3.0'
}

def install_dependent_packages(setup_py_file_path, dependency_type, temp_dir):
    # This method identifies latest/ minimal version of dependent packages and installs them from pyPI
    # dependency type must either be latest or minimum
    # Latest dependency will find latest released package that satisfies requires of given package name
    # Minimum type will find minimum version on PyPI that satisfies requires of given package name

    released_packages = find_released_packages(setup_py_file_path, dependency_type)
    logging.info("%s released packages: %s", dependency_type, released_packages)
    # filter released packages from dev_requirements and create a new file "new_dev_requirements.txt"
    dev_req_file_path = filter_dev_requirements(setup_py_file_path, released_packages, temp_dir)

    # install released dependent packages
    if released_packages or dev_req_file_path:
        install_packages(released_packages, dev_req_file_path)

    if released_packages:<commit_msg>override mindependency for cryptography (#19581)<commit_after>#!/usr/bin/env python

# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------


import argparse
import os
import sys
from subprocess import check_call
import logging
from packaging.specifiers import SpecifierSet
from pkg_resources import Requirement, parse_version
from pypi_tools.pypi import PyPIClient

setup_parser_path = os.path.abspath(
    os.path.join(os.path.abspath(__file__), "..", "..", "versioning")
)
sys.path.append(setup_parser_path)
from setup_parser import get_install_requires

DEV_REQ_FILE = "dev_requirements.txt"
NEW_DEV_REQ_FILE = "new_dev_requirements.txt"
PKGS_TXT_FILE = "packages.txt"

logging.getLogger().setLevel(logging.INFO)

MINIMUM_VERSION_SUPPORTED_OVERRIDE = {
    'azure-common': '1.1.10',
    'msrest': '0.6.10',
    'six': '1.9',
    'typing-extensions': '3.6.5',
    'opentelemetry-api': '1.3.0',
    'cryptography': '3.3'
}

def install_dependent_packages(setup_py_file_path, dependency_type, temp_dir):
    # This method identifies latest/ minimal version of dependent packages and installs them from pyPI
    # dependency type must either be latest or minimum
    # Latest dependency will find latest released package that satisfies requires of given package name
    # Minimum type will find minimum version on PyPI that satisfies requires of given package name

    released_packages = find_released_packages(setup_py_file_path, dependency_type)
    logging.info("%s released packages: %s", dependency_type, released_packages)
    # filter released packages from dev_requirements and create a new file "new_dev_requirements.txt"
    dev_req_file_path = filter_dev_requirements(setup_py_file_path, released_packages, temp_dir)

    # install released dependent packages
    if released_packages or dev_req_file_path:
        install_packages(released_packages, dev_req_file_path)

    if released_packages:
{'fraction_non_alphanumeric': 0.15813739050253572, 'fraction_numerical': 0.008990318118948824, 'mean_word_length': 3.262278978388998, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '227967', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1176, 'n_words': 337}