From 7628c0d2ebf49d147aee2ae42b372f12b8c327ab Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Thu, 15 Jun 2023 17:14:32 +0200 Subject: [PATCH] packaging: provide a proper packaging (pip) for the tool Signed-off-by: Andrea Righi --- .gitignore | 1 + .../sanitize-annotations | 0 annotations => kconfig/run.py | 0 kconfig/version.py | 9 +++++ setup.py | 37 +++++++++++++++++++ 5 files changed, 47 insertions(+) rename sanitize-annotations => bin/sanitize-annotations (100%) rename annotations => kconfig/run.py (100%) mode change 100755 => 100644 create mode 100644 kconfig/version.py create mode 100755 setup.py diff --git a/.gitignore b/.gitignore index d9ff32b..b3c6196 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ __pycache__ build dist .mypy_cache +annotations.egg-info/ diff --git a/sanitize-annotations b/bin/sanitize-annotations similarity index 100% rename from sanitize-annotations rename to bin/sanitize-annotations diff --git a/annotations b/kconfig/run.py old mode 100755 new mode 100644 similarity index 100% rename from annotations rename to kconfig/run.py diff --git a/kconfig/version.py b/kconfig/version.py new file mode 100644 index 0000000..ac5ad54 --- /dev/null +++ b/kconfig/version.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# -*- mode: python -*- +# version of annotations module +# Copyright © 2022 Canonical Ltd. + +VERSION = "0.1" + +if __name__ == '__main__': + print(VERSION) diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..77fee4a --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +import os +import sys +from setuptools import setup +from kconfig.version import VERSION + +setup( + name='annotations', + version=VERSION, + author='Andrea Righi', + author_email='andrea.righi@canonical.com', + description='Manage Ubuntu kernel .config', + url='https://git.launchpad.net/~arighi/+git/annotations-tools', + license='GPLv2', + long_description=open(os.path.join(os.path.dirname(__file__), + 'README.rst'), 'r').read(), + long_description_content_type="text/x-rts", + packages=['kconfig'], + entry_points = { + 'console_scripts': [ + 'annotations = kconfig.run:main', + ] + }, + scripts = [ + 'bin/sanitize-annotations', + ], + include_package_data=True, + classifiers=['Environment :: Console', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', + 'Operating System :: POSIX :: Linux', + ], + + zip_safe = False, +) -- 2.31.1