From 3d1a5583898a50268ff3c51682bd5dae2bc30fb6 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 29 Jul 2019 22:10:40 +0200 Subject: [PATCH] setup.py --- setup.py | 43 +++++++++++-------- .../data/compare/10_positional/argparse.py | 0 .../data/compare/10_positional/tiramisu.py | 0 .../compare/10_positional_default/argparse.py | 0 .../compare/10_positional_default/tiramisu.py | 0 .../compare/10_positional_int/argparse.py | 0 .../compare/10_positional_int/tiramisu.py | 0 .../compare/10_positional_list/argparse.py | 0 .../compare/10_positional_list/tiramisu.py | 0 .../data/compare/20_bool/argparse.py | 0 .../data/compare/20_bool/tiramisu.py | 0 .../data/compare/20_bool_true/argparse.py | 0 .../data/compare/20_bool_true/tiramisu.py | 0 .../data/compare/20_choice/argparse.py | 0 .../data/compare/20_choice/tiramisu.py | 0 .../data/compare/20_int/argparse.py | 0 .../data/compare/20_int/tiramisu.py | 0 .../data/compare/20_string/argparse.py | 0 .../data/compare/20_string/tiramisu.py | 0 .../data/compare/20_string_list/argparse.py | 0 .../data/compare/20_string_list/tiramisu.py | 0 .../data/compare/30_choice_int/argparse.py | 0 .../data/compare/30_choice_int/tiramisu.py | 0 .../compare/30_string_default/argparse.py | 0 .../compare/30_string_default/tiramisu.py | 0 .../data/compare/30_string_short/argparse.py | 0 .../data/compare/30_string_short/tiramisu.py | 0 .../data/compare/40_multi_bool/argparse.py | 0 .../data/compare/40_multi_bool/tiramisu.py | 0 .../40_positional_optional/argparse.py | 0 .../40_positional_optional/tiramisu.py | 0 .../data/compare/40_short_long/argparse.py | 0 .../data/compare/40_short_long/tiramisu.py | 0 {test => tests}/test_help.py | 0 {test => tests}/test_leadership.py | 0 {test => tests}/test_optiondescription.py | 0 {test => tests}/test_readme.py | 0 {test => tests}/test_shortarg.py | 0 tiramisu_cmdline_parser/__init__.py | 2 +- tiramisu_cmdline_parser/api.py | 7 ++- 40 files changed, 30 insertions(+), 22 deletions(-) rename {test => tests}/data/compare/10_positional/argparse.py (100%) rename {test => tests}/data/compare/10_positional/tiramisu.py (100%) rename {test => tests}/data/compare/10_positional_default/argparse.py (100%) rename {test => tests}/data/compare/10_positional_default/tiramisu.py (100%) rename {test => tests}/data/compare/10_positional_int/argparse.py (100%) rename {test => tests}/data/compare/10_positional_int/tiramisu.py (100%) rename {test => tests}/data/compare/10_positional_list/argparse.py (100%) rename {test => tests}/data/compare/10_positional_list/tiramisu.py (100%) rename {test => tests}/data/compare/20_bool/argparse.py (100%) rename {test => tests}/data/compare/20_bool/tiramisu.py (100%) rename {test => tests}/data/compare/20_bool_true/argparse.py (100%) rename {test => tests}/data/compare/20_bool_true/tiramisu.py (100%) rename {test => tests}/data/compare/20_choice/argparse.py (100%) rename {test => tests}/data/compare/20_choice/tiramisu.py (100%) rename {test => tests}/data/compare/20_int/argparse.py (100%) rename {test => tests}/data/compare/20_int/tiramisu.py (100%) rename {test => tests}/data/compare/20_string/argparse.py (100%) rename {test => tests}/data/compare/20_string/tiramisu.py (100%) rename {test => tests}/data/compare/20_string_list/argparse.py (100%) rename {test => tests}/data/compare/20_string_list/tiramisu.py (100%) rename {test => tests}/data/compare/30_choice_int/argparse.py (100%) rename {test => tests}/data/compare/30_choice_int/tiramisu.py (100%) rename {test => tests}/data/compare/30_string_default/argparse.py (100%) rename {test => tests}/data/compare/30_string_default/tiramisu.py (100%) rename {test => tests}/data/compare/30_string_short/argparse.py (100%) rename {test => tests}/data/compare/30_string_short/tiramisu.py (100%) rename {test => tests}/data/compare/40_multi_bool/argparse.py (100%) rename {test => tests}/data/compare/40_multi_bool/tiramisu.py (100%) rename {test => tests}/data/compare/40_positional_optional/argparse.py (100%) rename {test => tests}/data/compare/40_positional_optional/tiramisu.py (100%) rename {test => tests}/data/compare/40_short_long/argparse.py (100%) rename {test => tests}/data/compare/40_short_long/tiramisu.py (100%) rename {test => tests}/test_help.py (100%) rename {test => tests}/test_leadership.py (100%) rename {test => tests}/test_optiondescription.py (100%) rename {test => tests}/test_readme.py (100%) rename {test => tests}/test_shortarg.py (100%) diff --git a/setup.py b/setup.py index 71b5174..c5009f1 100644 --- a/setup.py +++ b/setup.py @@ -1,29 +1,34 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- - from setuptools import setup, find_packages +import os +from tiramisu_cmdline_parser import __version__ -import tiramisu_cmdline_parser + +PACKAGE_NAME = os.environ.get('PACKAGE_DST', 'tiramisu_cmdline_parser') setup( - name='tiramisu_cmdline_parser', - version=tiramisu_cmdline_parser.__version__, - packages=find_packages(), - author="Emmanuel Garette & Tiramisu Team", - description="command-line parser using Tiramisu.", - long_description=""" - Python3 parser for command-line options and arguments using Tiramisu engine. - """, - include_package_data=True, + version=__version__, + author="Tiramisu's team", + author_email='gnunux@gnunux.info', + name=PACKAGE_NAME, + description="command-line parser using Tiramisu.", url='https://framagit.org/tiramisu/tiramisu-cmdline-parser', - + license='GNU Library or Lesser General Public License (LGPL)', + install_requires=["tiramisu_api>=0.1"], classifiers=[ - "Programming Language :: Python", - "Development Status :: 1 - Planning", - "License :: LGPLv3", - "Natural Language :: French", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Topic :: Communications", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", + "Operating System :: OS Independent", + "Natural Language :: English", + "Natural Language :: French", ], + long_description="""\ +tiramisu-cmdline-parser +--------------------------------- + +Python3 parser for command-line options and arguments using Tiramisu engine. +""", + include_package_data=True, + packages=find_packages(include=['tiramisu_cmdline_parser']) ) diff --git a/test/data/compare/10_positional/argparse.py b/tests/data/compare/10_positional/argparse.py similarity index 100% rename from test/data/compare/10_positional/argparse.py rename to tests/data/compare/10_positional/argparse.py diff --git a/test/data/compare/10_positional/tiramisu.py b/tests/data/compare/10_positional/tiramisu.py similarity index 100% rename from test/data/compare/10_positional/tiramisu.py rename to tests/data/compare/10_positional/tiramisu.py diff --git a/test/data/compare/10_positional_default/argparse.py b/tests/data/compare/10_positional_default/argparse.py similarity index 100% rename from test/data/compare/10_positional_default/argparse.py rename to tests/data/compare/10_positional_default/argparse.py diff --git a/test/data/compare/10_positional_default/tiramisu.py b/tests/data/compare/10_positional_default/tiramisu.py similarity index 100% rename from test/data/compare/10_positional_default/tiramisu.py rename to tests/data/compare/10_positional_default/tiramisu.py diff --git a/test/data/compare/10_positional_int/argparse.py b/tests/data/compare/10_positional_int/argparse.py similarity index 100% rename from test/data/compare/10_positional_int/argparse.py rename to tests/data/compare/10_positional_int/argparse.py diff --git a/test/data/compare/10_positional_int/tiramisu.py b/tests/data/compare/10_positional_int/tiramisu.py similarity index 100% rename from test/data/compare/10_positional_int/tiramisu.py rename to tests/data/compare/10_positional_int/tiramisu.py diff --git a/test/data/compare/10_positional_list/argparse.py b/tests/data/compare/10_positional_list/argparse.py similarity index 100% rename from test/data/compare/10_positional_list/argparse.py rename to tests/data/compare/10_positional_list/argparse.py diff --git a/test/data/compare/10_positional_list/tiramisu.py b/tests/data/compare/10_positional_list/tiramisu.py similarity index 100% rename from test/data/compare/10_positional_list/tiramisu.py rename to tests/data/compare/10_positional_list/tiramisu.py diff --git a/test/data/compare/20_bool/argparse.py b/tests/data/compare/20_bool/argparse.py similarity index 100% rename from test/data/compare/20_bool/argparse.py rename to tests/data/compare/20_bool/argparse.py diff --git a/test/data/compare/20_bool/tiramisu.py b/tests/data/compare/20_bool/tiramisu.py similarity index 100% rename from test/data/compare/20_bool/tiramisu.py rename to tests/data/compare/20_bool/tiramisu.py diff --git a/test/data/compare/20_bool_true/argparse.py b/tests/data/compare/20_bool_true/argparse.py similarity index 100% rename from test/data/compare/20_bool_true/argparse.py rename to tests/data/compare/20_bool_true/argparse.py diff --git a/test/data/compare/20_bool_true/tiramisu.py b/tests/data/compare/20_bool_true/tiramisu.py similarity index 100% rename from test/data/compare/20_bool_true/tiramisu.py rename to tests/data/compare/20_bool_true/tiramisu.py diff --git a/test/data/compare/20_choice/argparse.py b/tests/data/compare/20_choice/argparse.py similarity index 100% rename from test/data/compare/20_choice/argparse.py rename to tests/data/compare/20_choice/argparse.py diff --git a/test/data/compare/20_choice/tiramisu.py b/tests/data/compare/20_choice/tiramisu.py similarity index 100% rename from test/data/compare/20_choice/tiramisu.py rename to tests/data/compare/20_choice/tiramisu.py diff --git a/test/data/compare/20_int/argparse.py b/tests/data/compare/20_int/argparse.py similarity index 100% rename from test/data/compare/20_int/argparse.py rename to tests/data/compare/20_int/argparse.py diff --git a/test/data/compare/20_int/tiramisu.py b/tests/data/compare/20_int/tiramisu.py similarity index 100% rename from test/data/compare/20_int/tiramisu.py rename to tests/data/compare/20_int/tiramisu.py diff --git a/test/data/compare/20_string/argparse.py b/tests/data/compare/20_string/argparse.py similarity index 100% rename from test/data/compare/20_string/argparse.py rename to tests/data/compare/20_string/argparse.py diff --git a/test/data/compare/20_string/tiramisu.py b/tests/data/compare/20_string/tiramisu.py similarity index 100% rename from test/data/compare/20_string/tiramisu.py rename to tests/data/compare/20_string/tiramisu.py diff --git a/test/data/compare/20_string_list/argparse.py b/tests/data/compare/20_string_list/argparse.py similarity index 100% rename from test/data/compare/20_string_list/argparse.py rename to tests/data/compare/20_string_list/argparse.py diff --git a/test/data/compare/20_string_list/tiramisu.py b/tests/data/compare/20_string_list/tiramisu.py similarity index 100% rename from test/data/compare/20_string_list/tiramisu.py rename to tests/data/compare/20_string_list/tiramisu.py diff --git a/test/data/compare/30_choice_int/argparse.py b/tests/data/compare/30_choice_int/argparse.py similarity index 100% rename from test/data/compare/30_choice_int/argparse.py rename to tests/data/compare/30_choice_int/argparse.py diff --git a/test/data/compare/30_choice_int/tiramisu.py b/tests/data/compare/30_choice_int/tiramisu.py similarity index 100% rename from test/data/compare/30_choice_int/tiramisu.py rename to tests/data/compare/30_choice_int/tiramisu.py diff --git a/test/data/compare/30_string_default/argparse.py b/tests/data/compare/30_string_default/argparse.py similarity index 100% rename from test/data/compare/30_string_default/argparse.py rename to tests/data/compare/30_string_default/argparse.py diff --git a/test/data/compare/30_string_default/tiramisu.py b/tests/data/compare/30_string_default/tiramisu.py similarity index 100% rename from test/data/compare/30_string_default/tiramisu.py rename to tests/data/compare/30_string_default/tiramisu.py diff --git a/test/data/compare/30_string_short/argparse.py b/tests/data/compare/30_string_short/argparse.py similarity index 100% rename from test/data/compare/30_string_short/argparse.py rename to tests/data/compare/30_string_short/argparse.py diff --git a/test/data/compare/30_string_short/tiramisu.py b/tests/data/compare/30_string_short/tiramisu.py similarity index 100% rename from test/data/compare/30_string_short/tiramisu.py rename to tests/data/compare/30_string_short/tiramisu.py diff --git a/test/data/compare/40_multi_bool/argparse.py b/tests/data/compare/40_multi_bool/argparse.py similarity index 100% rename from test/data/compare/40_multi_bool/argparse.py rename to tests/data/compare/40_multi_bool/argparse.py diff --git a/test/data/compare/40_multi_bool/tiramisu.py b/tests/data/compare/40_multi_bool/tiramisu.py similarity index 100% rename from test/data/compare/40_multi_bool/tiramisu.py rename to tests/data/compare/40_multi_bool/tiramisu.py diff --git a/test/data/compare/40_positional_optional/argparse.py b/tests/data/compare/40_positional_optional/argparse.py similarity index 100% rename from test/data/compare/40_positional_optional/argparse.py rename to tests/data/compare/40_positional_optional/argparse.py diff --git a/test/data/compare/40_positional_optional/tiramisu.py b/tests/data/compare/40_positional_optional/tiramisu.py similarity index 100% rename from test/data/compare/40_positional_optional/tiramisu.py rename to tests/data/compare/40_positional_optional/tiramisu.py diff --git a/test/data/compare/40_short_long/argparse.py b/tests/data/compare/40_short_long/argparse.py similarity index 100% rename from test/data/compare/40_short_long/argparse.py rename to tests/data/compare/40_short_long/argparse.py diff --git a/test/data/compare/40_short_long/tiramisu.py b/tests/data/compare/40_short_long/tiramisu.py similarity index 100% rename from test/data/compare/40_short_long/tiramisu.py rename to tests/data/compare/40_short_long/tiramisu.py diff --git a/test/test_help.py b/tests/test_help.py similarity index 100% rename from test/test_help.py rename to tests/test_help.py diff --git a/test/test_leadership.py b/tests/test_leadership.py similarity index 100% rename from test/test_leadership.py rename to tests/test_leadership.py diff --git a/test/test_optiondescription.py b/tests/test_optiondescription.py similarity index 100% rename from test/test_optiondescription.py rename to tests/test_optiondescription.py diff --git a/test/test_readme.py b/tests/test_readme.py similarity index 100% rename from test/test_readme.py rename to tests/test_readme.py diff --git a/test/test_shortarg.py b/tests/test_shortarg.py similarity index 100% rename from test/test_shortarg.py rename to tests/test_shortarg.py diff --git a/tiramisu_cmdline_parser/__init__.py b/tiramisu_cmdline_parser/__init__.py index 83f9863..7a3cc2f 100644 --- a/tiramisu_cmdline_parser/__init__.py +++ b/tiramisu_cmdline_parser/__init__.py @@ -1,4 +1,4 @@ from .api import TiramisuCmdlineParser -__version__ = "0.0.1" +__version__ = "0.1" __all__ = ('TiramisuCmdlineParser',) diff --git a/tiramisu_cmdline_parser/api.py b/tiramisu_cmdline_parser/api.py index 3338fa3..1ee08c1 100644 --- a/tiramisu_cmdline_parser/api.py +++ b/tiramisu_cmdline_parser/api.py @@ -154,7 +154,10 @@ class _BuildKwargs: self.force_no = force_no self.force_del = force_del if not self.force_no and not self.force_del: - self.kwargs['help'] = option.doc().replace('%', '%%') + description = option.doc() + if not description: + description = description.replace('%', '%%') + self.kwargs['help'] = description if 'positional' not in self.properties: is_short_name = self.cmdlineparser._is_short_name(name, 'longargument' in self.properties) if self.force_no: @@ -335,7 +338,7 @@ class TiramisuCmdlineParser(ArgumentParser): continue if obj.option.isoptiondescription(): if _forhelp: - newgroup = self.add_argument_group(obj.option.path(), obj.option.doc()) + newgroup = self.add_argument_group(obj.option.path(), obj.option.description()) else: newgroup = group if prefix: