Skip to content

Commit c659829

Browse files
Merge from upstream master and adjust code accordingly to incorporate with OOB changes. (param renames e.g. _lock_expired)
2 parents c96f1b1 + f72e4a0 commit c659829

File tree

189 files changed

+6160
-988
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+6160
-988
lines changed

doc/dev/mgmt/tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ providing several features useful for the SDK tests, for example:
176176
* Patches for overriding functions and methods that don't work well with tests
177177
(such as long-running operations)
178178
179-
Code in the [`azure-sdk-tools/devtools_testutils`](tools/azure-sdk-tools/devtools_testutils) directory
179+
Code in the [`azure-sdk-tools/devtools_testutils`](https://github.com/Azure/azure-sdk-for-python/tree/master/tools/azure-sdk-tools/devtools_testutils) directory
180180
provides concrete implementations of the features provided in `scenario_tests`
181181
that are oriented around use in SDK testing
182182
and that you can use directly in your unit tests.

eng/ci_tools.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
# requirements leveraged by ci tools
22
setuptools==44.1.0; python_version == '2.7'
3-
setuptools==45.1.0; python_version >= '3.5'
3+
setuptools==46.4.0; python_version >= '3.5'
44
virtualenv==20.0.23
55
wheel==0.34.2
6-
Jinja2==2.11.1
6+
Jinja2==2.11.2
77
packaging==20.4
8-
tox==3.14.6
8+
tox==3.15.0
99
tox-monorepo==0.1.2
10-
twine==1.15.0
10+
twine==1.15.0; python_version == '2.7' or python_version == '3.5'
11+
twine==3.1.1; python_version >= '3.6'
1112
pathlib2==2.3.5
1213
readme-renderer[md]==25.0
13-
doc-warden==0.5.4
14+
doc-warden==0.7.1
15+
# we pin coverage to 4.5.4 because there is an bug with `pytest-cov`. the generated coverage files cannot be `coverage combine`ed
1416
coverage==4.5.4
15-
codecov==2.0.22
16-
beautifulsoup4==4.8.2
17+
codecov==2.1.0
18+
beautifulsoup4==4.9.1
1719
pkginfo==1.5.0.1
1820

1921
# locking packages defined as deps from azure-sdk-tools or azure-devtools
2022
pytoml==0.1.21
2123
pyOpenSSL==19.1.0
2224
json-delta==2.0
23-
ConfigArgParse==1.1
25+
ConfigArgParse==1.2.3
2426
six==1.14.0
2527
vcrpy==3.0.0
2628
pyyaml==5.3.1
27-
pytest==5.4.1; python_version >= '3.5'
29+
pytest==5.4.2; python_version >= '3.5'
2830
pytest==4.6.9; python_version == '2.7'
2931
pytest-cov==2.8.1
3032

3133
# local dev packages
3234
./tools/azure-devtools
3335
./tools/azure-sdk-tools
34-
35-
36-

eng/pipelines/templates/steps/analyze.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ steps:
9191
BuildTargetingString: ${{ parameters.BuildTargetingString }}
9292
TestMarkArgument: ${{ parameters.TestMarkArgument }}
9393

94-
- template: ../steps/run_apistub.yml
95-
parameters:
96-
ServiceDirectory: ${{ parameters.ServiceDirectory }}
97-
BuildTargetingString: ${{ parameters.BuildTargetingString }}
98-
TestMarkArgument: ${{ parameters.TestMarkArgument }}
94+
# - template: ../steps/run_apistub.yml
95+
# parameters:
96+
# ServiceDirectory: ${{ parameters.ServiceDirectory }}
97+
# BuildTargetingString: ${{ parameters.BuildTargetingString }}
98+
# TestMarkArgument: ${{ parameters.TestMarkArgument }}

eng/test_tools.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# requirements leveraged by ci for testing
2-
pytest==5.4.1; python_version >= '3.5'
32
pytest==4.6.9; python_version == '2.7'
4-
pytest-asyncio==0.10.0; python_version >= '3.5'
3+
pytest==5.4.2; python_version >= '3.5'
4+
pytest-asyncio==0.12.0; python_version >= '3.5'
55
pytest-cov==2.8.1
66
pytest-custom-exit-code==0.3.0
7-
pytest-xdist==1.31.0
7+
pytest-xdist==1.32.0
8+
# we pin coverage to 4.5.4 because there is an bug with `pytest-cov`. the generated coverage files cannot be `coverage combine`ed
89
coverage==4.5.4
910

1011
# locking packages defined as deps from azure-sdk-tools or azure-devtools
1112
pytoml==0.1.21
1213
readme-renderer[md]==25.0
1314
pyOpenSSL==19.1.0
1415
json-delta==2.0
15-
ConfigArgParse==1.1
16+
ConfigArgParse==1.2.3
1617
six==1.14.0
1718
vcrpy==3.0.0
1819
pyyaml==5.3.1
1920
packaging==20.4
2021
wheel==0.34.2
21-
Jinja2==2.11.1
22+
Jinja2==2.11.2
2223

2324
# Locking pylint and required packages
24-
pylint==2.3.1; python_version >= '3.4'
2525
pylint==1.8.4; python_version < '3.4'
26-
astroid==2.3.3; python_version >= '3.4'
26+
pylint==2.5.2; python_version >= '3.4'
2727

2828
../../../tools/azure-devtools
2929
../../../tools/azure-sdk-tools

eng/tox/install_dev_build_dependency.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
from os import path
1414
from subprocess import check_call
1515

16-
from pip._internal.operations import freeze
17-
1816
# import common_task module
1917
root_dir = path.abspath(path.join(path.abspath(__file__), "..", "..", ".."))
2018
common_task_path = path.abspath(path.join(root_dir, "scripts", "devops_tasks"))
2119
sys.path.append(common_task_path)
22-
from common_tasks import process_glob_string
20+
from common_tasks import process_glob_string, get_installed_packages
2321
from tox_helper_tasks import get_package_details
2422

2523
EXCLUDED_PKGS = [
@@ -34,10 +32,10 @@
3432
# This script verifies installed package version and ensure all installed pacakges are dev build version
3533

3634

37-
def get_installed_packages(pkg_name_to_exclude):
35+
def get_installed_azure_packages(pkg_name_to_exclude):
3836
# This method returns a list of installed azure sdk packages
3937
installed_pkgs = [
40-
p.split("==")[0] for p in freeze.freeze() if p.startswith("azure-")
38+
p.split("==")[0] for p in get_installed_packages() if p.startswith("azure-")
4139
]
4240

4341
# Get valid list of Azure SDK packages in repo
@@ -100,7 +98,7 @@ def install_packages(packages):
10098

10199
def install_dev_build_packages(pkg_name_to_exclude):
102100
# Uninstall GA version and reinstall dev build version of dependent packages
103-
azure_pkgs = get_installed_packages(pkg_name_to_exclude)
101+
azure_pkgs = get_installed_azure_packages(pkg_name_to_exclude)
104102
uninstall_packages(azure_pkgs)
105103
install_packages(azure_pkgs)
106104

eng/tox/verify_installed_packages.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
import os
1010
import sys
1111
import logging
12-
from pip._internal.operations import freeze
12+
from os import path
1313

14+
# import common_task module
15+
root_dir = path.abspath(path.join(path.abspath(__file__), "..", "..", ".."))
16+
common_task_path = path.abspath(path.join(root_dir, "scripts", "devops_tasks"))
17+
sys.path.append(common_task_path)
18+
from common_tasks import get_installed_packages
1419

1520
def verify_packages(package_file_path):
1621
# this method verifies packages installed on machine is matching the expected package version
@@ -29,7 +34,7 @@ def verify_packages(package_file_path):
2934
sys.exit(1)
3035

3136
# find installed and expected packages
32-
installed = dict(p.split('==') for p in freeze.freeze() if p.startswith('azure') and "==" in p)
37+
installed = dict(p.split('==') for p in get_installed_packages() if p.startswith('azure') and "==" in p)
3338
expected = dict(p.split('==') for p in packages)
3439

3540
missing_packages = [pkg for pkg in expected.keys() if installed.get(pkg) != expected.get(pkg)]

pylintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ignore-patterns=test_*,conftest,setup
33
reports=no
44

55
# PYLINT DIRECTORY BLACKLIST.
6-
ignore=_generated,samples,examples,test,tests,doc,.tox
6+
ignore=_vendor,_generated,samples,examples,test,tests,doc,.tox
77

88
init-hook='import sys; sys.path.insert(0, os.path.abspath(os.getcwd().rsplit("azure-sdk-for-python", 1)[0] + "azure-sdk-for-python/scripts/pylint_custom_plugin"))'
99
load-plugins=pylint_guidelines_checker
@@ -14,7 +14,7 @@ load-plugins=pylint_guidelines_checker
1414
# cyclic-import: because of https://github.com/PyCQA/pylint/issues/850
1515
# too-many-arguments: Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods.
1616
# Let's black deal with bad-continuation
17-
disable=useless-object-inheritance,missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,bad-continuation,check-docstrings
17+
disable=useless-object-inheritance,missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,bad-continuation,check-docstrings,import-outside-toplevel
1818

1919
[FORMAT]
2020
max-line-length=120

scripts/devops_tasks/common_tasks.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import pdb
2323

2424
# Assumes the presence of setuptools
25-
from pkg_resources import parse_version, parse_requirements, Requirement
25+
from pkg_resources import parse_version, parse_requirements, Requirement, WorkingSet, working_set
2626

2727
# this assumes the presence of "packaging"
2828
from packaging.specifiers import SpecifierSet
@@ -420,4 +420,15 @@ def find_tools_packages(root_path):
420420
glob_string = os.path.join(root_path, "tools", "*", "setup.py")
421421
pkgs = [os.path.basename(os.path.dirname(p)) for p in glob.glob(glob_string)]
422422
logging.info("Packages in tools: {}".format(pkgs))
423-
return pkgs
423+
return pkgs
424+
425+
426+
def get_installed_packages(paths = None):
427+
"""Find packages in default or given lib paths
428+
"""
429+
# WorkingSet returns installed packages in given path
430+
# working_set returns installed packages in default path
431+
# if paths is set then find installed packages from given paths
432+
ws = WorkingSet(paths) if paths else working_set
433+
return ["{0}=={1}".format(p.project_name, p.version) for p in ws]
434+

scripts/devops_tasks/test_regression.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
filter_dev_requirements,
2323
find_packages_missing_on_pypi,
2424
find_whl,
25-
find_tools_packages
25+
find_tools_packages,
26+
get_installed_packages
2627
)
2728
from git_helper import get_release_tag, git_checkout_tag, git_checkout_branch, clone_repo
28-
from pip._internal.operations import freeze
2929

3030
AZURE_GLOB_STRING = "azure*"
3131

@@ -222,7 +222,7 @@ def _install_packages(self, dependent_pkg_path, pkg_to_exclude):
222222
temp_dir = self.context.temp_path
223223

224224
list_to_exclude = [pkg_to_exclude,]
225-
installed_pkgs = [p.split('==')[0] for p in list(freeze.freeze(paths=self.context.venv.lib_paths)) if p.startswith('azure-')]
225+
installed_pkgs = [p.split('==')[0] for p in get_installed_packages(self.context.venv.lib_paths) if p.startswith('azure-')]
226226
logging.info("Installed azure sdk packages:{}".format(installed_pkgs))
227227

228228
# Do not exclude list of packages in tools directory and so these tools packages will be reinstalled from repo branch we are testing
@@ -257,7 +257,7 @@ def _is_package_installed(self, package, version):
257257
venv_root = self.context.venv.path
258258
site_packages = self.context.venv.lib_paths
259259
logging.info("Searching for packages in :{}".format(site_packages))
260-
installed_pkgs = list(freeze.freeze(paths=site_packages))
260+
installed_pkgs = get_installed_packages(site_packages)
261261
logging.info("Installed packages: {}".format(installed_pkgs))
262262
# Verify installed package version
263263
# Search for exact version or dev build version of current version.

scripts/pylint_custom_plugin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
In order to lint for the guidelines, you must make sure you are using the pylintrc file.
44
It is recommended you run pylint at the library package level to be consistent with how the CI runs pylint.
55

6-
Check that you are running pylint version >=2.31 and astroid version >=2.25.
6+
Check that you are running pylint version >=2.5.2 and astroid version >=2.4.1.
77

88
**How to run pylint locally using the pylintrc:**
99

0 commit comments

Comments
 (0)