From 08e4564a1b0c97e32797434c4f243e0c6a079e4b Mon Sep 17 00:00:00 2001 From: Andre Filho Date: Fri, 14 Jun 2019 12:54:01 -0300 Subject: [PATCH 01/25] add(documentation): added docstrings to all functions --- commit_helper/__main__.py | 8 +++-- commit_helper/conventions/atom.py | 6 ++++ .../conventions/convention_help_handler.py | 12 ++++--- .../conventions/custom_convention.py | 5 ++- commit_helper/conventions/karma_angular.py | 6 ++++ commit_helper/conventions/no_convention.py | 3 ++ commit_helper/conventions/symphony_cmf.py | 6 ++++ commit_helper/conventions/tagged.py | 6 ++++ commit_helper/utils/file_handler.py | 12 +++++-- commit_helper/utils/flag_commit_handler.py | 8 +++-- commit_helper/utils/text_utils.py | 25 +++++++++++++ commit_helper/utils/utils.py | 35 +++++++++++++------ 12 files changed, 108 insertions(+), 24 deletions(-) diff --git a/commit_helper/__main__.py b/commit_helper/__main__.py index 3246115..686fbc2 100755 --- a/commit_helper/__main__.py +++ b/commit_helper/__main__.py @@ -1,16 +1,18 @@ -# dependencies imports from pathlib import Path -# utils imports + from .utils.utils import parser_cli from .utils.text_utils import debug from .utils.file_handler import handle_file_based_commit from .utils.file_handler import get_file_path from .utils.flag_commit_handler import convention_flag_handler -# convention imports + from .conventions.convention_help_handler import convention_help_handler def main(): + """ + Main function. Called by CLI. + """ parser = parser_cli() args = parser.parse_args() debug_mode = args.debug diff --git a/commit_helper/conventions/atom.py b/commit_helper/conventions/atom.py index d4c51b4..7137336 100644 --- a/commit_helper/conventions/atom.py +++ b/commit_helper/conventions/atom.py @@ -1,4 +1,10 @@ def atom_convention(tag, msg): + """ + Formats the commit following the atom convention format: + The atom convention: + + :: + """ tag = tag.lower() msg = msg.capitalize() composed_message = ":%s: %s\n" % (tag, msg) diff --git a/commit_helper/conventions/convention_help_handler.py b/commit_helper/conventions/convention_help_handler.py index a1b2de3..3085c74 100644 --- a/commit_helper/conventions/convention_help_handler.py +++ b/commit_helper/conventions/convention_help_handler.py @@ -1,14 +1,12 @@ -# dependencies imports from yaml import safe_load from yaml import YAMLError -# convention imports + from .atom import atom_convention_help from .tagged import tagged_convention_help from .karma_angular import karma_convention_help from .karma_angular import angular_convention_help from .symphony_cmf import symphony_convention_help -# utils imports -from commit_helper.utils.colors import HELP + from commit_helper.utils.colors import RESET from commit_helper.utils.colors import MIN_ERROR from commit_helper.utils.text_utils import debug @@ -18,6 +16,9 @@ # TODO: test def convention_help_handler(file_path, args, debug_mode): + """ + Handles the user's help request. + """ if file_path.is_file() and args.convention is '': debug('Found file for help', str(file_path), debug_mode) with open(str(file_path)) as target: @@ -42,6 +43,9 @@ def convention_help_handler(file_path, args, debug_mode): # TODO: test def get_help_to_defined_convention(convention, debug_mode): + """ + Prints the help menu to the base conventions. + """ debug('recieved convention for help catch', convention, debug_mode) if convention == 'angular': print_help(angular_convention_help) diff --git a/commit_helper/conventions/custom_convention.py b/commit_helper/conventions/custom_convention.py index b78f87f..ff3be03 100644 --- a/commit_helper/conventions/custom_convention.py +++ b/commit_helper/conventions/custom_convention.py @@ -1,9 +1,12 @@ -# custom commits are only acceptable when you have a config file from commit_helper.utils.text_utils import debug from commit_helper.utils.text_utils import get_context +# custom commits are only acceptable when you have a config file def custom_convention(tag, message, config_file, debug_mode): + """ + Formats the given arguments to make a custom commit message. + """ debug('tag', tag, debug_mode) debug('message', message, debug_mode) debug('pattern from file', config_file['commit_pattern'], debug_mode) diff --git a/commit_helper/conventions/karma_angular.py b/commit_helper/conventions/karma_angular.py index a72aaa8..9148954 100644 --- a/commit_helper/conventions/karma_angular.py +++ b/commit_helper/conventions/karma_angular.py @@ -1,4 +1,10 @@ def karma_angular_convention(tag, msg, context): + """ + Handles the formatting for both karma and angular conventions. + + Convention structure: + (): + """ tag = tag.lower() if context == '': composed_message = "%s: %s\n" % (tag, msg) diff --git a/commit_helper/conventions/no_convention.py b/commit_helper/conventions/no_convention.py index 26404f7..177d217 100644 --- a/commit_helper/conventions/no_convention.py +++ b/commit_helper/conventions/no_convention.py @@ -3,6 +3,9 @@ def just_message(msg=''): + """ + Formats the message to capitalize. + """ if msg == '': message = str(input(INPUT_COLOR + "commit message: " + RESET)) else: diff --git a/commit_helper/conventions/symphony_cmf.py b/commit_helper/conventions/symphony_cmf.py index ff1d8a4..de2a749 100644 --- a/commit_helper/conventions/symphony_cmf.py +++ b/commit_helper/conventions/symphony_cmf.py @@ -1,4 +1,10 @@ def symphony_convention(tag, msg): + """ + Formats the commit following the symphony convention. + + The symphony CMF convention: + [] + """ tag = tag.capitalize() composed = "[%s] %s\n" % (tag, msg) return composed diff --git a/commit_helper/conventions/tagged.py b/commit_helper/conventions/tagged.py index ba84497..053a6ce 100644 --- a/commit_helper/conventions/tagged.py +++ b/commit_helper/conventions/tagged.py @@ -1,4 +1,10 @@ def tagged_convention(tag, msg): + """ + Formats the convention following the tag convention. + + The tagged convention: + : + """ tag = tag.upper() composed_message = "%s: %s\n" % (tag, msg) return composed_message diff --git a/commit_helper/utils/file_handler.py b/commit_helper/utils/file_handler.py index 036ba88..b7c1d57 100644 --- a/commit_helper/utils/file_handler.py +++ b/commit_helper/utils/file_handler.py @@ -2,7 +2,7 @@ from pathlib import Path from yaml import safe_load from yaml import YAMLError -# utils imports + from .text_utils import debug from .text_utils import notify from .text_utils import get_text @@ -10,12 +10,16 @@ from .utils import dump_convention from .utils import validate_commiter_file from .utils import handle_conventioned_commit -# conventions imports + from commit_helper.conventions.no_convention import just_message from commit_helper.conventions.custom_convention import custom_convention def handle_file_based_commit(file_path, debug_mode, args): + """ + Function that handles all the logic involved in commits with previous + configuration file. + """ with open(str(file_path), 'r') as stream: try: config = safe_load(stream) @@ -48,6 +52,10 @@ def handle_file_based_commit(file_path, debug_mode, args): def get_file_path(): # pragma: no cover + """ + Searchs on the folder the program was called if there is a commiter.yml or a + commit-helper.yml file and returns it's path if exists. + """ commiter = Path('commiter.yml') commit_h = Path('commit-helper.yml') diff --git a/commit_helper/utils/flag_commit_handler.py b/commit_helper/utils/flag_commit_handler.py index 368793f..e0d00fd 100644 --- a/commit_helper/utils/flag_commit_handler.py +++ b/commit_helper/utils/flag_commit_handler.py @@ -1,15 +1,17 @@ -# dependencies imports from os import system -# utils imports + from .text_utils import debug from .utils import create_file from .utils import gen_co_author from .utils import handle_conventioned_commit -# conventions imports + from commit_helper.conventions.no_convention import just_message def convention_flag_handler(args, debug_mode): + """ + Handles the commit configuration and creation through flags. + """ convention = str(args.convention) debug('convention flag', convention, debug_mode) commit_message = '' diff --git a/commit_helper/utils/text_utils.py b/commit_helper/utils/text_utils.py index e94c860..029dbe8 100644 --- a/commit_helper/utils/text_utils.py +++ b/commit_helper/utils/text_utils.py @@ -6,44 +6,69 @@ def get_text(): + """ + Gets the input for both tag and message. + """ tag = str(input(INPUT_COLOR + 'type the tag: ' + RESET)) msg = str(input(INPUT_COLOR + 'type the commit message: ' + RESET)).lower() return tag, msg def get_context(): + """ + Gets the input for the commit context and formats it to lowercase. + """ context = str(input(INPUT_COLOR + 'type the context: ' + RESET) or '') context.lower() return context def sanitize_as_empty_string(string): + """ + Checks if arg is None and returns it as an empty string. + """ if string is None: return '' return string def notify(message): + """ + Colored formatted print for notifications. + """ print(NOTIFY_COLOR + str(message) + RESET) def debug(message, value, show=False): + """ + Colored formatted print for debugging. + """ if show: mid = 'DEBUG: ' + str(message) + ' ~> ' + str(value) print(DEBUG_COLOR + mid + RESET) def print_help(message): + """ + Colored formatted print for help menus. + """ print(HELP + str(message) + RESET) def handle_tag_message_args(tag='', message=''): + """ + Checks if args are empty strings, if so it calls the get_text function. + """ if tag + message is not '': return tag, message return get_text() def handle_context_arg(context=''): + """ + Checks if context is empty and if it is calls a input function to get the + context. + """ if context is not '': return context return get_context() diff --git a/commit_helper/utils/utils.py b/commit_helper/utils/utils.py index 4952652..51f5d40 100644 --- a/commit_helper/utils/utils.py +++ b/commit_helper/utils/utils.py @@ -21,6 +21,10 @@ def gen_co_author(co_author): + """ + Formats the co-author for putting into the commit body if it is not an empty + string. + """ if co_author is '': return '' return '\nCo-authored-by: %s' % co_author @@ -28,17 +32,23 @@ def gen_co_author(co_author): # TEST def create_file(convention_name, dont_create=False): # pragma: no cover + """ + Creates a commit-helper.yml file with the given convention. + """ if not dont_create: data = dict( convention=convention_name ) - with open('commiter.yml', 'w') as output_file: + with open('commit-helper.yml', 'w') as output_file: output_file.write(dump(data, stream=None, default_flow_style=False)) notify('Successfully created the commiter file.') def parser_cli(): + """ + Calls argparser's parser to handle the CLI arguments. + """ desc = 'A commit formatter tool to help you follow commit conventions.' help_convention = \ """ @@ -48,35 +58,30 @@ def parser_cli(): parser = argparse.ArgumentParser(description=desc) parser.add_argument('-t', '--tag', dest='tag', default='', help='Pass your commit tag directly') - parser.add_argument('-m', '--message', dest='message', default='', help='Pass your commit message directly') - parser.add_argument('-ct', '--context', dest='context', default='', help='Pass your commit context directly') - parser.add_argument('-ca', '--co-author', - help='Make your friend an co-author to the commit', + help='Make your friend a co-author for the commit', dest='co_author', default='') - parser.add_argument('-nf', '--no-file', dest='no_file', help='Disables the creation of a commiter.yml file', action='store_true') - parser.add_argument('-c', '--convention', choices=supported_conventions, dest='convention', default='', help=help_convention) - parser.add_argument('-d', '--debug', action='store_true', dest='debug', help='Toggles debug option') - parser.add_argument('-s', '--show', dest='show_convention_tags', default='False', action='store_true', help='Shows the rules of a given convention') - return parser def dump_convention(config_file): + """ + Gets the convention's name from file. + """ if config_file['convention'] is None: return 'none' return str(config_file['convention']).lower() @@ -84,12 +89,20 @@ def dump_convention(config_file): # this function forces the program to quit if commiter file is invalid def validate_commiter_file(stream_file): # pragma: no cover + """ + Checks if commit-helper file with custom convention has the required fields. + """ if stream_file['commit_pattern'] is None or stream_file['context'] is None: - print("Error: Your commiter file lacks a commit_pattern or context!") + print( + "Error: Your commit-helper file lacks a commit_pattern or context!") sys.exit(0) +# REFACT: use function dict to keep code clean def handle_conventioned_commit(convention, args): + """ + Handler for conventioned commits. + """ tag, message = handle_tag_message_args(args.tag, args.message) commit_message = '' From a56592caf22c45dbcc3c9ded6ce3fe5949af6754 Mon Sep 17 00:00:00 2001 From: Andre Filho Date: Mon, 12 Aug 2019 09:09:52 -0300 Subject: [PATCH 02/25] fix(codestyle): pycodestyle --- commit_helper/utils/file_handler.py | 4 +-- commit_helper/utils/utils.py | 38 ++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/commit_helper/utils/file_handler.py b/commit_helper/utils/file_handler.py index b7c1d57..519715e 100644 --- a/commit_helper/utils/file_handler.py +++ b/commit_helper/utils/file_handler.py @@ -53,8 +53,8 @@ def handle_file_based_commit(file_path, debug_mode, args): def get_file_path(): # pragma: no cover """ - Searchs on the folder the program was called if there is a commiter.yml or a - commit-helper.yml file and returns it's path if exists. + Searchs on the folder the program was called if there is a commiter.yml + or a commit-helper.yml file and returns it's path if exists. """ commiter = Path('commiter.yml') commit_h = Path('commit-helper.yml') diff --git a/commit_helper/utils/utils.py b/commit_helper/utils/utils.py index 51f5d40..acad045 100644 --- a/commit_helper/utils/utils.py +++ b/commit_helper/utils/utils.py @@ -22,8 +22,8 @@ def gen_co_author(co_author): """ - Formats the co-author for putting into the commit body if it is not an empty - string. + Formats the co-author for putting into the commit body if it is not an + empty string. """ if co_author is '': return '' @@ -90,15 +90,18 @@ def dump_convention(config_file): # this function forces the program to quit if commiter file is invalid def validate_commiter_file(stream_file): # pragma: no cover """ - Checks if commit-helper file with custom convention has the required fields. + Checks if commit-helper file with custom convention has the + required fields. """ if stream_file['commit_pattern'] is None or stream_file['context'] is None: print( - "Error: Your commit-helper file lacks a commit_pattern or context!") + "Error: Your commit-helper file lacks a commit_pattern or context!" + ) sys.exit(0) - # REFACT: use function dict to keep code clean + + def handle_conventioned_commit(convention, args): """ Handler for conventioned commits. @@ -106,17 +109,28 @@ def handle_conventioned_commit(convention, args): tag, message = handle_tag_message_args(args.tag, args.message) commit_message = '' + create_commit = dict( + { + # 'angular': handle_karma_angular, + # 'karma': handle_karma_angular, + 'tagged': tagged_convention, + 'symphony': symphony_convention, + 'atom': atom_convention + }) + if convention == 'angular' or convention == 'karma': context = handle_context_arg(args.context) - commit_message = karma_angular_convention(tag, message, context) + return karma_angular_convention(tag, message, context) + + commit_message = create_commit[convention](tag, message) - elif convention == 'tagged': - commit_message = tagged_convention(tag, message) + # elif convention == 'tagged': + # commit_message = tagged_convention(tag, message) - elif convention == 'symphony': - commit_message = symphony_convention(tag, message) + # elif convention == 'symphony': + # commit_message = symphony_convention(tag, message) - elif convention == 'atom': - commit_message = atom_convention(tag, message) + # elif convention == 'atom': + # commit_message = atom_convention(tag, message) return commit_message From 10f810daca8db5d0e3ae7e8cd1d472b1c5858dfb Mon Sep 17 00:00:00 2001 From: Andre Filho Date: Fri, 4 Oct 2019 08:19:27 -0300 Subject: [PATCH 03/25] ci(codeclimate): fixes the coverage reporter version --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index e7e1fc0..3329698 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -7,7 +7,7 @@ codacy-coverage~=1.3.11 codeclimate-test-reporter~=0.2.3 colorama~=0.4.1 colored~=1.3.93 -coverage~=4.5.3 +coverage~=4.0 docopt~=0.6.2 idna~=2.8 more-itertools~=7.0.0 From 2fdb6793895387d1f06944311b320bfb3cb51371 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:04 -0300 Subject: [PATCH 04/25] Pin argh to latest version 0.31.3 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index e7e1fc0..082bf25 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -argh~=0.26.2 +argh==0.31.3 atomicwrites~=1.3.0 attrs~=19.1.0 certifi~=2019.3.9 From 6c550e3b5743caa7f42b1037d29d823620f83edd Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:05 -0300 Subject: [PATCH 05/25] Pin atomicwrites to latest version 1.4.1 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 082bf25..6c345fd 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ argh==0.31.3 -atomicwrites~=1.3.0 +atomicwrites==1.4.1 attrs~=19.1.0 certifi~=2019.3.9 chardet~=3.0.4 From d13b5ae2f9aa37cfea240a12673049ff1b9e40cf Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:06 -0300 Subject: [PATCH 06/25] Pin attrs to latest version 24.2.0 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 6c345fd..d8749c3 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,6 +1,6 @@ argh==0.31.3 atomicwrites==1.4.1 -attrs~=19.1.0 +attrs==24.2.0 certifi~=2019.3.9 chardet~=3.0.4 codacy-coverage~=1.3.11 From 9c45d3090c1e2dc6c061e64201a4475c54ef9121 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:07 -0300 Subject: [PATCH 07/25] Pin certifi to latest version 2024.8.30 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index d8749c3..24d55f9 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ argh==0.31.3 atomicwrites==1.4.1 attrs==24.2.0 -certifi~=2019.3.9 +certifi==2024.8.30 chardet~=3.0.4 codacy-coverage~=1.3.11 codeclimate-test-reporter~=0.2.3 From 419c1f2f10e0c6285286ab5c68a92125b8f16f5e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:07 -0300 Subject: [PATCH 08/25] Pin chardet to latest version 5.2.0 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 24d55f9..83558f0 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,7 +2,7 @@ argh==0.31.3 atomicwrites==1.4.1 attrs==24.2.0 certifi==2024.8.30 -chardet~=3.0.4 +chardet==5.2.0 codacy-coverage~=1.3.11 codeclimate-test-reporter~=0.2.3 colorama~=0.4.1 From 50c897d3022f52afb00b66aaa1bf6e278af942d1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:08 -0300 Subject: [PATCH 09/25] Pin colored to latest version 2.2.4 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 83558f0..52dda7d 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -6,7 +6,7 @@ chardet==5.2.0 codacy-coverage~=1.3.11 codeclimate-test-reporter~=0.2.3 colorama~=0.4.1 -colored~=1.3.93 +colored==2.2.4 coverage~=4.5.3 docopt~=0.6.2 idna~=2.8 From 487cccdf74aed42ce08a6d40269e24968fd3464b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:08 -0300 Subject: [PATCH 10/25] Pin coverage to latest version 7.6.8 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 52dda7d..8fa4752 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -7,7 +7,7 @@ codacy-coverage~=1.3.11 codeclimate-test-reporter~=0.2.3 colorama~=0.4.1 colored==2.2.4 -coverage~=4.5.3 +coverage==7.6.8 docopt~=0.6.2 idna~=2.8 more-itertools~=7.0.0 From 429bc7c1647d4ca31052a11f94636373f2d3c0a4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:09 -0300 Subject: [PATCH 11/25] Pin idna to latest version 3.10 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 8fa4752..08c61e4 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -9,7 +9,7 @@ colorama~=0.4.1 colored==2.2.4 coverage==7.6.8 docopt~=0.6.2 -idna~=2.8 +idna==3.10 more-itertools~=7.0.0 pathlib~=1.0.1 pathtools~=0.1.2 From adb6d3d0f5a270ba72f304f7171fd22dee85d3df Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:09 -0300 Subject: [PATCH 12/25] Pin more-itertools to latest version 10.5.0 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 08c61e4..b6235ed 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -10,7 +10,7 @@ colored==2.2.4 coverage==7.6.8 docopt~=0.6.2 idna==3.10 -more-itertools~=7.0.0 +more-itertools==10.5.0 pathlib~=1.0.1 pathtools~=0.1.2 pip~=19.0.3 From 4470e8b73762ecb4b757765d87d811db3d12834c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:10 -0300 Subject: [PATCH 13/25] Pin pip to latest version 24.3.1 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index b6235ed..7a7567e 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -13,7 +13,7 @@ idna==3.10 more-itertools==10.5.0 pathlib~=1.0.1 pathtools~=0.1.2 -pip~=19.0.3 +pip==24.3.1 pluggy>=0.9.0 py~=1.8.0 pycodestyle~=2.5.0 From b6e8421eb573ec11b5fd9b404a1a96027cd0ac1e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:11 -0300 Subject: [PATCH 14/25] Pin py to latest version 1.11.0 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 7a7567e..5716020 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -15,7 +15,7 @@ pathlib~=1.0.1 pathtools~=0.1.2 pip==24.3.1 pluggy>=0.9.0 -py~=1.8.0 +py==1.11.0 pycodestyle~=2.5.0 pytest~=4.4.0 pytest-cov~=2.6.1 From f87032bee85fdc0a6ca55464a96de1660237c320 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:11 -0300 Subject: [PATCH 15/25] Pin pycodestyle to latest version 2.12.1 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 5716020..232fe76 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -16,7 +16,7 @@ pathtools~=0.1.2 pip==24.3.1 pluggy>=0.9.0 py==1.11.0 -pycodestyle~=2.5.0 +pycodestyle==2.12.1 pytest~=4.4.0 pytest-cov~=2.6.1 pytest-watch~=4.2.0 From 76a0e3c0f31d9f005a170f39b51094b7726eb5ff Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:12 -0300 Subject: [PATCH 16/25] Pin pytest to latest version 8.3.4 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 232fe76..e42593f 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -17,7 +17,7 @@ pip==24.3.1 pluggy>=0.9.0 py==1.11.0 pycodestyle==2.12.1 -pytest~=4.4.0 +pytest==8.3.4 pytest-cov~=2.6.1 pytest-watch~=4.2.0 pyyaml>=4.2b1 From 56554ea71cd2f812f0dc76d4f5e85177744a358b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:13 -0300 Subject: [PATCH 17/25] Pin pytest-cov to latest version 6.0.0 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index e42593f..8cf151d 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -18,7 +18,7 @@ pluggy>=0.9.0 py==1.11.0 pycodestyle==2.12.1 pytest==8.3.4 -pytest-cov~=2.6.1 +pytest-cov==6.0.0 pytest-watch~=4.2.0 pyyaml>=4.2b1 requests~=2.21.0 From 2455450732f368a184a5228f8c24533c7ed21efb Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:13 -0300 Subject: [PATCH 18/25] Pin requests to latest version 2.32.3 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 8cf151d..cd248e5 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -21,7 +21,7 @@ pytest==8.3.4 pytest-cov==6.0.0 pytest-watch~=4.2.0 pyyaml>=4.2b1 -requests~=2.21.0 +requests==2.32.3 setuptools~=40.8.0 six~=1.12.0 urllib3~=1.24.1 From 749bea58430ad2bd00d14dfade960c5fe77e0436 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:14 -0300 Subject: [PATCH 19/25] Pin setuptools to latest version 75.6.0 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index cd248e5..f776017 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -22,7 +22,7 @@ pytest-cov==6.0.0 pytest-watch~=4.2.0 pyyaml>=4.2b1 requests==2.32.3 -setuptools~=40.8.0 +setuptools==75.6.0 six~=1.12.0 urllib3~=1.24.1 watchdog~=0.9.0 From 48180593851a8bf63366a997bdfce5adedb2eb01 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:14 -0300 Subject: [PATCH 20/25] Pin six to latest version 1.16.0 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index f776017..4c841c7 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -23,7 +23,7 @@ pytest-watch~=4.2.0 pyyaml>=4.2b1 requests==2.32.3 setuptools==75.6.0 -six~=1.12.0 +six==1.16.0 urllib3~=1.24.1 watchdog~=0.9.0 wheel~=0.33.1 From 0da5fb99ec5af5354b468b65baa5121aea4069d7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:15 -0300 Subject: [PATCH 21/25] Pin urllib3 to latest version 2.2.3 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 4c841c7..61da9d0 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -24,7 +24,7 @@ pyyaml>=4.2b1 requests==2.32.3 setuptools==75.6.0 six==1.16.0 -urllib3~=1.24.1 +urllib3==2.2.3 watchdog~=0.9.0 wheel~=0.33.1 From 291c058ae5a49cf615a7f2a815513c48b69ba489 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:16 -0300 Subject: [PATCH 22/25] Pin watchdog to latest version 6.0.0 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 61da9d0..09aa1c1 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -25,7 +25,7 @@ requests==2.32.3 setuptools==75.6.0 six==1.16.0 urllib3==2.2.3 -watchdog~=0.9.0 +watchdog==6.0.0 wheel~=0.33.1 twine~=1.13.0 From 5d37494e8f6900a62409d17966eb0d2253e46267 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:16 -0300 Subject: [PATCH 23/25] Pin wheel to latest version 0.45.1 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 09aa1c1..b7c2466 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -26,6 +26,6 @@ setuptools==75.6.0 six==1.16.0 urllib3==2.2.3 watchdog==6.0.0 -wheel~=0.33.1 +wheel==0.45.1 twine~=1.13.0 From 99fd5b13130c9ba23da6c1c93c3389bb1f3a66d5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 1 Dec 2024 12:16:17 -0300 Subject: [PATCH 24/25] Pin twine to latest version 6.0.1 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index b7c2466..573fe66 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -28,4 +28,4 @@ urllib3==2.2.3 watchdog==6.0.0 wheel==0.45.1 -twine~=1.13.0 +twine==6.0.1 From a37a25ce2048a43a592f2d058d0f67c73d4df926 Mon Sep 17 00:00:00 2001 From: Andre S C Filho Date: Thu, 17 Jul 2025 10:02:00 -0300 Subject: [PATCH 25/25] deps: updates dependencies to resume dev --- commit_helper/__main__.py | 4 +-- dev-requirements.txt | 56 ++++++++++++++++++++++++++++----------- setup.py | 22 +++++++-------- 3 files changed, 53 insertions(+), 29 deletions(-) diff --git a/commit_helper/__main__.py b/commit_helper/__main__.py index 3246115..8ec8497 100755 --- a/commit_helper/__main__.py +++ b/commit_helper/__main__.py @@ -21,11 +21,11 @@ def main(): debug('file_path', file_path, debug_mode) - if args.show_convention_tags is True: + if args.show_convention_tags == True: convention_help_handler(file_path, args, debug_mode) return - elif args.convention is not '': + elif args.convention != '': convention_flag_handler(args, debug_mode) return diff --git a/dev-requirements.txt b/dev-requirements.txt index 573fe66..40b7eba 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,31 +1,55 @@ argh==0.31.3 atomicwrites==1.4.1 attrs==24.2.0 +backports.tarfile==1.2.0 certifi==2024.8.30 +cffi==1.17.1 chardet==5.2.0 -codacy-coverage~=1.3.11 -codeclimate-test-reporter~=0.2.3 -colorama~=0.4.1 +charset-normalizer==3.4.2 +codacy-coverage==1.3.11 +codeclimate-test-reporter==0.2.3 +colorama==0.4.6 colored==2.2.4 coverage==7.6.8 -docopt~=0.6.2 +cryptography==45.0.5 +docopt==0.6.2 +docutils==0.21.2 +exceptiongroup==1.3.0 idna==3.10 +importlib_metadata==8.7.0 +iniconfig==2.1.0 +jaraco.classes==3.4.0 +jaraco.context==6.0.1 +jaraco.functools==4.2.1 +jeepney==0.9.0 +keyring==25.6.0 +markdown-it-py==3.0.0 +mdurl==0.1.2 more-itertools==10.5.0 -pathlib~=1.0.1 -pathtools~=0.1.2 -pip==24.3.1 -pluggy>=0.9.0 +nh3==0.2.22 +packaging==25.0 +pathlib==1.0.1 +pathtools==0.1.2 +pkginfo==1.12.1.2 +pluggy==1.6.0 py==1.11.0 pycodestyle==2.12.1 -pytest==8.3.4 -pytest-cov==6.0.0 -pytest-watch~=4.2.0 -pyyaml>=4.2b1 +pycparser==2.22 +Pygments==2.19.2 +pytest==8.4.1 +pytest-cov==6.2.1 +pytest-watch==4.2.0 +PyYAML==6.0.2 +readme_renderer==44.0 requests==2.32.3 -setuptools==75.6.0 +requests-toolbelt==1.0.0 +rfc3986==2.0.0 +rich==14.0.0 +SecretStorage==3.3.3 six==1.16.0 +tomli==2.2.1 +twine==6.0.1 +typing_extensions==4.14.1 urllib3==2.2.3 watchdog==6.0.0 -wheel==0.45.1 - -twine==6.0.1 +zipp==3.23.0 diff --git a/setup.py b/setup.py index 56e46da..f8bc28e 100644 --- a/setup.py +++ b/setup.py @@ -1,23 +1,23 @@ import os import codecs from os import path -from setuptools import setup -from setuptools import find_packages -from pip._internal.req import parse_requirements +from setuptools import setup, find_packages here = path.abspath(path.dirname(__file__)) -with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: - README = readme.read() +with open('README.md', encoding='utf-8') as f: + long_description = f.read() + +with open('VERSION.txt', encoding='utf-8') as f: + version = f.read().strip() # allowes setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) -# parse_requirements() returns generator of pip.req.InstallRequirement objects -INSTALL_REQS = parse_requirements('requirements.txt', session='hack') +# load requirements +with open('requirements.txt') as f: + REQUIREMENTS = [line.strip() for line in f if line.strip() and not line.startswith('#')] -# reqs is a list of requirements -REQUIREMENTS = [str(ir.req) for ir in INSTALL_REQS] CLASSIFIERS = [ "Development Status :: 5 - Production/Stable", @@ -36,11 +36,11 @@ name='commit-helper', description="A python program that helps you write commits following commit conventions", # nopep8 url='https://github.com/andre-filho/commit-helper', - long_description=codecs.open('README.md', 'rb', 'utf8').read(), + long_description=long_description, long_description_content_type='text/markdown', author='Andre de Sousa Costa Filho', author_email='andre.filho001@outlook.com', - version=codecs.open('VERSION.txt', 'rb', 'utf8').read(), + version=version, packages=find_packages(), keywords=['commit', 'helper', 'git', 'version', 'versioning'], entry_points={