Skip to content

Commit 5e8d339

Browse files
authored
Merge pull request #1 from lighting9999/lighting9999-patch-1
Lighting9999 patch 1
2 parents 333e66a + 64aae00 commit 5e8d339

File tree

4 files changed

+78
-53
lines changed

4 files changed

+78
-53
lines changed

.github/workflows/Python CI.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Python CI
2+
on: [pull_request, push]
3+
jobs:
4+
lint_python:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout code
8+
uses: actions/checkout@v4
9+
10+
- name: Set up Python
11+
uses: actions/setup-python@v5
12+
with:
13+
python-version: "3.13"
14+
cache: "pip"
15+
cache-dependency-path: "pyproject.toml"
16+
17+
- name: Install check dependencies
18+
run: |
19+
python -m pip install --upgrade pip wheel
20+
pip install bandit ruff mypy safety codespell
21+
22+
- name: Run Codespell
23+
run: codespell --config pyproject.toml || true
24+
25+
- name: Run Bandit
26+
run: bandit --recursive --skip B101 . || true
27+
28+
- name: Run Ruff (linting)
29+
run: ruff check . --config pyproject.toml
30+
31+
- name: Run Ruff (formatting check)
32+
run: ruff format --check . --config pyproject.toml || true
33+
34+
35+
36+
- name: Setup Mypy cache
37+
run: mkdir -p .mypy_cache
38+
39+
- name: Install type stubs
40+
run: mypy --config-file pyproject.toml --install-types --non-interactive
41+
42+
- name: Run Mypy
43+
run: mypy --config-file pyproject.toml

.github/workflows/lint_python.yml

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

News_App/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
solara == 1.50.1
2+
Flask
3+
gunicorn ==23.0.0
4+
simple-websocket
5+
flask-sock
6+
yfinance

pyproject.toml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -113,38 +113,38 @@ dependencies = [
113113
"xor-cipher",
114114
"yfinance",
115115
]
116+
117+
[build-system]
118+
requires = ["setuptools>=65", "wheel"]
119+
build-backend = "setuptools.build_meta"
120+
121+
[tool.codespell]
122+
ignore-words-list = "3rt,abd,aer,ans,bitap,crate,damon,fo,followings,hist,iff,kwanza,manuel,mater,secant,som,sur,tim,toi,zar"
123+
skip = "*.css,*.js,*.lock"
124+
116125
[tool.ruff]
117126
line-length = 88
118127
target-version = "py313"
119-
select = [
120-
"E", "W", "F", "I", "B", "C4", "UP", "YTT",
121-
"EM", "EXE", "G", "ISC", "PLC", "PLW", "PT", "S", "SIM", "SLF"
122-
]
123-
128+
select = ["E", "F", "I", "UP", "YTT", "PLC", "PT", "SIM"]
124129
ignore = [
125-
"B101",
126-
"B904", # Within an `except` clause, raise exceptions with `raise ... from err`
127-
"B905", # `zip()` without an explicit `strict=` parameter
128-
"EM101", # Exception must not use a string literal
129-
"EXE001", # Shebang is present but file is not executable
130-
"G004", # Logging statement uses f-string
131-
"ISC001", # Conflicts with ruff format
132-
"PLC0415",# import-outside-top-level
133-
"PLC1901",# `{}` can be simplified to `{}` as an empty string is falsey
134-
"PLW060", # Using global without assignment
135-
"PLW1641",# eq-without-hash
136-
"PLW2901",# Redefined loop variable
137-
"PT011", # pytest.raises(Exception) is too broad
138-
"PT018", # Assertion should be broken down
139-
"PT028", # pytest-parameter-with-default-argument
140-
"S101", # Use of `assert` detected
141-
"S311", # Standard pseudo-random generators
142-
"SIM905", # Consider using a list literal instead of `str.split`
143-
"SLF001", # Private member accessed
144-
"UP038", # Use `X | Y` in `{}` call
130+
"B904", "B905", "PLC0415",
131+
"PLW2901", "PT011", "PT018", "PT028",
132+
"S101", "SIM905", "UP038"
145133
]
146134

147-
max-args = 10
148-
max-branches = 20
149-
max-returns = 8
150-
max-statements = 88
135+
[tool.ruff.lint.per-file-ignores]
136+
"__init__.py" = ["F401"]
137+
"tests/**" = ["S101", "PT011", "PT018"]
138+
".*_test\\.py" = ["S101", "PT011", "PT018"]
139+
140+
[tool.mypy]
141+
python_version = "3.13"
142+
ignore_missing_imports = true
143+
exclude = ".*venv.*|.*__pycache__.*|.*migrations.*"
144+
145+
[[tool.mypy.overrides]]
146+
module = [
147+
"django.*", "tensorflow.*", "keras.*",
148+
"matplotlib.*", "pymongo.*"
149+
]
150+
ignore_missing_imports = true

0 commit comments

Comments
 (0)