Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 30 additions & 38 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
name: CI
name: Build and Test

on:
push:
Expand All @@ -8,46 +7,39 @@ on:
branches: [master, main]

jobs:
deprecated-tests-py27:
name: Tests on 2.7.18
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel poetry
poetry config experimental.new-installer false ||:
poetry install
- name: Do lint
run: |
poetry run flake8 --max-line-length 120 --ignore=E721 .
- name: Do tests
run: |
poetry run pytest --cov uchecker -v
tests:
name: Tests on ${{ matrix.python-version }}
runs-on: ubuntu-20.04

build-and-test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.5.10", "3.6.15", "3.7.16", "3.8.16", "3.9.16", "3.10.11", "3.11.6"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} and cache dependencies
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel poetry
poetry config experimental.new-installer false ||:
poetry install
- name: Do lint
run: |
poetry run flake8 --max-line-length 120 --ignore=E721 .
- name: Do tests
run: |
poetry run pytest --cov uchecker -v
cache: 'pip'
cache-dependency-path: requirements-dev.txt

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install dependencies from locked file
run: python -m pip install -r requirements-dev.txt

- name: Install flake8
run: python -m pip install flake8

- name: Install
run: pip install -e .

- name: Run linter
run: flake8 --max-line-length 120 --ignore=E721 .

- name: Run tests
run: pytest --cov uchecker -v
40 changes: 14 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
[tool.poetry]
[project]
name = "kcare-uchecker"
version = "0.1.2"
description = "A simple tool to detect outdated shared libraries"
authors = ["Rinat Sabitov <rinat.sabitov@gmail.com>"]
license = "GPL-2.0-only"
authors = [
{ name = "Rinat Sabitov", email = "rinat.sabitov@gmail.com" },
]
license = { text = "GPL-2.0-only" }
readme = "README.md"
homepage = "https://kernelcare.com/"
repository = "https://github.com/cloudlinux/kcare-uchecker"
keywords = ["security-audit", "shared-libraries", "security-scanner", "security-tools", "secutiry"]
packages = [
{ include = "uchecker.py" },
]
requires-python = ">=2.7"

[tool.poetry.dependencies]
python = "^3.5|^3.6|^3.7|^3.8|^3.9|^2.7|^3.10"
dependencies = []

[tool.poetry.scripts]
uchecker = 'uchecker:main'
[project.scripts]
uchecker = "uchecker:main"


[tool.poetry.dev-dependencies]
pytest = [
{version = "^4.6", python = "~2.7"},
{version = "^6.0", python = "~3.5"},
{version = "^7.0", python = ">=3.6"}
# Add this section for your test dependencies
[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
]
flake8 = "^3.9.2"
pytest-coverage = "*"
mock = { version = "*", markers = "python_version < '3.8'" }
more-itertools = "*"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
18 changes: 18 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml --extra dev -o requirements-dev.txt
coverage==7.8.2
# via pytest-cov
iniconfig==2.1.0
# via pytest
packaging==25.0
# via pytest
pluggy==1.6.0
# via pytest
pygments==2.19.1
# via pytest
pytest==8.4.0
# via
# kcare-uchecker (pyproject.toml)
# pytest-cov
pytest-cov==6.1.1
# via kcare-uchecker (pyproject.toml)
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml -o requirements.txt
4 changes: 2 additions & 2 deletions uchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
from urllib2 import urlopen

LIBCARE_CLIENT = '/usr/libexec/kcare/libcare-client'
USERSPACE_JSON = 'https://gist.githubusercontent.com/histrio/f1532b287f4f6b206ddb8a903d41e423/raw/userspace.json'
KCARE_PLUS_JSON = 'https://patches.kernelcare.com/userspace-patches.json'
USERSPACE_JSON = 'https://raw.githubusercontent.com/kernelcare/public/refs/heads/main/userspace.json'
KCARE_PLUS_JSON = 'https://patches.kernelcare.com/libcare-patches.json'
LOGLEVEL = os.environ.get('LOGLEVEL', 'ERROR').upper()


Expand Down
Loading