Skip to content

Commit a2599d1

Browse files
authored
Merge branch 'dev' into work-toggle-button-color
2 parents 7675f97 + bc1156c commit a2599d1

File tree

5 files changed

+123
-40
lines changed

5 files changed

+123
-40
lines changed

.github/workflows/dev-ci.yml

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: dev-test-code
1+
name: CI-dev-pipeline
22

33
on:
44
push:
55
branches:
6-
- dev
6+
- dev
77
paths-ignore:
88
- "scripts/**"
99
- "BlocksScreen/lib/ui/**"
@@ -22,7 +22,9 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
python-version: ["3.11.2"]
25-
test-type: [ruff, pylint, pytest]
25+
test-type: [ruff, pylint, pytest, docstrcov, security]
26+
environment: Dev
27+
2628
steps:
2729
- name: Checkout repo
2830
uses: actions/checkout@v4
@@ -31,13 +33,15 @@ jobs:
3133
uses: actions/setup-python@v4
3234
with:
3335
python-version: ${{ matrix.python-version }}
34-
cache: "pip"
36+
cache: pip
37+
cache-dependency-path: scripts/requirements-dev.txt
38+
3539
- name: Install dependencies
3640
run: |
3741
echo "Installing dependencies"
3842
python -m pip install --upgrade pip
39-
pip install scripts -r scripts/requirements-dev.txt
40-
43+
pip install -r scripts/requirements-dev.txt
44+
4145
- name: Run Test ${{ matrix.test-type }}
4246
run: |
4347
echo "Starting test runs"
@@ -48,21 +52,32 @@ jobs:
4852
echo "Ruff finished"
4953
fi
5054
if [ "${{ matrix.test-type }}" == "pylint" ]; then
51-
echo "Running Code Test"
52-
pylint -j$(nproc) --recursive=y --rcfile=.pylintrc.dev . > pylint-output.txt 2>&1
55+
echo "Running Pylint Code Test"
56+
pylint -j$(nproc) --recursive=y BlocksScreen/ > pylint-output.txt 2>&1
5357
echo "Pylint finished"
5458
fi
5559
5660
if [ "${{ matrix.test-type }}" == "pytest" ]; then
5761
if [ -d "tests/" ] && [ "$(ls -A tests/)" ]; then
5862
echo "Running Python unit tests"
59-
pytest tests/'*.py' --doctest-modules --junitxml=junit/test-results.xml --cov=com --conv-report=xml --cov-report=html > pytest-output.txt 2>&1
63+
pytest tests/ --doctest-modules --junitxml=junit/test-results.xml --cov=BlocksScreen/ --cov-report=xml --cov-report=html > pytest-output.txt 2>&1
6064
else
6165
echo "No tests directory no need to proceed with tests"
6266
fi
6367
fi
6468
65-
- name: Upload ruff artifact
69+
if [ "${{ matrix.test-type }}" == "docstrcov" ]; then
70+
echo "Running docstring coverage test"
71+
docstr-coverage BlocksScreen/ --exclude .*/BlocksScreen/lib/ui/.*?$ --fail-under=80 --skip-magic --skip-init --skip-private --skip-property > docstr-cov-output.txt 2>&1
72+
fi
73+
74+
if [ "${{matrix.test-type }}" == "security" ]; then
75+
echo "Running bandit security test"
76+
bandit -c pyproject.toml -r . -f json -o bandit-output.json 2>&1
77+
fi
78+
79+
80+
- name: Upload ruff artifact
6681
if: always() && matrix.test-type == 'ruff'
6782
uses: actions/upload-artifact@v4
6883
with:
@@ -75,15 +90,29 @@ jobs:
7590
with:
7691
name: pylint-results
7792
path: pylint-output.txt
78-
93+
7994
- name: Upload Pytest Artifacts
80-
if: always() && matrix.test-type == 'pytest' && hashFiles('pytest-output.txt', 'junit/test-results.xml', 'coverage.xml')
95+
if: always() && matrix.test-type == 'pytest'
8196
uses: actions/upload-artifact@v4
8297
with:
8398
name: pytest-results
8499
path: |
85-
pytest_output.txt
100+
pytest-output.txt
86101
junit/test-results.xml
87102
coverage.xml
88103
htmlcov/
89-
104+
continue-on-error: true
105+
106+
- name: Upload docstr coverage report
107+
if: always() && matrix.test-type == 'docstrcov'
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: docstr-coverage
111+
path: docstr-cov-output.txt
112+
113+
- name: Upload bandit security report
114+
if: always() && matrix.test-type == 'security'
115+
uses: actions/upload-artifact@v4
116+
with:
117+
name: bandit-output
118+
path: bandit-output.json

.github/workflows/stage-ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: stage-ci
2+
3+
on:
4+
branches:
5+
- stage
6+
paths-ignore:
7+
- "scripts/**"
8+
- "BlocksScreen/lib/ui/**"
9+
- "extras/**"
10+
workflow_run:
11+
workflows: ["dev-test-code"]
12+
types:
13+
- completed
14+
jobs:
15+
ci-stage:
16+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repo
20+
uses: actions/checkout@v4
21+
22+
- name: Run staging pipeline
23+
run: echo "Running staging integration tests..."

pyproject.toml

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,65 @@ description = "GUI for BLOCKS Printers running Klipper"
55
authors = [
66
{ name = "Hugo do Carmo Costa", email = "[email protected]" },
77
]
8+
maintainers = [
9+
{ name = "Guilherme Costa", email = "[email protected]" },
10+
{ name = "Roberto Martins ", email = "[email protected]" },
11+
]
812
dependencies = [
913
'altgraph==0.17.4',
10-
'certifi==2024.7.4',
11-
'charset-normalizer==3.3.2',
12-
'idna==3.8',
13-
'numpy==2.1.0',
14-
'pefile==2023.2.7',
15-
'PyQt6==6.7.1',
16-
'PyQt6-Qt6==6.7.2',
17-
'PyQt6_sip==13.8.0',
18-
'requests==2.32.3',
19-
'sdbus==0.12.0',
14+
'certifi==2025.10.5',
15+
'charset-normalizer==3.4.4',
16+
'idna==3.11',
17+
'numpy==2.3.4',
18+
'pefile==2024.8.26',
19+
'PyQt6==6.10.0',
20+
'PyQt6-Qt6==6.10.0',
21+
'PyQt6_sip==13.10.2',
22+
'requests>=2.32.5',
23+
'sdbus==0.14.1',
2024
'sdbus-networkmanager==2.0.0',
2125
'typing==3.7.4.3',
22-
'websocket-client==1.8.0',
23-
'opencv-python-headless==4.11.0.86',
24-
'qrcode==8.2'
26+
'websocket-client==1.9.0',
27+
'qrcode==8.2',
2528
]
26-
requires-python = ">=3.11.2"
29+
requires-python = "==3.11.2"
2730
readme = "README.md"
2831
license = { text = "GNU Affero General Public License v3.0 or later" }
2932
keywords = ["GUI", "klipper", "BlocksScreen", "BLOCKS"]
3033

34+
[project.optional-dependencies]
35+
dev = ["ruff", "pylint", "pytest", "pytest-cov", "docstr_coverage"]
36+
stage = ["bandit"]
37+
full-dev = ["BlockScreen[dev,stage]"]
38+
39+
40+
[project.urls]
41+
Homepage = "https://blockstec.com"
42+
Issues = "https://github.com/BlocksTechnology/BlocksScreen/issues"
43+
3144
[tool.ruff]
3245
line-length = 88
3346
indent-width = 4
3447

48+
[tool.ruff.lint]
49+
ignore = ["F403"]
50+
3551
[tool.ruff.format]
3652
indent-style = "space"
3753
line-ending = 'auto'
3854
docstring-code-format = true
3955
docstring-code-line-length = 94
56+
57+
[tool.pylint]
58+
fail-under = 7
59+
jobs = 16
60+
ignore = ["tests", "scripts", "ui", "extras"]
61+
ignore-paths = ["BlocksScreen/lib/ui"]
62+
py-version = "3.11"
63+
max-line-length = 88
64+
65+
[tool.pytest.ini_options]
66+
addopts = "--cov=BlocksScreen --cov-report=html"
67+
68+
[tool.bandit]
69+
exclude_dirs = ["tests", "BlocksScreen/lib/ui/resources/"]

scripts/requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ ruff
22
pylint
33
pytest
44
pytest-cov
5+
docstr_coverage
6+
bandit

scripts/requirements.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
altgraph==0.17.4
2-
certifi==2024.7.4
3-
charset-normalizer==3.3.2
4-
idna==3.8
5-
numpy==2.1.0
6-
pefile==2023.2.7
7-
PyQt6==6.7.1
8-
PyQt6-Qt6==6.7.2
9-
PyQt6_sip==13.8.0
10-
requests==2.32.4
11-
sdbus==0.12.0
2+
certifi==2025.10.5
3+
charset-normalizer==3.4.4
4+
idna==3.11
5+
numpy==2.3.4
6+
pefile==2024.8.26
7+
PyQt6==6.10.0
8+
PyQt6-Qt6==6.10.0
9+
PyQt6_sip==13.10.2
10+
requests>=2.32.5
11+
sdbus==0.14.1
1212
sdbus-networkmanager==2.0.0
1313
typing==3.7.4.3
14-
websocket-client==1.8.0
15-
opencv-python-headless==4.11.0.86
14+
websocket-client==1.9.0
1615
qrcode==8.2

0 commit comments

Comments
 (0)