Skip to content

Commit a4fb35f

Browse files
hallvictoriaVictoria Hall
and
Victoria Hall
authored
build: migrate release pipeline (#103)
* migrate release pipeline * small fixes * remove spaces, formatting * update email * lint fix * fix lint * fix isort path * convert lint test to ADO instead of GH actions * fix blob test * gh issue template & pr title check --------- Co-authored-by: Victoria Hall <[email protected]>
1 parent 364046f commit a4fb35f

File tree

24 files changed

+512
-311
lines changed

24 files changed

+512
-311
lines changed

.flake8

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[flake8]
2+
# it's not a bug that we aren't using all of hacking, ignore:
3+
# H402: Module level import not at top of file
4+
# W503: Line break occurred before a binary operator
5+
# E731: Do not assign a lambda expression, use a def
6+
ignore = W503,E402,E731
7+
8+
exclude = .git, __pycache__, build, dist, .eggs, .github, .local, docs/,
9+
Samples, .env*, .vscode, venv*, *.venv*
10+
11+
max-line-length = 88

.github/linters/.isort.cfg

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

.github/linters/tox.ini

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

.github/workflows/linting_extension_base.yml

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

.github/workflows/linting_extension_blob.yml

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

.github/workflows/linting_extension_fastapi.yml

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

azurefunctions-extensions-base/azurefunctions/extensions/base/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
"RequestSynchronizer",
4040
]
4141

42-
__version__ = "1.0.0b2"
42+
__version__ = '1.0.0b2'

azurefunctions-extensions-base/azurefunctions/extensions/base/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import re
77
from abc import ABC
88
from enum import Enum
9-
from typing import Any, Callable, Dict, List, Optional
9+
from typing import Any, Callable, Optional
1010

1111
from . import meta
1212

azurefunctions-extensions-base/pyproject.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@ classifiers= [
2727

2828
[project.optional-dependencies]
2929
dev = [
30-
'pytest',
31-
'pytest-cov',
32-
'coverage',
33-
'pytest-instafail',
34-
'pre-commit'
30+
'flake8',
31+
'mypy',
32+
'pytest',
33+
'pytest-cov',
34+
'coverage',
35+
'pytest-instafail',
36+
'pre-commit'
3537
]
3638

3739
[tool.setuptools.dynamic]
3840
version = {attr = "azurefunctions.extensions.base.__version__"}
3941

4042
[tool.setuptools.packages.find]
4143
exclude = ['azurefunctions.extensions', 'azurefunctions', 'tests']
42-
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
import pathlib
4+
import subprocess
5+
import sys
6+
import unittest
7+
8+
ROOT_PATH = pathlib.Path(__file__).parent.parent.parent
9+
10+
11+
class TestCodeQuality(unittest.TestCase):
12+
def test_mypy(self):
13+
try:
14+
import mypy # NoQA
15+
except ImportError as e:
16+
raise unittest.SkipTest('mypy module is missing') from e
17+
18+
try:
19+
subprocess.run(
20+
[sys.executable, '-m', 'mypy', '-m', 'azurefunctions-extensions-base'],
21+
check=True,
22+
stdout=subprocess.PIPE,
23+
stderr=subprocess.PIPE,
24+
cwd=str(ROOT_PATH))
25+
except subprocess.CalledProcessError as ex:
26+
output = ex.output.decode()
27+
raise AssertionError(
28+
f'mypy validation failed:\n{output}') from None
29+
30+
def test_flake8(self):
31+
try:
32+
import flake8 # NoQA
33+
except ImportError as e:
34+
raise unittest.SkipTest('flake8 module is missing') from e
35+
36+
config_path = ROOT_PATH / '.flake8'
37+
if not config_path.exists():
38+
raise unittest.SkipTest('could not locate the .flake8 file')
39+
40+
try:
41+
subprocess.run(
42+
[sys.executable, '-m', 'flake8', 'azurefunctions-extensions-base',
43+
'--config', str(config_path)],
44+
check=True,
45+
stdout=subprocess.PIPE,
46+
stderr=subprocess.PIPE,
47+
cwd=str(ROOT_PATH))
48+
except subprocess.CalledProcessError as ex:
49+
output = ex.output.decode()
50+
raise AssertionError(
51+
f'flake8 validation failed:\n{output}') from None

azurefunctions-extensions-bindings-blob/azurefunctions/extensions/bindings/blob/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
"BlobClientConverter",
1414
]
1515

16-
__version__ = "1.0.0b3"
16+
__version__ = '1.0.0b3'

0 commit comments

Comments
 (0)