Skip to content

Commit 3d4176c

Browse files
authored
[Template][Docs] Update template files (Azure#30305)
These are updated to more accurately reflect the current state of things. Signed-off-by: Paul Van Eck <[email protected]>
1 parent 17b0d06 commit 3d4176c

File tree

11 files changed

+153
-17
lines changed

11 files changed

+153
-17
lines changed

doc/dev/packaging.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Azure packaging
22

3+
[comment]: # ( cspell:ignore myservice )
4+
35
This article describes the recommendations for defining namespace packaging to release a package inside the `azure` namespace. Being inside the `azure` namespace means that a service `myservice` can be imported using:
46
```python
57
import azure.myservice
@@ -115,6 +117,7 @@ setup(
115117
'Programming Language :: Python :: 3.8',
116118
'Programming Language :: Python :: 3.9',
117119
'Programming Language :: Python :: 3.10',
120+
'Programming Language :: Python :: 3.11',
118121
'License :: OSI Approved :: MIT License',
119122
],
120123
python_requires=">=3.7",
@@ -144,7 +147,7 @@ Since the package is Python 3 only, do NOT make this wheel universal. This usual
144147

145148
# I already have a package that supports Python 2, can I get short version on how to udpate to Python 3 only?
146149

147-
- Remove "universal" from setup.cfg, or completly remove the file if it was the only option
150+
- Remove "universal" from setup.cfg, or completely remove the file if it was the only option
148151
- In setup.py:
149152
- Remove `extra_requires`
150153
- Add `python_requires=">=3.7",`
@@ -184,4 +187,4 @@ The "extras_requires" section MUST include a conditional dependency on "azure-ns
184187
}
185188
```
186189

187-
An additional verification is that wheels installs `azure-nskpg` ONLY on Python 2.
190+
An additional verification is that wheels installs `azure-nspkg` ONLY on Python 2.
Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,63 @@
11
# Release History
22

3+
[comment]: # (Change log guidance: https://azure.github.io/azure-sdk/policies_releases.html#changelog-guidance)
4+
5+
## 0.0.18 (Unreleased)
6+
7+
### Features Added
8+
9+
- Some feature
10+
11+
### Breaking Changes
12+
13+
- Some breaking change
14+
15+
### Bugs Fixed
16+
17+
- Some bug fix
18+
19+
### Other Changes
20+
21+
- Some other change
22+
323
## 0.0.18b2 (2020-09-04)
24+
25+
### Bugs Fixed
26+
427
- Testing release tag version
528

629
## 0.0.13b1 (2020-08-27)
30+
31+
### Bugs Fixed
32+
733
- Testing out some alpha and beta versioning
834

935
## 0.0.7 (2020-07-02)
36+
37+
### Bugs Fixed
38+
1039
- Test a successful Release
1140

1241
## 0.0.6 (2020-05-20)
42+
43+
### Bugs Fixed
44+
1345
- Test a successful Release
1446

1547
## 0.0.5 (2020-05-20)
48+
49+
### Bugs Fixed
50+
1651
- Test a successful Release
1752

1853
## 0.0.2 (2020-03-24)
54+
55+
### Bugs Fixed
56+
1957
- Test Release Pipeline
2058

2159
## 0.0.1 (2019-10-06)
22-
- Template package
60+
61+
### Features Added
62+
63+
- Template package

sdk/template/azure-template/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/azure-sdk-for-python.client?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=46?branchName=master)
1+
[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/472?branchName=main)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=472)
22

33
# Azure Template Package client library for Python
44

5-
This template package matches necessary patterns that the development team has established to create a unified sdk functional from Python 2.7 onwards. The packages contained herein can be installed singly or as part of the `azure` namespace. Any other introductory text should go here.
5+
This template package matches necessary patterns that the development team has established to create a unified SDK. The packages contained herein can be installed singly or as part of the `azure` namespace. Any other introductory text should go here.
66

7-
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8
7+
This package has been tested with Python 3.7+.
88

9-
For a more complete set of Azure libraries, see https://aka.ms/azsdk/python/all
9+
For a more complete set of Azure libraries, see https://aka.ms/azsdk/python/all.
1010

1111
# Getting started
1212

sdk/template/azure-template/azure/template/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# -------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
# --------------------------------------------------------------------------
16
from ._version import VERSION
27
from .template_code import template_main
38

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
# -------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
# --------------------------------------------------------------------------
6+
17
# matches SEMVER
28
VERSION = "0.0.18b3"
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
def template_main():
1+
# -------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
# --------------------------------------------------------------------------
6+
7+
8+
def template_main() -> bool:
29
print("Package code.")
3-
return True
10+
return True
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[tool.azure-sdk-build]
2-
pylint=false
3-
verifytypes = false
2+
mypy = true
3+
type_check_samples = true
4+
verifytypes = true
5+
pyright = true
6+
pylint = true
7+
black = true
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- python
5+
products:
6+
- azure
7+
- azure-template
8+
urlFragment: azure-template-samples
9+
---
10+
11+
# Azure Template samples
12+
13+
Provide an overview of all the samples and explain how to run them.
14+
15+
For guidance on the samples README, visit the [sample guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/sample_guide.md#package-sample-readme).
16+
17+
18+
|**File Name**|**Description**|
19+
|----------------|-------------|
20+
|[sample_simple.py][sample_simple] | Run template sample method |
21+
22+
## Prerequisites
23+
24+
* Python 3.7 or later is required to use this package.
25+
26+
## Setup
27+
28+
1. Install the Azure Template client library for Python with [pip][pip]:
29+
30+
```sh
31+
pip install azure-template
32+
```
33+
34+
2. Clone or download the repository containing this sample code. Alternatively, you can download the sample file directly.
35+
36+
## Running the samples
37+
38+
Navigate to the directory that the sample(s) are saved in, and follow the usage described in the file. For example, `python sample_simple.py`.
39+
40+
## Next steps
41+
42+
Link the API reference docs for your package in this section.
43+
44+
<!-- Links -->
45+
46+
[sample_simple]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/template/azure-template/samples/sample_simple.py
47+
[pip]: https://pypi.org/project/pip/

sdk/template/azure-template/samples/sample_simple.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1+
# -------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
# -------------------------------------------------------------------------
6+
17
"""
2-
See https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/sample_guide.md
8+
FILE: sample_simple.py
9+
10+
DESCRIPTION:
11+
This sample demonstrates how to run the template method from the template package. Here, you should
12+
explain what the sample does and what setup is necessary to run it.
13+
14+
See https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/sample_guide.md for more details.
15+
16+
USAGE:
17+
python sample_simple.py
318
"""
419

520
from azure.template import template_main
621

7-
def simple_sample():
22+
23+
def simple_sample() -> None:
824
print("Running simple sample")
925
template_main()
1026
print("Completed running simple sample")

sdk/template/azure-template/setup.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#!/usr/bin/env python
2+
3+
# -------------------------------------------------------------------------
4+
# Copyright (c) Microsoft Corporation. All rights reserved.
5+
# Licensed under the MIT License. See License.txt in the project root for
6+
# license information.
7+
# --------------------------------------------------------------------------
8+
19
from setuptools import setup, find_packages
210
import os
311
from io import open
@@ -8,7 +16,7 @@
816
# your package.
917

1018
# this setup.py is set up in a specific way to keep the azure* and azure-mgmt-* namespaces WORKING all the way
11-
# up from python 2.7. Reference here: https://github.com/Azure/azure-sdk-for-python/wiki/Azure-packaging
19+
# up from python 2.7. Reference here: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/packaging.md
1220

1321
PACKAGE_NAME = "azure-template"
1422
PACKAGE_PPRINT_NAME = "Template Package"
@@ -49,6 +57,7 @@
4957
"Programming Language :: Python :: 3.8",
5058
"Programming Language :: Python :: 3.9",
5159
"Programming Language :: Python :: 3.10",
60+
"Programming Language :: Python :: 3.11",
5261
"License :: OSI Approved :: MIT License",
5362
],
5463
packages=find_packages(
@@ -63,7 +72,7 @@
6372
),
6473
include_package_data=True,
6574
package_data={
66-
'azure.template': ['py.typed'],
75+
"azure.template": ["py.typed"],
6776
},
6877
install_requires=[
6978
"azure-core<2.0.0,>=1.10.0",

0 commit comments

Comments
 (0)