From 204b18e284d18c7aa161eeee42fa3fb8dd1a9d8d Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 14 May 2024 16:12:43 +0300 Subject: [PATCH] Drop __about__.py and use 'version = attr:' in setup.cfg --- kernel_hardening_checker/__about__.py | 5 ----- kernel_hardening_checker/__init__.py | 5 ++++- setup.cfg | 1 + setup.py | 14 ++++++++------ 4 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 kernel_hardening_checker/__about__.py diff --git a/kernel_hardening_checker/__about__.py b/kernel_hardening_checker/__about__.py deleted file mode 100644 index 09abf88..0000000 --- a/kernel_hardening_checker/__about__.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Version -""" - -__version__ = '0.6.6' diff --git a/kernel_hardening_checker/__init__.py b/kernel_hardening_checker/__init__.py index bb4af6c..907db5f 100644 --- a/kernel_hardening_checker/__init__.py +++ b/kernel_hardening_checker/__init__.py @@ -16,12 +16,15 @@ from argparse import ArgumentParser from typing import List, Tuple, Dict, TextIO import re import json -from .__about__ import __version__ from .checks import add_kconfig_checks, add_cmdline_checks, normalize_cmdline_options, add_sysctl_checks from .engine import StrOrNone, TupleOrNone, ChecklistObjType from .engine import print_unknown_options, populate_with_data, perform_checks, override_expected_value +# kernel-hardening-checker version +__version__ = '0.6.6' + + def _open(file: str) -> TextIO: if file.endswith('.gz'): return gzip.open(file, 'rt', encoding='utf-8') diff --git a/setup.cfg b/setup.cfg index 953b045..bfe5105 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [metadata] name = kernel-hardening-checker +version = attr: kernel_hardening_checker.__version__ author = Alexander Popov author_email = alex.popov@linux.com home_page = https://github.com/a13xp0p0v/kernel-hardening-checker diff --git a/setup.py b/setup.py index 853fcae..127bfae 100755 --- a/setup.py +++ b/setup.py @@ -1,12 +1,14 @@ #!/usr/bin/env python3 -from setuptools import setup +""" +This tool is for checking the security hardening options of the Linux kernel. + +Author: Alexander Popov -about = {} -with open('kernel_hardening_checker/__about__.py') as f: - exec(f.read(), about) +This module performs installing of the kernel-hardening-checker package. +""" -print('v: "{}"'.format(about['__version__'])) +from setuptools import setup # See the options in setup.cfg -setup(version = about['__version__']) +setup() -- 2.31.1