Skip to content

Commit 583c321

Browse files
committed
chore(CI): fix pylint workflow
1 parent 30ca15c commit 583c321

File tree

4 files changed

+36
-21
lines changed

4 files changed

+36
-21
lines changed

.github/workflows/pylint.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
1-
on: [push]
1+
on:
2+
push:
3+
paths:
4+
- 'scrapegraphai/**'
5+
- '.github/workflows/pylint.yml'
26

37
jobs:
48
build:
59
runs-on: ubuntu-latest
6-
strategy:
7-
matrix:
8-
python-version: ["3.10"]
910
steps:
1011
- uses: actions/checkout@v3
11-
- name: Set up Python ${{ matrix.python-version }}
12-
uses: actions/setup-python@v3
13-
with:
14-
python-version: ${{ matrix.python-version }}
12+
- name: Install the latest version of rye
13+
uses: eifinger/setup-rye@v3
1514
- name: Install dependencies
16-
run: |
17-
python -m pip install --upgrade pip
18-
pip install pylint
19-
pip install -r requirements.txt
15+
run: rye sync --no-lock
2016
- name: Analysing the code with pylint
21-
run: pylint --disable=C0114,C0115,C0116 --exit-zero scrapegraphai/**/*.py scrapegraphai/*.py
17+
run: rye run pylint-ci
2218
- name: Check Pylint score
2319
run: |
24-
pylint_score=$(pylint --disable=all --enable=metrics --output-format=text scrapegraphai/**/*.py scrapegraphai/*.py | grep 'Raw metrics' | awk '{print $4}')
20+
pylint_score=$(rye run pylint-score-ci | grep 'Raw metrics' | awk '{print $4}')
2521
if (( $(echo "$pylint_score < 8" | bc -l) )); then
2622
echo "Pylint score is below 8. Blocking commit."
2723
exit 1
2824
else
2925
echo "Pylint score is acceptable."
30-
fi
26+
fi

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,11 @@ dev-dependencies = [
8484
"pytest-mock==3.14.0",
8585
"-e file:.[burr]",
8686
"-e file:.[docs]",
87+
"pylint>=3.2.5",
8788
]
89+
90+
[tool.rye.scripts]
91+
pylint-local = "pylint scrapegraphai/**/*.py"
92+
pylint-ci = "pylint --disable=C0114,C0115,C0116 --exit-zero scrapegraphai/**/*.py"
93+
pylint-score-ci = "pylint --disable=all --enable=metrics --output-format=text scrapegraphai/**/.py"
94+

requirements-dev.lock

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ altair==5.3.0
2222
annotated-types==0.7.0
2323
# via pydantic
2424
anthropic==0.30.0
25-
2625
# via langchain-anthropic
2726
anyio==4.4.0
2827
# via anthropic
@@ -31,6 +30,8 @@ anyio==4.4.0
3130
# via openai
3231
# via starlette
3332
# via watchfiles
33+
astroid==3.2.2
34+
# via pylint
3435
async-timeout==4.0.3
3536
# via aiohttp
3637
# via langchain
@@ -84,6 +85,8 @@ dateparser==1.2.0
8485
# via htmldate
8586
defusedxml==0.7.1
8687
# via langchain-anthropic
88+
dill==0.3.8
89+
# via pylint
8790
distro==1.9.0
8891
# via anthropic
8992
# via groq
@@ -93,7 +96,6 @@ dnspython==2.6.1
9396
docutils==0.19
9497
# via sphinx
9598
email-validator==2.2.0
96-
9799
# via fastapi
98100
exceptiongroup==1.2.1
99101
# via anyio
@@ -107,7 +109,6 @@ fastapi-cli==0.0.4
107109
fastapi-pagination==0.12.25
108110
# via burr
109111
filelock==3.15.4
110-
111112
# via huggingface-hub
112113
fonttools==4.53.0
113114
# via matplotlib
@@ -117,7 +118,6 @@ frozenlist==1.4.1
117118
# via aiohttp
118119
# via aiosignal
119120
fsspec==2024.6.1
120-
121121
# via huggingface-hub
122122
furo==2024.5.6
123123
# via scrapegraphai
@@ -153,6 +153,7 @@ graphviz==0.20.3
153153
# via scrapegraphai
154154
greenlet==3.0.3
155155
# via playwright
156+
# via sqlalchemy
156157
groq==0.9.0
157158
# via langchain-groq
158159
grpcio==1.64.1
@@ -195,6 +196,8 @@ importlib-resources==6.4.0
195196
# via matplotlib
196197
iniconfig==2.0.0
197198
# via pytest
199+
isort==5.13.2
200+
# via pylint
198201
jinja2==3.1.4
199202
# via altair
200203
# via burr
@@ -266,6 +269,8 @@ marshmallow==3.21.3
266269
# via dataclasses-json
267270
matplotlib==3.9.0
268271
# via burr
272+
mccabe==0.7.0
273+
# via pylint
269274
mdurl==0.1.2
270275
# via markdown-it-py
271276
minify-html==0.15.0
@@ -311,6 +316,8 @@ pandas==2.2.2
311316
pillow==10.3.0
312317
# via matplotlib
313318
# via streamlit
319+
platformdirs==4.2.2
320+
# via pylint
314321
playwright==1.43.0
315322
# via scrapegraphai
316323
# via undetected-playwright
@@ -355,6 +362,7 @@ pygments==2.18.0
355362
# via furo
356363
# via rich
357364
# via sphinx
365+
pylint==3.2.5
358366
pyparsing==3.1.2
359367
# via httplib2
360368
# via matplotlib
@@ -468,7 +476,10 @@ tokenizers==0.19.1
468476
toml==0.10.2
469477
# via streamlit
470478
tomli==2.0.1
479+
# via pylint
471480
# via pytest
481+
tomlkit==0.12.5
482+
# via pylint
472483
toolz==0.12.1
473484
# via altair
474485
tornado==6.4.1
@@ -487,6 +498,7 @@ typing-extensions==4.12.2
487498
# via altair
488499
# via anthropic
489500
# via anyio
501+
# via astroid
490502
# via fastapi
491503
# via fastapi-pagination
492504
# via google-generativeai
@@ -496,6 +508,7 @@ typing-extensions==4.12.2
496508
# via pydantic
497509
# via pydantic-core
498510
# via pyee
511+
# via pylint
499512
# via sf-hamilton
500513
# via sqlalchemy
501514
# via starlette
@@ -517,13 +530,11 @@ undetected-playwright==0.3.0
517530
uritemplate==4.1.1
518531
# via google-api-python-client
519532
urllib3==1.26.19
520-
521533
# via botocore
522534
# via courlan
523535
# via htmldate
524536
# via requests
525537
# via trafilatura
526-
527538
uvicorn==0.30.1
528539
# via burr
529540
# via fastapi

requirements.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ graphviz==0.20.3
101101
# via scrapegraphai
102102
greenlet==3.0.3
103103
# via playwright
104+
# via sqlalchemy
104105
groq==0.9.0
105106
# via langchain-groq
106107
grpcio==1.64.1

0 commit comments

Comments
 (0)