Skip to content

Commit 1deb525

Browse files
committed
merge mono master
2 parents a109f4a + c695902 commit 1deb525

File tree

2,655 files changed

+606488
-139460
lines changed

Some content is hidden

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

2,655 files changed

+606488
-139460
lines changed

.github/CODEOWNERS

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
###########
77

88
# Catch all
9-
/sdk/ @mayurid
9+
/sdk/ @mayurid @lmazuel
1010

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

1515
# Service team
1616
/sdk/identity/ @chlowell @schaabs
@@ -37,7 +37,7 @@
3737
/sql/sql/ @jaredmoo
3838
/sdk/servicebus/ @annatisch @yunhaoling @YijunXieMS @KieranBrantnerMagee
3939
/sdk/synapse/ @aim-for-better @idear1203
40-
/sdk/textanalytics/ @kristapratico
40+
/sdk/textanalytics/ @kristapratico @iscai-msft
4141

4242
# Management Plane
4343
/**/*mgmt*/ @zikalino

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ Libraries which enable you to provision specific resources. They are responsible
4343
* File an issue via [Github Issues](../../issues)
4444
* Check [previous questions](https://stackoverflow.com/questions/tagged/azure+python) or ask new ones on StackOverflow using `azure` and `python` tags.
4545

46+
### Community
47+
48+
* Chat with other community members [![Join the chat at https://gitter.im/azure/azure-sdk-for-python](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/azure/azure-sdk-for-python?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
49+
4650
### Reporting security issues and security bugs
4751

4852
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <[email protected]>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://www.microsoft.com/msrc/faqs-report-an-issue).

common/smoketest/event_hubs_async.py

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ async def send_and_receive_events(self, partition_id):
5454
# on_event will close the consumer_client which resumes execution
5555
on_event=self.on_event,
5656
on_error=self.on_error,
57-
timeout=RECEIVE_TIMEOUT,
5857
starting_position=STARTING_POSITION
5958
)
6059

common/smoketest/key_vault_certificates.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def __init__(self):
1414
# * AZURE_CLIENT_ID
1515
# * AZURE_CLIENT_SECRET
1616
# * AZURE_TENANT_ID
17-
credential = DefaultAzureCredential()
17+
authority_host = os.environ.get('AZURE_AUTHORITY_HOST') or KnownAuthorities.AZURE_PUBLIC_CLOUD
18+
credential = DefaultAzureCredential(authority=authority_host)
1819
self.certificate_client = CertificateClient(
1920
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
2021
)

common/smoketest/key_vault_certificates_async.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def __init__(self):
1414
# * AZURE_CLIENT_ID
1515
# * AZURE_CLIENT_SECRET
1616
# * AZURE_TENANT_ID
17-
credential = DefaultAzureCredential()
17+
authority_host = os.environ.get('AZURE_AUTHORITY_HOST') or KnownAuthorities.AZURE_PUBLIC_CLOUD
18+
credential = DefaultAzureCredential(authority=authority_host)
1819
self.certificate_client = CertificateClient(
1920
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
2021
)

common/smoketest/key_vault_keys.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def __init__(self):
1414
# * AZURE_CLIENT_ID
1515
# * AZURE_CLIENT_SECRET
1616
# * AZURE_TENANT_ID
17-
credential = DefaultAzureCredential()
17+
authority_host = os.environ.get('AZURE_AUTHORITY_HOST') or KnownAuthorities.AZURE_PUBLIC_CLOUD
18+
credential = DefaultAzureCredential(authority=authority_host)
1819
self.key_client = KeyClient(
1920
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
2021
)

common/smoketest/key_vault_keys_async.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def __init__(self):
1414
# * AZURE_CLIENT_ID
1515
# * AZURE_CLIENT_SECRET
1616
# * AZURE_TENANT_ID
17-
credential = DefaultAzureCredential()
17+
authority_host = os.environ.get('AZURE_AUTHORITY_HOST') or KnownAuthorities.AZURE_PUBLIC_CLOUD
18+
credential = DefaultAzureCredential(authority=authority_host)
1819
self.key_client = KeyClient(
1920
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
2021
)

common/smoketest/key_vault_secrets.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def __init__(self):
1414
# * AZURE_CLIENT_ID
1515
# * AZURE_CLIENT_SECRET
1616
# * AZURE_TENANT_ID
17-
credential = DefaultAzureCredential()
17+
authority_host = os.environ.get('AZURE_AUTHORITY_HOST') or KnownAuthorities.AZURE_PUBLIC_CLOUD
18+
credential = DefaultAzureCredential(authority=authority_host)
1819
self.secret_client = SecretClient(
1920
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
2021
)

common/smoketest/key_vault_secrets_async.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def __init__(self):
1414
# * AZURE_CLIENT_ID
1515
# * AZURE_CLIENT_SECRET
1616
# * AZURE_TENANT_ID
17-
credential = DefaultAzureCredential()
17+
authority_host = os.environ.get('AZURE_AUTHORITY_HOST') or KnownAuthorities.AZURE_PUBLIC_CLOUD
18+
credential = DefaultAzureCredential(authority=authority_host)
1819
self.secret_client = SecretClient(
1920
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
2021
)

common/smoketest/smoke_test_async.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from storage_blob_async import StorageBlobAsync
1111

1212

13-
def execute_async_smoke_tests:
13+
def execute_async_smoke_tests():
1414
print("")
1515
print("==========================================")
1616
print(" AZURE TRACK 2 SDKs SMOKE TEST ASYNC")

doc/dev/mgmt/cheatsheet.md

+17-6
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@ For all packages:<br/>
2020
`python ./scripts/dev_setup.py`
2121

2222
For a specific package:<br/>
23-
`python ./scripts/dev_setup.py -p azure-mgmt-servicename`
23+
24+
```shell
25+
export PACKAGE=azure-mgmt-servicename
26+
python ./scripts/dev_setup.py -p $PACKAGE
27+
```
2428

2529
## Generate tags for multi-api Swagger Readme
2630

2731
`python ./scripts/multi_api_readme_help.py /azure-rest-api-specs/specification/service/resource-manager/`
2832

2933
## Generate a package
3034

31-
`python -m packaging_tools.generate_sdk -v -m restapi_path/readme.md`
35+
```shell
36+
python -m packaging_tools.generate_sdk -v -m restapi_path/readme.md
37+
```
3238

3339
Regenerate multi-api client:<br/>
3440
`python ./scripts/multiapi_init_gen.py azure-mgmt-myservice`
@@ -60,11 +66,16 @@ Available options:
6066

6167
## ChangeLog
6268

63-
Generate code report for last version on PyPI:<br/>`python -m packaging_tools.code_report --last-pypi azure-mgmt-myservice`
64-
65-
Generate code report for version installed in current venv:<br/>`python -m packaging_tools.code_report azure-mgmt-myservice`
69+
Changelog is generated by performing following steps:
70+
- generate code report for last version on PyPI:
71+
- generate code report for version installed in current venv
72+
- generate a markdown changelog
6673

67-
Generate a markdown changelog:<br/>`python -m packaging_tools.change_log ./old_version_report.json ./new_version_report.json`
74+
```shell
75+
python -m packaging_tools.code_report --last-pypi $PACKAGE --output=$HOME/old.json
76+
python -m packaging_tools.code_report $PACKAGE --output=$HOME/new.json
77+
python -m packaging_tools.change_log $HOME/old.json $HOME/new.json
78+
```
6879

6980
## Tests
7081

doc/sphinx/_static/js/get_options.js

+16-27
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,11 @@ function hideSelectors(selectors){
4545

4646
function populateOptions(optionSelector, otherSelectors){
4747
if(currentPackage()){
48-
var versionRequestUrl = "https://azuresdkdocs.blob.core.windows.net/$web?restype=container&comp=list&prefix=" + SELECTED_LANGUAGE + "/" + currentPackage() + "/versions/"
48+
var versionRequestUrl = "https://azuresdkdocs.blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/" + currentPackage() + "/versioning/versions"
4949

5050
httpGetAsync(versionRequestUrl, function(responseText){
5151
if(responseText){
52-
data_stored = responseText
53-
54-
parser = new DOMParser();
55-
xmlDoc = parser.parseFromString(responseText,"text/xml");
56-
57-
nameElements = Array.from(xmlDoc.getElementsByTagName('Name'))
58-
options = []
59-
60-
for (var i in nameElements){
61-
options.push(nameElements[i].textContent.split('/')[3])
62-
}
52+
options = responseText.match(/[^\r\n]+/g)
6353

6454
populateVersionDropDown(optionSelector, options)
6555
showSelectors(otherSelectors)
@@ -77,14 +67,21 @@ function populateOptions(optionSelector, otherSelectors){
7767
}
7868

7969
function populateVersionDropDown(selector, values){
80-
var select = $(selector);
81-
82-
$('option', select).remove();
70+
var select = $(selector)
71+
72+
$('option', select).remove()
8373

8474
$.each(values, function(index, text) {
85-
$('<option/>', { 'value' : text, 'text': text }).appendTo(select);
75+
$('<option/>', { 'value' : text, 'text': text }).appendTo(select)
8676
});
87-
select.val(currentVersion());
77+
78+
var version = currentVersion()
79+
if(version==='latest'){
80+
select.selectedIndex = 0
81+
}
82+
else {
83+
select.val(version)
84+
}
8885
}
8986

9087
function getPackageUrl(language, package, version){
@@ -93,19 +90,11 @@ function getPackageUrl(language, package, version){
9390

9491
function populateIndexList(selector, packageName)
9592
{
96-
url = "https://azuresdkdocs.blob.core.windows.net/$web?restype=container&comp=list&prefix=" + SELECTED_LANGUAGE + "/" + packageName + "/versions/"
93+
url = "https://azuresdkdocs.blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/" + packageName + "/versioning/versions"
9794

9895
httpGetAsync(url, function (responseText){
9996
if(responseText){
100-
parser = new DOMParser();
101-
xmlDoc = parser.parseFromString(responseText,"text/xml");
102-
103-
nameElements = Array.from(xmlDoc.getElementsByTagName('Name'))
104-
options = []
105-
106-
for (var i in nameElements){
107-
options.push(nameElements[i].textContent.split('/')[3])
108-
}
97+
options = responseText.match(/[^\r\n]+/g)
10998

11099
for (var i in options){
111100
$(selector).append('<li><a target="new" href="' + getPackageUrl(SELECTED_LANGUAGE, packageName, options[i]) + '">' + options[i] + '</a></li>')

doc/sphinx/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
intersphinx_mapping = {
6161
# Dependencies
62-
'python': ('https://docs.python.org/3.8', None),
62+
'python': ('https://docs.python.org/3.8', ('/usr/share/doc/python3-doc/html/objects.inv', None)),
6363
'msrestazure': ('http://msrestazure.readthedocs.io/en/latest/', None),
6464
'msrest': ('http://msrest.readthedocs.io/en/latest/', None),
6565
'requests': ('https://requests.kennethreitz.org/en/master/', None),

doc/sphinx/generate_versioned_index.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
root_dir = os.path.abspath(os.path.join(location, "..", ".."))
2626
docs_folder = os.path.join(root_dir, '_docs')
2727
index = os.path.join(location, 'index.rst')
28+
# packages that don't exist in source, but still need to be shown
29+
STATIC_INCLUSION_LIST = ['azure-search']
2830

2931
TOC_TEMPLATE = """
3032
.. toctree::
@@ -108,7 +110,7 @@ def get_repo_packages(base_dir):
108110
)
109111
]
110112

111-
packages = [p for p in packages if check_package_against_omission(p)]
113+
packages = [p for p in packages if check_package_against_omission(p)] + STATIC_INCLUSION_LIST
112114

113115
return sorted(packages)
114116

doc/sphinx/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Installation
22
============
33

4-
This content has moved to https://docs.microsoft.com/python/azure/python-sdk-azure-install
4+
This content has moved to https://docs.microsoft.com/en-us/azure/python/azure-sdk-install

doc/sphinx/package_service_mapping.json

+10
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,16 @@
861861
"service_name": "Cosmos",
862862
"manually_generated": true
863863
},
864+
"azure-search-documents": {
865+
"category": "Client",
866+
"service_name": "Search",
867+
"manually_generated": true
868+
},
869+
"azure-search": {
870+
"category": "Client",
871+
"service_name": "Search",
872+
"manually_generated": true
873+
},
864874
"azure-keyvault-keys": {
865875
"category": "Client",
866876
"service_name": "Keyvault",

eng/.docsettings.yml

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ known_content_issues:
105105
- ['sdk/core/azure-mgmt-nspkg/README.rst', 'nspkg and common']
106106
- ['sdk/core/azure-nspkg/README.rst', 'nspkg and common']
107107
- ['sdk/keyvault/azure-keyvault-nspkg/README.md', 'nspkg and common']
108+
- ['sdk/search/azure-search-nspkg/README.md', 'nspkg and common']
108109
- ['sdk/storage/azure-storage-blob/samples/README.md', 'nspkg and common']
109110
- ['sdk/storage/azure-storage-file-datalake/samples/README.md', 'nspkg and common']
110111
- ['sdk/storage/azure-storage-file-share/samples/README.md', 'nspkg and common']

eng/ci_tools.txt

+33-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
1-
setuptools
2-
wheel
3-
Jinja2
4-
packaging
5-
tox
6-
tox-monorepo
7-
twine
8-
importlib-resources==1.0.2
9-
pathlib
10-
readme-renderer[md]
11-
doc-warden==0.5.0
1+
# requirements leveraged by ci tools
2+
setuptools==44.1.0; python_version == '2.7'
3+
setuptools==45.1.0; python_version >= '3.5'
4+
wheel==0.34.2
5+
Jinja2==2.11.1
6+
packaging==20.3
7+
tox==3.14.6
8+
tox-monorepo==0.1.2
9+
twine==1.15.0
10+
pathlib2==2.3.5
11+
readme-renderer[md]==25.0
12+
doc-warden==0.5.3
1213
coverage==4.5.4
13-
codecov
14-
beautifulsoup4
15-
pkginfo
16-
idna==2.8
14+
codecov==2.0.22
15+
beautifulsoup4==4.8.2
16+
pkginfo==1.5.0.1
17+
18+
# locking packages defined as deps from azure-sdk-tools or azure-devtools
19+
pytoml==0.1.21
20+
pyOpenSSL==19.1.0
21+
json-delta==2.0
22+
ConfigArgParse==1.1
23+
six==1.14.0
24+
vcrpy==3.0.0
25+
pyyaml==5.3.1
26+
pytest==5.4.1; python_version >= '3.5'
27+
pytest==4.6.9; python_version == '2.7'
28+
pytest-cov==2.8.1
29+
30+
# local dev packages
1731
./tools/azure-devtools
18-
./tools/azure-sdk-tools
32+
./tools/azure-sdk-tools
33+
34+
35+

eng/common/Extract-ReleaseNotes.ps1

+1-10
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,7 @@ else
5656
if ($releaseNotes.ContainsKey($VersionString))
5757
{
5858
$releaseNotesForVersion = $releaseNotes[$VersionString].ReleaseContent
59-
$releaseNotesArray = $releaseNotesForVersion.Split([Environment]::NewLine)
60-
$processedNotes = New-Object System.Collections.ArrayList
61-
foreach ($line in $releaseNotesArray)
62-
{
63-
$lineIsTitle = $line.Startswith('#') -And ($line -match $RELEASE_TITLE_REGEX)
64-
if (-Not $lineIsTitle)
65-
{
66-
$processedNotes.Add($line) > $null
67-
}
68-
}
59+
$processedNotes = $releaseNotesForVersion -Split [Environment]::NewLine | where { $_ -notmatch $RELEASE_TITLE_REGEX }
6960
return $processedNotes -Join [Environment]::NewLine
7061
}
7162
Write-Error "Release Notes for the Specified version ${VersionString} was not found"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
3+
REM Copyright (c) Microsoft Corporation. All rights reserved.
4+
REM Licensed under the MIT License.
5+
6+
setlocal
7+
8+
for /f "usebackq delims=" %%i in (`where pwsh 2^>nul`) do (
9+
set _cmd=%%i
10+
)
11+
12+
if "%_cmd%"=="" (
13+
echo Error: PowerShell not found. Please visit https://github.com/powershell/powershell for install instructions.
14+
exit /b 2
15+
)
16+
17+
call "%_cmd%" -NoLogo -NoProfile -File "%~dpn0.ps1" %*

0 commit comments

Comments
 (0)