Skip to content

Commit 9ee3ffc

Browse files
committed
v2.0.3 - Remove "settings" router and unused checks
**settings.py** - Deleted `settings.py` and corresponding command handlers for timezone setup and error testing. **bot.py** - Removed inclusion of the `settings_router` from the dispatcher initialization. **.pre-commit-config.yaml** - Cleaned up unused hooks and old commented configurations. **GitHub Actions** - Simplified scan and coverage path configurations by consolidating into `SCAN_PATHS`. - Removed experiment-related checks from CI workflows. **pyproject.toml** - Bumped template version to 2.0.3.
1 parent 32bde24 commit 9ee3ffc

File tree

6 files changed

+8
-160
lines changed

6 files changed

+8
-160
lines changed

.github/workflows/pr-checks.yml

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ name: Code Quality
33
env:
44
COVERAGE_THRESHOLD: 50
55
VULTURE_MIN_CONFIDENCE: 80
6-
MAIN_SCAN_PATHS: 'src calmlib tools tests'
7-
EXTRA_SCAN_PATHS: 'experiments'
8-
ALL_SCAN_PATHS: 'src calmlib tools experiments tests'
9-
COVERAGE_PATHS_FLAGS: '--cov=src --cov=calmlib --cov=tools'
6+
SCAN_PATHS: 'src tests'
107

118
on:
129
pull_request:
@@ -26,10 +23,10 @@ jobs:
2623
python-version: ${{ matrix.python-version }}
2724

2825
- name: Run Ruff linter
29-
run: uv run ruff check --output-format=github ${{ env.MAIN_SCAN_PATHS }}
26+
run: uv run ruff check --output-format=github ${{ env.SCAN_PATHS }}
3027

3128
- name: Run Ruff formatter check
32-
run: uv run ruff format --check --diff ${{ env.MAIN_SCAN_PATHS }}
29+
run: uv run ruff format --check --diff ${{ env.SCAN_PATHS }}
3330

3431
dead-code-check:
3532
name: Vulture
@@ -44,7 +41,7 @@ jobs:
4441
python-version: ${{ matrix.python-version }}
4542

4643
- name: Run Vulture dead code detector
47-
run: uv run vulture --min-confidence ${{ env.VULTURE_MIN_CONFIDENCE }} ${{ env.MAIN_SCAN_PATHS }}
44+
run: uv run vulture --min-confidence ${{ env.VULTURE_MIN_CONFIDENCE }} ${{ env.SCAN_PATHS }}
4845

4946
coverage:
5047
name: Coverage Report
@@ -60,8 +57,8 @@ jobs:
6057

6158
- name: Run coverage analysis
6259
run: |
63-
uv run pytest ${{ env.ALL_SCAN_PATHS }} \
64-
${{ env.COVERAGE_PATHS_FLAGS }} \
60+
uv run pytest ${{ env.SCAN_PATHS }} \
61+
--cov=src \
6562
--cov-report=xml \
6663
--cov-report=term \
6764
--cov-fail-under=${{ env.COVERAGE_THRESHOLD }}
@@ -72,33 +69,3 @@ jobs:
7269
# with:
7370
# file: ./coverage.xml
7471
# fail_ci_if_error: false
75-
76-
experiments-check:
77-
name: Experiments Report (Non-blocking)
78-
runs-on: ubuntu-latest
79-
continue-on-error: true # This makes the job non-blocking
80-
strategy:
81-
matrix:
82-
python-version: [ "3.13" ]
83-
steps:
84-
- uses: actions/checkout@v3
85-
- uses: ./.github/actions/setup-python-env
86-
with:
87-
python-version: ${{ matrix.python-version }}
88-
89-
- name: Run Ruff on experiments (non-blocking)
90-
run: |
91-
echo "🧪 Running quality checks on experiments (non-blocking)..."
92-
uv run ruff check --output-format=github ${{ env.EXTRA_SCAN_PATHS }} || echo "⚠️ Ruff found issues in experiments"
93-
94-
- name: Run Vulture on experiments (non-blocking)
95-
run: |
96-
uv run vulture --min-confidence 80 ${{ env.EXTRA_SCAN_PATHS }} || echo "⚠️ Vulture found dead code in experiments"
97-
98-
- name: Run basic tests on experiments (non-blocking)
99-
run: |
100-
if [ -d "${{ env.EXTRA_SCAN_PATHS }}" ]; then
101-
uv run pytest ${{ env.EXTRA_SCAN_PATHS }} --tb=short || echo "⚠️ Some experiment tests failed"
102-
else
103-
echo "📝 No experiments directory found"
104-
fi

.github/workflows/push-checks.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: Code Quality
33
env:
44
COVERAGE_THRESHOLD: 50
55
VULTURE_MIN_CONFIDENCE: 80
6-
MAIN_SCAN_PATHS: 'src calmlib tools tests'
7-
EXTRA_SCAN_PATHS: 'experiments'
8-
ALL_SCAN_PATHS: 'src calmlib tools experiments tests'
9-
COVERAGE_PATHS_FLAGS: '--cov=src --cov=calmlib --cov=tools'
106

117
on: [ push ]
128

.pre-commit-config.yaml

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,12 @@
11
repos:
2-
# - repo: local
3-
# hooks:
4-
# - id: jupyter-nb-clear-output
5-
# name: jupyter-nb-clear-output
6-
# language: system
7-
# entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
82
- repo: https://github.com/kynan/nbstripout
93
rev: 0.5.0
104
hooks:
115
- id: nbstripout
126
files: \.ipynb$
137
stages: [ pre-commit ]
148

15-
- repo: https://github.com/jendrikseipp/vulture
16-
rev: 'v2.10'
17-
hooks:
18-
- id: vulture
19-
args: [
20-
"--min-confidence", "80",
21-
"src" # project_name - path to scan
22-
]
23-
files: ^.*\.py$
24-
exclude: ^(.git|.venv|venv|build|dist)/.*$
25-
26-
- repo: local
27-
hooks:
28-
- id: pytest-check
29-
name: pytest-check
30-
entry: pytest
31-
language: system
32-
pass_filenames: false
33-
always_run: true
34-
args: [
35-
"--cov=src", # project_name - path to scan
36-
"--cov-report=xml",
37-
"--cov-fail-under=50",
38-
]
39-
409
- repo: https://github.com/asottile/pyupgrade
4110
rev: v3.19.0
4211
hooks:
43-
- id: pyupgrade
44-
45-
- repo: https://github.com/RobertCraigie/pyright-python
46-
rev: v1.1.399
47-
hooks:
48-
- id: pyright
49-
additional_dependencies: ["pyright==1.1.399"]
50-
51-
# - repo: https://github.com/astral-sh/ruff-pre-commit
52-
# # Ruff version.
53-
# rev: v0.7.4
54-
# hooks:
55-
# # Run the linter.
56-
# - id: ruff
57-
# types_or: [ python, pyi ]
58-
# args: [ --fix ]
59-
# # Run the formatter.
60-
# - id: ruff-format
61-
# types_or: [ python, pyi ]
12+
- id: pyupgrade

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ dev = [
121121
]
122122

123123
[template]
124-
version = "2.0.2"
124+
version = "2.0.3"
125125
url = "https://github.com/calmmage/botspot-template.git"
126126
author = "Petr Lavrov <me@petrlavrov.com>"
127127
description = "A template for creating a bot using botspot"

src/bot.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from src._app import App
1111
from src.router import router as main_router
12-
from src.routers.settings import router as settings_router
1312
from botspot.core.bot_manager import BotManager
1413

1514

@@ -20,7 +19,6 @@ def main(debug=False) -> None:
2019
# Initialize bot and dispatcher
2120
dp = Dispatcher()
2221
dp.include_router(main_router)
23-
dp.include_router(settings_router)
2422

2523
app = App()
2624
dp["app"] = app

src/routers/settings.py

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

0 commit comments

Comments
 (0)