diff --git a/pipconf/__init__.py b/pipconf/__init__.py index 5a0020d..505c7e8 100644 --- a/pipconf/__init__.py +++ b/pipconf/__init__.py @@ -1,10 +1,11 @@ # Module informations -__version__ = "0.2.0" -__name__ = "pipconf" +__version__ = "0.2.1" +__module__ = "pipconf" __description__ = "Python's PIP configuration manager" __index__ = "https://github.com/jjpaulo2/pipconf" -__license__ = "BSD 2-clause" +__license__ = "BSD 2-Clause" # Author informations __author__ = "João Paulo Carvalho" +__author_github__ = "@jjpaulo2" __author_email__ = "jjpaulo2@protonmail.com" diff --git a/pipconf/cli.py b/pipconf/cli.py index a1ec281..9083094 100644 --- a/pipconf/cli.py +++ b/pipconf/cli.py @@ -3,12 +3,20 @@ from typing import NoReturn from pipconf import __version__ +from pipconf import __module__ +from pipconf import __license__ +from pipconf import __author_github__ +from pipconf import __index__ + from pipconf import kernel from pipconf import environment -NAME = "pipconf" +NAME = __module__ VERSION = __version__ +LICENSE = __license__ +AUTHOR = __author_github__ +INDEX = __index__ DESCRIPTION = """ \033[93m______ ___________ _____ _____ _ _ ______ \033[0m \033[93m| ___ \_ _| ___ \/ __ \ _ | \ | || ___|\033[0m @@ -17,9 +25,9 @@ \033[93m| | _| |_| | | \__/\ \_/ / |\ || |\033[0m \033[93m\_| \___/\_| \____/\___/\_| \_/\_|\033[0m v{} -Under BSD-2-Clause License, by @jjpaulo2 -Contribute at https://github.com/jjpaulo2/pipconf -""".format(VERSION) +Under {} License, by {} +Contribute at {} +""".format(VERSION, LICENSE, AUTHOR, INDEX) def init_argparse() -> argparse.ArgumentParser: @@ -32,6 +40,8 @@ def init_argparse() -> argparse.ArgumentParser: formatter_class=argparse.RawTextHelpFormatter ) + parser.add_argument("-v", "--version", action="store_true", help="show the version of the module") + display = parser.add_argument_group("display informations") display.add_argument("--current", action="store_true", help="show the current pip configuration file") display.add_argument("--list", action="store_true", help="list all user configurations avaliable at $HOME/.pip") @@ -48,6 +58,11 @@ def handle_arguments(args) -> NoReturn: Function that verify all cli arguments and handle it. """ + # Module version + if args.version: + # --version + print(f"{NAME} {VERSION}") + # Display arguments if args.current: # --current @@ -78,4 +93,4 @@ def main() -> NoReturn: if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/setup.py b/setup.py index 336677e..db05202 100644 --- a/setup.py +++ b/setup.py @@ -2,8 +2,9 @@ from pipconf import __version__ from pipconf import __description__ -from pipconf import __name__ +from pipconf import __module__ from pipconf import __index__ +from pipconf import __license__ from pipconf import __author__ from pipconf import __author_email__ @@ -14,22 +15,35 @@ setuptools.setup( - name=__name__, + name=__module__, version=__version__, - author=__author__, - author_email=__author_email__, description=__description__, + license=__license__, + long_description=long_description, long_description_content_type="text/markdown", + + author=__author__, + author_email=__author_email__, + url=__index__, project_urls={ "Bug Tracker": __index__ + "/issues", }, + classifiers=[ "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", + "License :: OSI Approved :: BSD 2-Clause License", "Operating System :: Linux :: Mac OS", ], + packages=setuptools.find_packages(), + include_package_data=True, + zip_safe=False, + + entry_points = { + 'console_scripts': ['pipconf=pipconf.cli:main'], + }, + python_requires=">=3.6", )