Skip to content

Commit 331d6c4

Browse files
committed
CCM-12616: fix sonarcloud issues
1 parent 9876b1d commit 331d6c4

14 files changed

Lines changed: 68 additions & 49 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Setup Python and Poetry"
2+
description: "Sets up Python environment and installs Poetry with dependencies"
3+
inputs:
4+
python-version:
5+
description: "Python version to use"
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: "Set up Python"
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: ${{ inputs.python-version }}
15+
16+
- name: "Install Poetry"
17+
uses: snok/install-poetry@v1
18+
with:
19+
version: latest
20+
virtualenvs-create: true
21+
virtualenvs-in-project: true
22+
23+
- name: "Install Poetry dependencies"
24+
shell: bash
25+
run: |
26+
cd lambdas/mesh-poll && poetry install

.github/workflows/stage-2-test.yaml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,11 @@ jobs:
6262
steps:
6363
- name: "Checkout code"
6464
uses: actions/checkout@v5
65-
- name: "Set up Python"
66-
uses: actions/setup-python@v4
65+
- name: "Setup Python and Poetry"
66+
uses: ./.github/actions/setup-python-poetry
6767
with:
6868
python-version: ${{ inputs.python_version }}
69-
- name: "Install Poetry"
70-
uses: snok/install-poetry@v1
71-
with:
72-
version: latest
73-
virtualenvs-create: true
74-
virtualenvs-in-project: true
69+
working-directory: "lambdas/mesh-poll"
7570
- name: "Repo setup"
7671
run: |
7772
npm ci
@@ -100,16 +95,11 @@ jobs:
10095
steps:
10196
- name: "Checkout code"
10297
uses: actions/checkout@v5
103-
- name: "Set up Python"
104-
uses: actions/setup-python@v4
98+
- name: "Setup Python and Poetry"
99+
uses: ./.github/actions/setup-python-poetry
105100
with:
106101
python-version: ${{ inputs.python_version }}
107-
- name: "Install Poetry"
108-
uses: snok/install-poetry@v1
109-
with:
110-
version: latest
111-
virtualenvs-create: true
112-
virtualenvs-in-project: true
102+
working-directory: "lambdas/mesh-poll"
113103
- name: "Repo setup"
114104
run: |
115105
npm ci

.gitleaksignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:
77
52386bca9b88c0c8c7dee52ab0ec69d04fb72c46:src/TESTING_PLAN.md:ipv4:145
88
cc74128e4207833109339e96f3aaebf3cd40dd65:src/TESTING_PLAN.md:ipv4:2507
99
973c8a1feb76f3cd8743ce27b14e4acc4252240c:src/TESTING_PLAN.md:ipv4:2507
10+
791619daf5af4806da7266fa301c0e82145b6de8:src/TESTING_PLAN.md:ipv4:2507

lambdas/mesh-poll/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test-coverage:
1414
poetry run pytest --cov --cov-report xml:target/coverage/@comms/mesh-poll-lambda/cobertura-coverage.xml
1515

1616
lint:
17-
poetry run pylint mesh_poll
17+
poetry run pylint src
1818

1919
format:
2020
poetry run autopep8 -ri .

lambdas/mesh-poll/poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lambdas/mesh-poll/pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@ name = "mesh-poll"
33
version = "0.1.0"
44
description = "Poll a MESH mailbox"
55
authors = ["Your Name <you@example.com>"]
6+
package-mode = false
67

78
[tool.poetry.dependencies]
89
python = "^3.9"
910
structlog = "^21.5.0"
1011
py-mock-mesh = {path = "../../utils/py-mock-mesh", develop = false}
1112

12-
[tool.poetry.dev-dependencies]
13+
[tool.poetry.group.dev.dependencies]
1314
autopep8 = "^2.0.2"
1415
pylint = "^2.17.4"
1516
pytest = "^7.0.1"
1617
pytest-cov = "^4.0.0"
17-
18-
[tool.poetry.group.dev.dependencies]
1918
jake = "^3.0.1"
2019

2120
[tool.coverage.run]
22-
omit = ["tests/*"]
21+
omit = ["src/__tests__/*"]
22+
23+
[tool.pytest.ini_options]
24+
pythonpath = "."
2325

2426
[build-system]
2527
requires = ["poetry-core>=1.0.0"]

lambdas/mesh-poll/tests/test_mesh_poll.py renamed to lambdas/mesh-poll/src/__tests__/test_mesh_poll.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from mesh_poll import __version__
1+
from src import __version__
22

33

44
def test_version():

0 commit comments

Comments
 (0)