8000 Update using latest template (#11) · ARMmbed/mbed-tools-lib@efa7d88 · GitHub
[go: up one dir, main page]

Skip to content 8000
This repository was archived by the owner on Jul 27, 2020. It is now read-only.

Commit efa7d88

Browse files
authored
Update using latest template (#11)
* Update using latest template * blacked old files
1 parent 529a91d commit efa7d88

File tree

10 files changed

+65
-24
lines changed

10 files changed

+65
-24
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### Description
2+
3+
<!--
4+
A detailed description of what is being reported. Please include steps to reproduce the problem.
5+
6+
Things to consider sharing:
7+
- What version of the package is being used (pip show mbed-targets)?
8+
- What is the host platform and version (e.g. macOS 10.15.2, Windows 10, Ubuntu 18.04 LTS)?
9+
-->
10+
11+
12+
13+
### Issue request type
14+
15+
<!--
16+
Please add only one `x` to one of the following types. Do not fill multiple types (split the issue otherwise).
17+
18+
19+
For questions please use https://forums.mbed.com/
20+
-->
21+
22+
- [ ] Enhancement
23+
- [ ] Bug

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### Description
2+
3+
<!--
4+
Please add any detail or context that would be useful to a reviewer.
5+
-->
6+
7+
8+
9+
### Test Coverage
10+
11+
<!--
12+
Please put an `x` in the correct box e.g. `[x]` to indicate the testing coverage of this change.
13+
-->
14+
15+
- [ ] This change is covered by existing or additional automated tests.
16+
- [ ] Manual testing has been performed (and evidence provided) as automated testing was not feasible.
17+
- [ ] Additional tests are not required for this change (e.g. documentation update).

DEVELOPMENT.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pipenv --three
5151
pipenv install --dev
5252
```
5353

54-
## Unit Tests and Static Analysis
54+
## Unit Tests, Code Formatting and Static Analysis
5555

5656
Shell into virtual environment:
5757

@@ -67,6 +67,13 @@ pytest
6767
Note that other test runners can be used (e.g. [green](https://github.com/CleanCut/green))
6868
as long as they support test written using unittest.TestCase.
6969

70+
71+
Run code formatter (it will format files in place):
72+
73+
```bash
74+
black .
75+
```
76+
7077
Run static analysis (note that no output means all is well):
7178

7279
```bash

Pipfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7+
black = "*"
78
coverage = "*"
89
flake8 = "*"
910
flake8-docstrings = "*"
11+
flake8-black = "*"
1012
mypy = ">=0.500"
1113
pytest = "*"
1214
pytest-cov = "*"
1315
wheel = "*"
1416
mbed-tools-lib = {editable = true, path = "."}
1517
mbed-tools-ci-scripts = "*"
18+
19+
[pipenv]
20+
allow_prereleases = true

azure-pipelines/steps/install-development-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ steps:
99
- script: |
1010
python -m pip install --upgrade pip wheel setuptools
1111
pip install pipenv
12-
python -m pipenv lock --dev -r > dev-requirements.txt
12+
python -m pipenv lock --dev -r --pre > dev-requirements.txt
1313
pip install -r dev-requirements.txt
1414
pip install pytest-azurepipelines
1515
pip list

news/202002102.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated project's structure with latest template.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,5 @@ directory = "misc"
6969
name = "Misc"
7070
showcontent = false
7171

72+
[tool.black]
73+
line-length = 120

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ per-file-ignores =
4444
# Don't require docstrings in tests.
4545
# We evaluate the need for them on case by case basis.
4646
test_*.py:D1
47-
max-line-length = 160
47+
max-line-length = 120
4848
docstring-convention = google
4949

5050
[tool:pytest]

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@
3232
"Topic :: Software Development :: Embedded Systems",
3333
],
3434
description="A library of shared Mbed tools functionality.",
35-
keywords="Arm Mbed OS MbedOS Mbed OS",
35+
keywords="Arm Mbed OS MbedOS Arm Mbed OS MbedOS Arm Mbed OS MbedOS Mbed OS lib",
3636
include_package_data=True,
37-
install_requires=[
38-
"python-dotenv",
39-
],
37+
install_requires=["python-dotenv"],
4038
license="Apache 2.0",
4139
long_description_content_type="text/markdown",
4240
long_description=long_description,

tests/test_logging.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import logging
22
from unittest import TestCase, mock
33

4-
from mbed_tools_lib.logging import (
5-
log_exception,
6-
set_log_level,
7-
LOGGING_FORMAT,
8-
)
4+
from mbed_tools_lib.logging import log_exception, set_log_level, LOGGING_FORMAT
95

106

117
class TestLogException(TestCase):
@@ -23,24 +19,16 @@ def test_log_exception_error(self):
2319
class TestSetLogLevel(TestCase):
2420
def test_debug(self, mocked_logging):
2521
set_log_level(verbose_count=3)
26-
mocked_logging.basicConfig.assert_called_once_with(
27-
level=mocked_logging.DEBUG, format=LOGGING_FORMAT
28-
)
22+
mocked_logging.basicConfig.assert_called_once_with(level=mocked_logging.DEBUG, format=LOGGING_FORMAT)
2923

3024
def test_info(self, mocked_logging):
3125
set_log_level(verbose_count=2)
32-
mocked_logging.basicConfig.assert_called_once_with(
33-
level=mocked_logging.INFO, format=LOGGING_FORMAT
34-
)
26+
mocked_logging.basicConfig.assert_called_once_with(level=mocked_logging.INFO, format=LOGGING_FORMAT)
3527

3628
def test_warning(self, mocked_logging):
3729
set_log_level(verbose_count=1)
38-
mocked_logging.basicConfig.assert_called_once_with(
39-
level=mocked_logging.WARNING, format=LOGGING_FORMAT
40-
)
30+
mocked_logging.basicConfig.assert_called_once_with(level=mocked_logging.WARNING, format=LOGGING_FORMAT)
4131

4232
def test_error(self, mocked_logging):
4333
set_log_level(verbose_count=0)
44-
mocked_logging.basicConfig.assert_called_once_with(
45-
level=mocked_logging.ERROR, format=LOGGING_FORMAT
46-
)
34+
mocked_logging.basicConfig.assert_called_once_with(level=mocked_logging.ERROR, format=LOGGING_FORMAT)

0 commit comments

Comments
 (0)
0