Skip to content

Commit

Permalink
finishing the setup.py configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
João Paulo Carvalho committed Apr 4, 2021
1 parent 951963e commit eb48250
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 13 deletions.
7 changes: 4 additions & 3 deletions pipconf/__init__.py
Original file line number Diff line number Diff line change
@@ -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__ = "[email protected]"
25 changes: 20 additions & 5 deletions pipconf/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -78,4 +93,4 @@ def main() -> NoReturn:


if __name__ == "__main__":
main()
main()
24 changes: 19 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand All @@ -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",
)

0 comments on commit eb48250

Please sign in to comment.