Skip to content

Commit 751fcb2

Browse files
authored
👷 CI changes & 3rd party licence checks & Python 3.8 (#15)
* reset * fixes for flake8 * manual 3rd party checks
1 parent 2a01765 commit 751fcb2

10 files changed

+45
-13
lines changed

DEVELOPMENT.md

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ Run static analysis (note that no output means all is well):
8080
flake8
8181
```
8282

83+
Perform static type check:
84+
85+
```bash
86+
mypy -p snippet
87+
```
88+
8389
## Documenting code
8490

8591
Inclusion of docstrings is needed in all areas of the code for Flake8

README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Snippet
22

3-
![Package](https://img.shields.io/badge/Package-code--snippet-lightgrey)
4-
[![Documentation](https://img.shields.io/badge/Documentation-GitHub_Pages-blue)](https://armmbed.github.io/snippet)
5-
[![PyPI](https://img.shields.io/pypi/v/code-snippet)](https://pypi.org/project/code-snippet/)
6-
[![PyPI - Status](https://img.shields.io/pypi/status/code-snippet)](https://pypi.org/project/code-snippet/)
7-
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/code-snippet)](https://pypi.org/project/code-snippet/)
8-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/ARMmbed/code-snippet/blob/master/LICENSE)
3+
![Package](https://badgen.net/badge/Package/code-snippet/grey)
4+
[![Documentation](https://badgen.net/badge/Documentation/GitHub%20Pages/blue?icon=github)](https://armmbed.github.io/snippet)
5+
[![PyPI](https://badgen.net/pypi/v/code-snippet)](https://pypi.org/project/code-snippet/)
6+
[![PyPI - Status](https://img.shields.io/pypi/status/code-snippet)](https://pypi.org/project/code-snippet/)
7+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/code-snippet)](https://pypi.org/project/code-snippet/)
8+
9+
[![License](https://badgen.net/pypi/license/code-snippet)](https://github.com/ARMmbed/snippet/blob/master/LICENSE)
10+
[![Compliance](https://badgen.net/badge/License%20Report/compliant/green?icon=libraries)](https://armmbed.github.io/snippet/third_party_IP_report.html)
911

1012
[![Build Status](https://dev.azure.com/mbed-tools/code-snippet/_apis/build/status/Build%20and%20Release?branchName=master&stageName=CI%20Checkpoint)](https://dev.azure.com/mbed-tools/code-snippet/_build/latest?definitionId=15&branchName=master)
1113
[![Test Coverage](https://codecov.io/gh/ARMmbed/code-snippet/branch/master/graph/badge.svg)](https://codecov.io/gh/ARMmbed/snippet)

azure-pipelines/build-release.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ stages:
3434
Linux_Py_3_7:
3535
python.version: '3.7'
3636
vmImageName: ubuntu-latest
37+
uploadCoverage: "false"
38+
39+
Linux_Py_3_8:
40+
python.version: '3.8'
41+
vmImageName: ubuntu-latest
3742
uploadCoverage: "true"
3843

3944
Windows_Py_3_6:
@@ -46,6 +51,11 @@ stages:
4651
vmImageName: windows-latest
4752
uploadCoverage: "false"
4853

54+
Windows_Py_3_8:
55+
python.version: '3.8'
56+
vmImageName: windows-latest
57+
uploadCoverage: "false"
58+
4959
macOS_Py_3_6:
5060
python.version: '3.6'
5161
vmImageName: macOS-latest
@@ -55,6 +65,12 @@ stages:
5565
python.version: '3.7'
5666
vmImageName: macOS-latest
5767
uploadCoverage: "false"
68+
69+
macOS_Py_3_8:
70+
python.version: '3.8'
71+
vmImageName: macOS-latest
72+
uploadCoverage: "false"
73+
5874
pool:
5975
vmImage: $(vmImageName)
6076

@@ -150,10 +166,6 @@ stages:
150166

151167
- template: steps/generate-spdx-documents.yml
152168

153-
- publish: $(temp_spdx_reports_path)
154-
artifact: SPDX
155-
displayName: 'Publish SPDX reports'
156-
157169
# Collect test and build stages together before the release stages to provide a pass/fail point for the status badge.
158170
- stage: CiCheckpoint
159171
displayName: 'CI Checkpoint'

azure-pipelines/steps/generate-spdx-documents.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ steps:
1010
1111
- script: |
1212
license-files
13-
displayName: 'Add copyright/licence notice.'
13+
displayName: 'Add copyright/licence notice.'
14+
15+
- publish: $(temp_spdx_reports_path)
16+
artifact: SPDX
17+
displayName: 'Publish SPDX reports'
18+
condition: always()

news/20200428.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Checked 3rd-party licences.

news/20200428.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reset project's structure with latest template.

news/2020042801.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Tested on Python 3.8.

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ DOCUMENTATION_PRODUCTION_OUTPUT_PATH = "docs"
1818
VERSION_FILE_PATH = "snippet/_version.py"
1919
CHANGELOG_FILE_PATH = "CHANGELOG.md"
2020

21+
[ProjectConfig.PACKAGES_WITH_CHECKED_LICENCE]
22+
python-dotenv = "BSD-3-Clause"
23+
2124
[AutoVersionConfig]
2225
CONFIG_NAME = "DEFAULT"
2326
PRERELEASE_TOKEN = "beta"

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"Programming Language :: Python :: 3 :: Only",
3333
"Programming Language :: Python :: 3.6",
3434
"Programming Language :: Python :: 3.7",
35+
"Programming Language :: Python :: 3.8",
3536
"Topic :: Software Development :: Build Tools",
3637
"Topic :: Documentation",
3738
"Topic :: Software Development :: Documentation",
@@ -46,7 +47,7 @@
4647
name=PROJECT_SLUG,
4748
packages=[SOURCE_DIR],
4849
python_requires=">=3.6,<4",
49-
url=f"https://github.com/ARMmbed/snippet",
50+
url="https://github.com/ARMmbed/snippet",
5051
version=__version__,
5152
entry_points=dict(
5253
console_scripts=[

snippet/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ def extract_code_snippets(config: config.Config) -> None:
1818
LOGGER.error(
1919
"failures:\n%s", textwrap.indent("\n".join(f"{name}: {exc}" for name, exc in failures), prefix=" ")
2020
)
21-
raise Exception(f"There were %s failures!" % len(failures))
21+
raise Exception(f"There were {len(failures)} failures!")

0 commit comments

Comments
 (0)