Drop __about__.py and use 'version = attr:' in setup.cfg
authorAlexander Popov <alex.popov@linux.com>
Tue, 14 May 2024 13:12:43 +0000 (16:12 +0300)
committerAlexander Popov <alex.popov@linux.com>
Tue, 14 May 2024 13:12:43 +0000 (16:12 +0300)
kernel_hardening_checker/__about__.py [deleted file]
kernel_hardening_checker/__init__.py
setup.cfg
setup.py

diff --git a/kernel_hardening_checker/__about__.py b/kernel_hardening_checker/__about__.py
deleted file mode 100644 (file)
index 09abf88..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-"""
-Version
-"""
-
-__version__ = '0.6.6'
index bb4af6c1fedeb5991df48a57eaa42424445a9920..907db5fe2d96b6f06bfce0d079facef505a58700 100644 (file)
@@ -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')
index 953b045d731fb3b1ca3afeed41375d423555763a..bfe51052b252bfdaae84cc112ad1656e4aa77339 100644 (file)
--- 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
index 853fcae08a39b4b0f6073508da93e6a936c53b2c..127bfae22b2da9b11104afad21e1d60581004125 100755 (executable)
--- 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 <alex.popov@linux.com>
 
-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()