diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml deleted file mode 100644 index b90bd664f4a..00000000000 --- a/.github/workflows/lint_python.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: python -on: [pull_request, push] -jobs: - lint_python: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - run: pip install --upgrade pip wheel - - run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear - flake8-comprehensions isort mypy pytest pyupgrade safety - - run: bandit --recursive --skip B101 . || true # B101 is assert statements - - run: black --check . || true - - run: codespell || true # --ignore-words-list="" --skip="*.css,*.js,*.lock" - - run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - - run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 - --show-source --statistics - - run: isort --check-only --profile black . || true - - run: pip install -r requirements.txt || pip install --editable . || true - - run: mkdir --parents --verbose .mypy_cache - - run: mypy --ignore-missing-imports --install-types --non-interactive . || true - - run: pytest . || pytest --doctest-modules . - - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true - - run: safety check diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 00000000000..1cf5c058cc7 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,45 @@ +name: Python Checks + +on: [pull_request, push] + +jobs: + Test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.13' + + - name: Cache Python dependencies + id: cache-pip + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-python-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-python- + + - name: Install all dependencies and tools + run: | + python -m pip install --upgrade pip + pip install ruff bandit mypy pytest codespell + + - name: Run Codespell check + run: codespell --skip "*.json,*.txt,*.pdf" || true + + - name: Run Bandit security scan + run: bandit -r . || true + + - name: Run Ruff checks with ignored rules + run: | + ruff check . --ignore B904,B905,EM101,EXE001,G004,ISC001,PLC0415,PLC1901,PLW060,PLW1641,PLW2901,PT011,PT018,PT028,S101,S311,SIM905,SLF001,UP038 + + - name: Run Mypy type checks + run: mypy . --ignore-missing-imports || true + + - name: Run Pytest tests + run: pytest \ No newline at end of file diff --git a/Program of Reverse of any number.py b/Python Programs/Program of Reverse of any number.py similarity index 100% rename from Program of Reverse of any number.py rename to Python Programs/Program of Reverse of any number.py diff --git a/Program to print table of given number.py b/Python Programs/Program to print table of given number.py similarity index 100% rename from Program to print table of given number.py rename to Python Programs/Program to print table of given number.py diff --git a/Program to reverse Linked List( Recursive solution).py b/Python Programs/Program to reverse Linked List( Recursive solution).py similarity index 100% rename from Program to reverse Linked List( Recursive solution).py rename to Python Programs/Program to reverse Linked List( Recursive solution).py diff --git a/Python Program for Product of unique prime factors of a number.py b/Python Programs/Python Program for Product of unique prime factors of a number.py similarity index 100% rename from Python Program for Product of unique prime factors of a number.py rename to Python Programs/Python Program for Product of unique prime factors of a number.py diff --git a/Python Program for Tower of Hanoi.py b/Python Programs/Python Program for Tower of Hanoi.py similarity index 100% rename from Python Program for Tower of Hanoi.py rename to Python Programs/Python Program for Tower of Hanoi.py diff --git a/Python Program for factorial of a number.py b/Python Programs/Python Program for factorial of a number.py similarity index 100% rename from Python Program for factorial of a number.py rename to Python Programs/Python Program for factorial of a number.py diff --git a/Python Program to Count the Number of Each Vowel.py b/Python Programs/Python Program to Count the Number of Each Vowel.py similarity index 100% rename from Python Program to Count the Number of Each Vowel.py rename to Python Programs/Python Program to Count the Number of Each Vowel.py diff --git a/Python Program to Display Fibonacci Sequence Using Recursion.py b/Python Programs/Python Program to Display Fibonacci Sequence Using Recursion.py similarity index 100% rename from Python Program to Display Fibonacci Sequence Using Recursion.py rename to Python Programs/Python Program to Display Fibonacci Sequence Using Recursion.py diff --git a/Python Program to Find LCM.py b/Python Programs/Python Program to Find LCM.py similarity index 100% rename from Python Program to Find LCM.py rename to Python Programs/Python Program to Find LCM.py diff --git a/Python Program to Merge Mails.py b/Python Programs/Python Program to Merge Mails.py similarity index 100% rename from Python Program to Merge Mails.py rename to Python Programs/Python Program to Merge Mails.py diff --git a/Python Program to Print the Fibonacci sequence.py b/Python Programs/Python Program to Print the Fibonacci sequence.py similarity index 100% rename from Python Program to Print the Fibonacci sequence.py rename to Python Programs/Python Program to Print the Fibonacci sequence.py diff --git a/Python Program to Remove Punctuations from a String.py b/Python Programs/Python Program to Remove Punctuations from a String.py similarity index 100% rename from Python Program to Remove Punctuations from a String.py rename to Python Programs/Python Program to Remove Punctuations from a String.py diff --git a/Python Program to Reverse a linked list.py b/Python Programs/Python Program to Reverse a linked list.py similarity index 100% rename from Python Program to Reverse a linked list.py rename to Python Programs/Python Program to Reverse a linked list.py diff --git a/Python Program to Sort Words in Alphabetic Order.py b/Python Programs/Python Program to Sort Words in Alphabetic Order.py similarity index 100% rename from Python Program to Sort Words in Alphabetic Order.py rename to Python Programs/Python Program to Sort Words in Alphabetic Order.py diff --git a/Python Program to Transpose a Matrix.py b/Python Programs/Python Program to Transpose a Matrix.py similarity index 100% rename from Python Program to Transpose a Matrix.py rename to Python Programs/Python Program to Transpose a Matrix.py diff --git a/python program for finding square root for positive number.py b/Python Programs/python program for finding square root for positive number.py similarity index 100% rename from python program for finding square root for positive number.py rename to Python Programs/python program for finding square root for positive number.py diff --git a/requirements_with_versions.txt b/requirements_with_versions.txt index 7bd0da0fbcc..cd15a31226c 100644 --- a/requirements_with_versions.txt +++ b/requirements_with_versions.txt @@ -37,7 +37,7 @@ xlrd==2.0.2 fpdf==1.7.2 mysql-connector-repackaged==0.3.1 word2number==1.1 -tornado==6.5.1 +tornado==6.5.2 obs==0.0.0 todo==0.1 oauth2client==4.1.3 @@ -81,7 +81,7 @@ Unidecode==1.4.0 Ball==0.2.9 pynput==1.8.1 gTTS==2.5.4 -ccxt==4.4.99 +ccxt==4.5.0 fitz==0.0.1.dev2 fastapi==0.116.1 Django==5.1.7 @@ -100,7 +100,7 @@ pandas==2.3.1 pytest==8.4.1 qrcode==8.2 googletrans==4.0.2 -slab==1.8.0 +slab==1.8.2 psutil==7.0.0 mediapipe==0.10.21 rich==14.1.0