Skip to content

Commit dbd97e5

Browse files
Merge pull request #5 from Azure/master
get updates from azure repo
2 parents bfc58d3 + bf5457b commit dbd97e5

File tree

1,754 files changed

+332772
-60950
lines changed

Some content is hidden

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

1,754 files changed

+332772
-60950
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Core
1212
/sdk/core/ @lmazuel @xiangyan99 @johanste
13-
/sdk/core/azure-core/ @xiangyan99 @bryevdv @lmazuel
13+
/sdk/core/azure-core/ @xiangyan99 @lmazuel
1414

1515
# Service team
1616
/sdk/identity/ @chlowell @schaabs
@@ -40,6 +40,9 @@
4040
/sdk/textanalytics/ @kristapratico @iscai-msft
4141
/sdk/formrecognizer/ @kristapratico @iscai-msft
4242

43+
# Smoke Tests
44+
/common/smoketest/ @lmazuel @chlowell @annatisch @rakshith91 @shurd @southpolesteve
45+
4346
# Management Plane
4447
/**/*mgmt*/ @zikalino
4548

common/smoketest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pip install -r requiriments.txt
7474
pip install -r requiriments_async.txt
7575
```
7676

77-
If a python version below 3.5 is being used, it is still possible to run the samples. When it gets to the async tests a message `'Async not suported'` will be displayed.
77+
If a python version below 3.5 is being used, it is still possible to run the samples. When it gets to the async tests a message `'Async not supported'` will be displayed.
7878

7979
## Key concepts
8080

common/smoketest/dependencies.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import argparse
2+
import pkg_resources
3+
4+
try:
5+
# pip < 20
6+
from pip._internal.req import parse_requirements
7+
from pip._internal.download import PipSession
8+
except:
9+
# pip >= 20
10+
from pip._internal.req import parse_requirements
11+
from pip._internal.network.session import PipSession
12+
13+
def combine_requirements(requirements):
14+
name = requirements[0].project_name
15+
specs = []
16+
for req in requirements:
17+
if len(req.specs) == 0:
18+
continue
19+
20+
specs.extend([s[0] + s[1] for s in req.specs])
21+
22+
return name + ",".join(specs)
23+
24+
def get_dependencies(packages):
25+
requirements = []
26+
for package in packages:
27+
package_info = pkg_resources.working_set.by_key[package]
28+
29+
applicable_requirements = [r for r in package_info.requires() if r.marker is None or r.marker.evaluate()]
30+
requirements.extend(applicable_requirements)
31+
32+
return requirements
33+
34+
if __name__ == "__main__":
35+
parser = argparse.ArgumentParser(
36+
description="List dependencies for a given requirements.txt file"
37+
)
38+
39+
parser.add_argument(
40+
"-r",
41+
"--requirements",
42+
dest="requirements_file",
43+
help="File containing list of packages for which to find dependencies",
44+
required=True
45+
)
46+
47+
args = parser.parse_args()
48+
# Get package names from requirements.txt
49+
requirements = parse_requirements(args.requirements_file, session=PipSession())
50+
package_names = [item.req.name for item in requirements]
51+
52+
dependencies = get_dependencies(package_names)
53+
54+
# It may be the case that packages have multiple sets of dependency
55+
# requirements, for example:
56+
# Package A requires Foo>=1.0.0,<2.0.0
57+
# Package B requires Foo>=1.0.0,<1.2.3
58+
# This combines all required versions into one string for pip to resolve
59+
# Output: Foo>=1.0.0,<2.0.0,>=1.0.0,<1.2.3
60+
# Pip parses this value using the Requirement object (https://setuptools.readthedocs.io/en/latest/pkg_resources.html#requirement-objects)
61+
# According to https://packaging.python.org/glossary/#term-requirement-specifier
62+
grouped_dependencies = {}
63+
for dep in dependencies:
64+
if dep.key in grouped_dependencies:
65+
grouped_dependencies[dep.key].append(dep)
66+
else:
67+
grouped_dependencies[dep.key] = [dep]
68+
69+
final_dependencies = [combine_requirements(r) for r in grouped_dependencies.values()]
70+
71+
print("\n".join(final_dependencies))

common/smoketest/smoke-test.yml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,58 +9,58 @@ jobs:
99
PythonVersion: '2.7'
1010
InstallAsyncRequirements: false
1111
OSVmImage: ubuntu-18.04
12-
CloudType: AzureCloud
12+
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
1313
ArmTemplateParameters: $(azureCloudArmParameters)
1414
Python_37_Linux (AzureCloud):
1515
PythonVersion: '3.7'
1616
OSVmImage: ubuntu-18.04
17-
CloudType: AzureCloud
17+
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
1818
ArmTemplateParameters: $(azureCloudArmParameters)
1919
Python_38_Linux (AzureCloud):
2020
PythonVersion: '3.8'
2121
OSVmImage: ubuntu-18.04
22-
CloudType: AzureCloud
22+
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
2323
ArmTemplateParameters: $(azureCloudArmParameters)
2424
Python_37_Windows (AzureCloud):
2525
PythonVersion: '3.7'
2626
OSVmImage: windows-2019
27-
CloudType: AzureCloud
27+
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
2828
ArmTemplateParameters: $(azureCloudArmParameters)
2929
Python_38_Windows (AzureCloud):
3030
PythonVersion: '3.8'
3131
OSVmImage: windows-2019
32-
CloudType: AzureCloud
32+
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
3333
ArmTemplateParameters: $(azureCloudArmParameters)
3434
Python_37_Mac (AzureCloud):
3535
PythonVersion: '3.7'
3636
OSVmImage: macOS-10.15
37-
CloudType: AzureCloud
37+
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
3838
ArmTemplateParameters: $(azureCloudArmParameters)
3939
Python_38_Mac (AzureCloud):
4040
PythonVersion: '3.8'
4141
OSVmImage: macOS-10.15
42-
CloudType: AzureCloud
42+
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
4343
ArmTemplateParameters: $(azureCloudArmParameters)
4444
Python_38_Linux (AzureUSGovernment):
4545
PythonVersion: '3.8'
4646
OSVmImage: ubuntu-18.04
47-
CloudType: AzureUSGovernment
47+
SubscriptionConfiguration: $(sub-config-gov-test-resources)
4848
ArmTemplateParameters: $(azureUSGovernmentArmParameters)
4949
Python_37_Windows (AzureUSGovernment):
5050
PythonVersion: '3.7'
5151
OSVmImage: windows-2019
52-
CloudType: AzureUSGovernment
52+
SubscriptionConfiguration: $(sub-config-gov-test-resources)
5353
ArmTemplateParameters: $(azureUSGovernmentArmParameters)
5454
Python_38_Linux (AzureChinaCloud):
5555
PythonVersion: '3.8'
5656
OSVmImage: ubuntu-18.04
57-
CloudType: AzureChinaCloud
57+
SubscriptionConfiguration: $(sub-config-cn-test-resources)
5858
Location: 'chinanorth'
5959
ArmTemplateParameters: $(azureChinaCloudArmParameters)
6060
Python_37_Windows (AzureChinaCloud):
6161
PythonVersion: '3.7'
6262
OSVmImage: windows-2019
63-
CloudType: AzureChinaCloud
63+
SubscriptionConfiguration: $(sub-config-cn-test-resources)
6464
Location: 'chinanorth'
6565
ArmTemplateParameters: $(azureChinaCloudArmParameters)
6666

@@ -84,29 +84,34 @@ jobs:
8484
pip --version
8585
displayName: pip --version
8686
87-
- script: pip install packaging pkginfo
88-
displayName: Install requirements for dev tools
89-
90-
- script: pip install -r ./common/smoketest/requirements.txt
91-
displayName: "Install requirements.txt"
87+
- script: pip install -r ./common/smoketest/requirements.txt --pre --no-deps --index-url https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple
88+
displayName: Install requirements from dev feed without dependencies
9289

9390
- script: pip install -r ./common/smoketest/requirements_async.txt
9491
displayName: "Install requirements_async.txt"
9592
condition: and(succeeded(), eq(variables['InstallAsyncRequirements'], 'true'))
9693

97-
- script: python ./eng/tox/install_dev_build_dependency.py -r ./common/smoketest/requirements.txt
98-
displayName: "Install dev dependencies from feed"
94+
- script: python ./common/smoketest/dependencies.py -r ./common/smoketest/requirements.txt | tee ./common/smoketest/requirements_dependencies.txt
95+
displayName: Create dependency list from installed dev packages
96+
97+
- script: pip install -r ./common/smoketest/requirements_dependencies.txt
98+
displayName: Install dev package dependencies from PyPI
99+
100+
- script: pip freeze
101+
displayName: Show installed packages (pip freeze)
99102

100103
- template: /eng/common/TestResources/deploy-test-resources.yml
101104
parameters:
102105
ServiceDirectory: '$(Build.SourcesDirectory)/common/smoketest/'
103-
CloudType: $(CloudType)
106+
SubscriptionConfiguration: $(SubscriptionConfiguration)
104107
Location: $(Location)
105108
ArmTemplateParameters: $(ArmTemplateParameters)
106109

107110
- script: python ./common/smoketest/program.py
108-
displayName: "Run Smoke Test"
111+
displayName: Run Smoke Test
109112

110113
- template: /eng/common/TestResources/remove-test-resources.yml
111114
parameters:
112115
ServiceDirectory: '$(Build.SourcesDirectory)/common/smoketest/'
116+
SubscriptionConfiguration: $(SubscriptionConfiguration)
117+

doc/dev/mgmt/generating-integration-test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ now you can run live integration test:
127127
128128
## Fixing Test
129129

130-
It's obvious that when running test for the first time someting is not going to work.
130+
It's obvious that when running test for the first time something is not going to work.
131131

132132
The best approach is to:
133133
- fix the test manually

doc/dev/mgmt/generation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ IMPORTANT NOTE: All the commands prefixed by `python` in this page assumes you h
88

99
### Autorest versioning
1010

11-
A few notes on [Autorest for Python versionning](https://github.com/Azure/autorest.python/blob/master/ChangeLog.md):
11+
A few notes on [Autorest for Python versioning](https://github.com/Azure/autorest.python/blob/master/ChangeLog.md):
1212
- Autorest for Python v2.x is deprecated, and should not be used anymore for any generation under any circumstances.
1313
- Autorest for Python v3.x is the most currently used one. Should not be used, but still ok if service team are still in v3.x and they want to avoid breaking changes for a given version (rare).
1414
- Autorest for Python v4.x is the current recommendation. This generator can generates async code, but this should be disabled with --no-async. No package should be shipped with async based on v4

doc/dev/mgmt/multiapi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Because there is different flavors of Azure that are not necessarly provided wit
1414

1515
### Why a multi-api package?
1616

17-
Indeed, a simple solution would be to write down explictly what version of SDK supports what API version. Example: 1.0 supports 2015-06-01, 2.0 supports 2017-07-01, etc. The story for customers then would be to pin the specific SDK version for the specific API version they need. However, this was considered unacceptable in an end-to-end scenario:
17+
Indeed, a simple solution would be to write down explicitly what version of SDK supports what API version. Example: 1.0 supports 2015-06-01, 2.0 supports 2017-07-01, etc. The story for customers then would be to pin the specific SDK version for the specific API version they need. However, this was considered unacceptable in an end-to-end scenario:
1818
- It means you cannot install in the same Python environment packages that would target different cloud (Python doesn't allow installation of different versions of the same package together). Azure CLI or Ansible supports for different clouds would then be extremely complicated.
1919
- This forces customers to use old SDK, that might have been fixed on different axis than API version (security fixes, new SDK features like async, etc.)
2020
- Customers rarely needs only one package, but a set of them (storage, compute, network, etc.) and having to keep track of the correct list of packages is challenging.
@@ -44,7 +44,7 @@ Network interfaces operations are defines in a [network interface file](https://
4444

4545
**Python multi-api packaging is based on the assumptions that it's true.** If it's not, it's usually ok but requires a little more subtle packaging (see final section here)
4646

47-
Being that a given Swagger defines only *one* fixed API version, doing multi-api version in one package implies shipping several Swagger files into one package. This is achived by the `batch` directive of Autorest. More details on how to write Readme for Swagger in the specific page for it [swagger_conf.md](./swagger_conf.md).
47+
Being that a given Swagger defines only *one* fixed API version, doing multi-api version in one package implies shipping several Swagger files into one package. This is archived by the `batch` directive of Autorest. More details on how to write Readme for Swagger in the specific page for it [swagger_conf.md](./swagger_conf.md).
4848

4949
Python SDK team is responsible to design the correct set of tags to set for the `batch` node. Each line of the batch directive should contains only *one* api version to match the folder name used. this might require adding new tags in the readme.md that are specific to only one API version. These tags are usually suffixed by "-only" ([example with compute](https://github.com/Azure/azure-rest-api-specs/tree/master/specification/compute/resource-manager#tag-package-2019-03-01-only))
5050

doc/dev/mgmt/swagger_conf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In practical terms, we want to control the version of Autorest used, the output
1414

1515
## Writing the readme
1616

17-
Writing the readme is the responsability of the Python SDK team. There is currently two types of templates for Python readmes:
17+
Writing the readme is the responsibility of the Python SDK team. There is currently two types of templates for Python readmes:
1818
- Readme that handles only one API version, and generates packages that handle one API version only
1919
- Readme that handles several API versions, and generates packages with multiples API and profile supports
2020

doc/sphinx/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
'trio': ('https://trio.readthedocs.io/en/stable/', None),
6868
'msal': ('https://msal-python.readthedocs.io/en/latest/', None),
6969
# Azure packages
70-
'azure-core': ('https://azuresdkdocs.blob.core.windows.net/$web/python/azure-core/1.1.1/', None),
71-
'azure-identity': ('https://azuresdkdocs.blob.core.windows.net/$web/python/azure-identity/1.1.0/', None),
70+
'azure-core': ('https://azuresdkdocs.blob.core.windows.net/$web/python/azure-core/latest/', None),
71+
'azure-identity': ('https://azuresdkdocs.blob.core.windows.net/$web/python/azure-identity/latest/', None),
7272
}
7373

7474
autodoc_member_order = 'groupwise'

eng/.docsettings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ known_content_issues:
7878
- ['sdk/graphrbac/azure-graphrbac/README.md', '#4554']
7979
- ['sdk/loganalytics/azure-loganalytics/README.md', '#4554']
8080
- ['sdk/servicebus/azure-servicebus/README.md', '#4554']
81+
- ['sdk/servicebus/azure-servicebus/swagger/README.md', '#4554']
8182
- ['sdk/servicefabric/azure-servicefabric/README.md', '#4554']
8283
- ['sdk/storage/azure-storage-nspkg/README.md', '#4554']
8384
- ['sdk/storage/azure-storage-blob/swagger/README.md', '#4554']

eng/autorest_req.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
pytest==5.4.1; python_version >= '3.5'
1+
pytest==5.4.2; python_version >= '3.5'
22
pytest==4.6.9; python_version == '2.7'
33
pytest-cov==2.8.1
4-
pytest-asyncio==0.10.0; python_version >= '3.5'
4+
pytest-asyncio==0.12.0; python_version >= '3.5'
55
isodate==0.6.0
6-
msrest==0.6.13
6+
msrest==0.6.14
77
aiohttp==3.6.2
8-
wheel
8+
wheel==0.34.2

eng/ci_tools.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ setuptools==44.1.0; python_version == '2.7'
33
setuptools==45.1.0; python_version >= '3.5'
44
wheel==0.34.2
55
Jinja2==2.11.1
6-
packaging==20.3
6+
packaging==20.4
77
tox==3.14.6
88
tox-monorepo==0.1.2
99
twine==1.15.0

eng/common/TestResources/New-TestResources.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ if ($ProvisionerApplicationId) {
156156
}
157157

158158
$provisionerAccount = Retry {
159-
Connect-AzAccount -Tenant $TenantId -Credential $provisionerCredential -ServicePrincipal -Environment $Environment @subscriptionArgs
159+
Connect-AzAccount -Force:$Force -Tenant $TenantId -Credential $provisionerCredential -ServicePrincipal -Environment $Environment @subscriptionArgs
160160
}
161161

162162
$exitActions += {

0 commit comments

Comments
 (0)