Skip to content

Commit 963c54a

Browse files
authored
Update build (#99)
* Remove travis CI file. Add RST check. Add RST file. * Force failure (test) * Add build step to ADO pipeline. * Code review feedback
1 parent 508849e commit 963c54a

File tree

10 files changed

+185
-26
lines changed

10 files changed

+185
-26
lines changed

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

HISTORY.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@ Release History
44
===============
55

66
0.1.0
7-
+++++
7+
++++++
88
* Update for compatability with azure-cli 2.0.68's new package structure.
99
* BREAKING CHANGE: Removed `azdev cli update-setup`. Package changes to azure-cli no longer require this.
1010
* BREAKING CHANGE: `azdev verify history` and `azdev cli check-versions` no longer accept any arguments. Since there are
1111
now far fewer modules, these were deemed unnecessary.
1212

1313
0.0.6
14-
+++++
14+
++++++
1515
* Added new commands `azdev cli create` and `azdev extension create` to scaffold new modules/extensions.
1616
* `azdev setup`: Tweaks to interactive experience.
1717
* `azdev test`: Fix issue where using `--profile` did not use the correct index.
1818
Changed the behavior to switch back to the original profile upon completion of tests.
1919

2020
0.0.5
21-
+++++
21+
++++++
2222
* Fix issue where `azdev cli check-versions` did not accept the short form of a module name.
2323
* Update `azdev cli check-versions` to allow modules as a positional argument, consistent with other azdev commands.
2424
* Fix issue where `azdev test --discover` could result in a stack trace when a virtual environment exists within an extensions repo.
2525

2626
0.0.4
27-
+++++
27+
++++++
2828
* Fix critical bug in `azdev setup`.
2929

3030
0.0.3
31-
+++++
31+
++++++
3232
* Adds new commands `azdev extension build` and `azdev extension publish` to simplify extension publishing.
3333
* Updates default exclusions for `azdev linter` when used on extensions.
3434
* Adds a `--ci-exclusions` flag to `azdev linter` to emulate CI mode when run locally.
3535
* Fix issue where `azdev test --discover` could result in a stack trace when a virtual environment exists within a cloned repo.
3636
* Tweaks thresholds for `azdev per load-times`.
3737

3838
0.0.2
39-
+++++
39+
++++++
4040

4141
* Changes the behavior of `azdev test` to, by default, run tests on everything to be consistent with commands like `azdev style` and `azdev linter`.
4242
* Removes `azdev verify version` and splits into two commands `azdev cli check-versions` and `azdev cli update-setup`.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Microsoft Azure CLI Dev Tools (azdev)
22

3+
[![Python](https://img.shields.io/pypi/pyversions/azure-cli.svg?maxAge=2592000)](https://pypi.python.org/pypi/azdev)
4+
[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/cli/Azure.azure-cli-dev-tools?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=604&branchName=master)
5+
36
The `azdev` tool is designed to aid new and experienced developers in contributing to Azure CLI command modules and extensions.
47

58
## Setting up your development environment
@@ -37,7 +40,7 @@ The `azdev` tool is designed to aid new and experienced developers in contributi
3740
env\scripts\activate.ps1
3841
```
3942
40-
OSX/Ubuntu (bash):
43+
OSX/Linux (bash):
4144
```Shell
4245
source env/bin/activate
4346
```

README.rst

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
Microsoft Azure CLI Dev Tools (azdev)
2+
=====================================
3+
4+
The ``azdev`` tool is designed to aid new and experienced developers in contributing to Azure CLI command modules and extensions.
5+
6+
Setting up your development environment
7+
+++++++++++++++++++++++++++++++++++++++
8+
9+
1. Install Python 3.5+ or 2.7+ from http://python.org. Please note that the version of Python that comes preinstalled on OSX is 2.7.
10+
11+
2. Fork and clone the repository or repositories you wish to develop for.
12+
- For Azure CLI: https://github.com/Azure/azure-cli
13+
- For Azure CLI Extensions: https://github.com/Azure/azure-cli-extensions
14+
- Any other repository that you might have access to that contains CLI extensions.
15+
16+
3. Create a new virtual environment for Python in the root of your clone. You can do this by running:
17+
18+
Python 3.5+ (all platforms):
19+
20+
::
21+
22+
python -m venv env
23+
24+
or:
25+
26+
::
27+
28+
python3 -m venv env
29+
30+
Python 2.7+ (all platforms):
31+
32+
::
33+
34+
python -m virtualenv env
35+
36+
37+
4. Activate the env virtual environment by running:
38+
39+
Windows CMD.exe:
40+
41+
::
42+
43+
env\scripts\activate.bat
44+
45+
Windows Powershell:
46+
47+
::
48+
49+
env\scripts\activate.ps1
50+
51+
52+
OSX/Linux (bash):
53+
54+
::
55+
56+
source env/bin/activate
57+
58+
5. Install ``azdev`` by running:
59+
60+
::
61+
62+
pip install azdev
63+
64+
6. Complete setup by running:
65+
66+
::
67+
68+
azdev setup
69+
70+
71+
This will launch the interactive setup process. To see non-interactive options run `azdev setup -h`.
72+
73+
Reporting issues and feedback
74+
+++++++++++++++++++++++++++++
75+
76+
If you encounter any bugs with the tool please file an issue in the `Issues <https://github.com/Azure/azure-cli-dev-tools/issues>`__ section of our GitHub repo.
77+
78+
Contribute Code
79+
+++++++++++++++
80+
81+
This project has adopted the `Microsoft Open Source Code of Conduct <https://opensource.microsoft.com/codeofconduct/>`__.
82+
83+
For more information see the `Code of Conduct FAQ <https://opensource.microsoft.com/codeofconduct/faq/>`__ or contact `opencode@microsoft.com <mailto:opencode@microsoft.com>`__ with any additional questions or comments.
84+
85+
If you would like to become an active contributor to this project please
86+
follow the instructions provided in `Microsoft Azure Projects Contribution Guidelines <http://azure.github.io/guidelines.html>`__.
87+
88+
License
89+
+++++++
90+
91+
::
92+
93+
Azure CLI Dev Tools (azdev)
94+
95+
Copyright (c) Microsoft Corporation
96+
All rights reserved.
97+
98+
MIT License
99+
100+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
101+
102+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
103+
104+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.::

azdev/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# -----------------------------------------------------------------------------
66

7-
__VERSION__ = '0.0.7'
7+
__VERSION__ = '0.1.0'

azure-pipelines.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,46 @@ jobs:
7777
inputs:
7878
targetType: 'filePath'
7979
filePath: scripts/ci/run_tox.sh
80+
81+
- job: ExtractMetadata
82+
displayName: 'Extract Metadata'
83+
condition: succeeded()
84+
pool:
85+
vmImage: 'ubuntu-16.04'
86+
steps:
87+
- task: Bash@3
88+
displayName: 'Extract Version'
89+
inputs:
90+
targetType: 'filePath'
91+
filePath: scripts/ci/extract_version.sh
92+
93+
- task: PublishPipelineArtifact@0
94+
displayName: 'Publish Artifact: metadata'
95+
inputs:
96+
TargetPath: $(Build.ArtifactStagingDirectory)
97+
ArtifactName: metadata
98+
99+
- job: BuildPythonWheel
100+
displayName: 'Build Python Wheel'
101+
102+
dependsOn: ExtractMetadata
103+
condition: succeeded()
104+
pool:
105+
vmImage: 'ubuntu-16.04'
106+
steps:
107+
- task: UsePythonVersion@0
108+
displayName: 'Use Python 3.7'
109+
inputs:
110+
versionSpec: 3.7
111+
112+
- task: Bash@3
113+
displayName: 'Run Wheel Build Script'
114+
inputs:
115+
targetType: 'filePath'
116+
filePath: scripts/ci/build.sh
117+
118+
- task: PublishPipelineArtifact@0
119+
displayName: 'Publish Artifact: pypi'
120+
inputs:
121+
TargetPath: $(Build.ArtifactStagingDirectory)
122+
ArtifactName: pypi

scripts/ci/build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
set -ev
4+
5+
: "${BUILD_STAGINGDIRECTORY:?BUILD_STAGINGDIRECTORY environment variable not set}"
6+
: "${BUILD_SOURCESDIRECTORY:="$(dirname ${BASH_SOURCE[0]})/../../.."}"
7+
8+
cd $BUILD_SOURCESDIRECTORY
9+
10+
echo "Build `azdev`"
11+
python --version
12+
13+
pip install -U pip setuptools wheel
14+
pip list
15+
16+
python setup.py bdist_wheel sdist -d $BUILD_STAGINGDIRECTORY

scripts/ci/extract_version.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
# Extract the version of the CLI from azdev's __init__.py file.
4+
: "${BUILD_STAGINGDIRECTORY:?BUILD_STAGINGDIRECTORY environment variable not set}"
5+
6+
ver=`cat azdev/__init__.py | grep __VERSION__ | sed s/' '//g | sed s/'__VERSION__='// | sed s/\"//g`
7+
echo $ver > $BUILD_STAGINGDIRECTORY/version
8+
echo $ver > $BUILD_STAGINGDIRECTORY/azdev-${ver}.txt

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
__VERSION__ = re.search(r'^__VERSION__\s*=\s*[\'"]([^\'"]*)[\'"]',
2020
version_file.read(), re.MULTILINE).group(1)
2121

22-
with open('README.md', 'r', encoding='utf-8') as f:
22+
with open('README.rst', 'r', encoding='utf-8') as f:
2323
README = f.read()
2424
with open('HISTORY.rst', 'r', encoding='utf-8') as f:
2525
HISTORY = f.read()
@@ -28,7 +28,7 @@
2828
name='azdev',
2929
version=__VERSION__,
3030
description='Microsoft Azure CLI Developer Tools',
31-
long_description=README + '\n\n' + HISTORY,
31+
long_description=README+ '\n\n' + HISTORY,
3232
url='https://github.com/Azure/azure-cli-dev-tools',
3333
author='Microsoft Corporation',
3434
author_email='azpycli@microsoft.com',

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ whitelist_externals =
1111
flake8
1212
commands=
1313
python ./scripts/license_verify.py
14+
python setup.py check -r -s
1415
pylint azdev --rcfile=.pylintrc -r n
1516
flake8 --statistics --append-config=.flake8 azdev

0 commit comments

Comments
 (0)