Skip to content

Commit 34a98e0

Browse files
authored
Replaced outdated datasources (#58)
- temporary removing legacy pythons from test workflow
1 parent 4352eb3 commit 34a98e0

File tree

6 files changed

+1393
-66
lines changed

6 files changed

+1393
-66
lines changed

.github/workflows/python-tests.yml

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
---
2-
name: CI
1+
name: Build and Test
32

43
on:
54
push:
@@ -8,46 +7,39 @@ on:
87
branches: [master, main]
98

109
jobs:
11-
deprecated-tests-py27:
12-
name: Tests on 2.7.18
13-
runs-on: ubuntu-20.04
14-
container:
15-
image: python:2.7.18-buster
16-
steps:
17-
- uses: actions/checkout@v3
18-
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip setuptools wheel poetry
21-
poetry config experimental.new-installer false ||:
22-
poetry install
23-
- name: Do lint
24-
run: |
25-
poetry run flake8 --max-line-length 120 --ignore=E721 .
26-
- name: Do tests
27-
run: |
28-
poetry run pytest --cov uchecker -v
29-
tests:
30-
name: Tests on ${{ matrix.python-version }}
31-
runs-on: ubuntu-20.04
32-
10+
build-and-test:
11+
name: Test on Python ${{ matrix.python-version }}
12+
runs-on: ubuntu-latest
3313
strategy:
14+
fail-fast: false
3415
matrix:
35-
python-version: ["3.5.10", "3.6.15", "3.7.16", "3.8.16", "3.9.16", "3.10.11", "3.11.6"]
16+
python-version: ["3.9", "3.10", "3.11", "3.12"]
3617

3718
steps:
38-
- uses: actions/checkout@v3
39-
- uses: actions/setup-python@v4
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }} and cache dependencies
23+
uses: actions/setup-python@v5
4024
with:
4125
python-version: ${{ matrix.python-version }}
42-
- name: Install dependencies
43-
run: |
44-
python -m pip install --upgrade pip setuptools wheel poetry
45-
poetry config experimental.new-installer false ||:
46-
poetry install
47-
- name: Do lint
48-
run: |
49-
poetry run flake8 --max-line-length 120 --ignore=E721 .
50-
- name: Do tests
51-
run: |
52-
poetry run pytest --cov uchecker -v
26+
cache: 'pip'
27+
cache-dependency-path: requirements-dev.txt
28+
29+
- name: Upgrade pip
30+
run: python -m pip install --upgrade pip
31+
32+
- name: Install dependencies from locked file
33+
run: python -m pip install -r requirements-dev.txt
34+
35+
- name: Install flake8
36+
run: python -m pip install flake8
37+
38+
- name: Install
39+
run: pip install -e .
40+
41+
- name: Run linter
42+
run: flake8 --max-line-length 120 --ignore=E721 .
5343

44+
- name: Run tests
45+
run: pytest --cov uchecker -v

pyproject.toml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,23 @@
1-
[tool.poetry]
1+
[project]
22
name = "kcare-uchecker"
33
version = "0.1.2"
44
description = "A simple tool to detect outdated shared libraries"
5-
authors = ["Rinat Sabitov <[email protected]>"]
6-
license = "GPL-2.0-only"
5+
authors = [
6+
{ name = "Rinat Sabitov", email = "[email protected]" },
7+
]
8+
license = { text = "GPL-2.0-only" }
79
readme = "README.md"
8-
homepage = "https://kernelcare.com/"
9-
repository = "https://github.com/cloudlinux/kcare-uchecker"
1010
keywords = ["security-audit", "shared-libraries", "security-scanner", "security-tools", "secutiry"]
11-
packages = [
12-
{ include = "uchecker.py" },
13-
]
11+
requires-python = ">=2.7"
1412

15-
[tool.poetry.dependencies]
16-
python = "^3.5|^3.6|^3.7|^3.8|^3.9|^2.7|^3.10"
13+
dependencies = []
1714

18-
[tool.poetry.scripts]
19-
uchecker = 'uchecker:main'
15+
[project.scripts]
16+
uchecker = "uchecker:main"
2017

21-
22-
[tool.poetry.dev-dependencies]
23-
pytest = [
24-
{version = "^4.6", python = "~2.7"},
25-
{version = "^6.0", python = "~3.5"},
26-
{version = "^7.0", python = ">=3.6"}
18+
# Add this section for your test dependencies
19+
[project.optional-dependencies]
20+
dev = [
21+
"pytest",
22+
"pytest-cov",
2723
]
28-
flake8 = "^3.9.2"
29-
pytest-coverage = "*"
30-
mock = { version = "*", markers = "python_version < '3.8'" }
31-
more-itertools = "*"
32-
33-
[build-system]
34-
requires = ["poetry-core>=1.0.0"]
35-
build-backend = "poetry.core.masonry.api"

requirements-dev.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile pyproject.toml --extra dev -o requirements-dev.txt
3+
coverage==7.8.2
4+
# via pytest-cov
5+
iniconfig==2.1.0
6+
# via pytest
7+
packaging==25.0
8+
# via pytest
9+
pluggy==1.6.0
10+
# via pytest
11+
pygments==2.19.1
12+
# via pytest
13+
pytest==8.4.0
14+
# via
15+
# kcare-uchecker (pyproject.toml)
16+
# pytest-cov
17+
pytest-cov==6.1.1
18+
# via kcare-uchecker (pyproject.toml)

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile pyproject.toml -o requirements.txt

uchecker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
from urllib2 import urlopen
5454

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

6060

0 commit comments

Comments
 (0)