diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 479df6ab..0f707246 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,21 +37,21 @@ repos: - "--py310-plus" - repo: https://github.com/psf/black-pre-commit-mirror - rev: 26.5.1 + rev: 26.10.0 hooks: - id: black args: - --target-version=py310 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.16.10 hooks: - id: ruff-check args: - --fix-only - repo: https://github.com/pycqa/isort - rev: 9.0.0a3 + rev: 9.0.2 hooks: - id: isort args: @@ -60,7 +60,7 @@ repos: - --filter-files - repo: https://github.com/pycqa/flake8 - rev: 7.3.0 + rev: 7.4.1 hooks: - id: flake8 language: python diff --git a/builder/pyinstaller_build_macos.py b/builder/pyinstaller_build_macos.py index d3af1361..49acbfac 100644 --- a/builder/pyinstaller_build_macos.py +++ b/builder/pyinstaller_build_macos.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Launch PyInstaller using a Python script. @@ -19,7 +19,7 @@ # package sys.path.insert(0, str(Path(".").resolve())) -from geotribu_cli import __about__ # noqa: E402 +from geotribu_cli import __about__ # ############################################################################# # ########### MAIN ################# diff --git a/builder/pyinstaller_build_ubuntu.py b/builder/pyinstaller_build_ubuntu.py index 1f7708bb..cb1c6e72 100644 --- a/builder/pyinstaller_build_ubuntu.py +++ b/builder/pyinstaller_build_ubuntu.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Launch PyInstaller using a Python script. @@ -19,7 +19,7 @@ # package sys.path.insert(0, str(Path(".").resolve())) -from geotribu_cli import __about__ # noqa: E402 +from geotribu_cli import __about__ # ############################################################################# # ########### MAIN ################# diff --git a/builder/pyinstaller_build_windows.py b/builder/pyinstaller_build_windows.py index c445a583..f0d355c9 100644 --- a/builder/pyinstaller_build_windows.py +++ b/builder/pyinstaller_build_windows.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Launch PyInstaller using a Python script. @@ -19,7 +19,7 @@ # package sys.path.insert(0, str(Path(".").resolve())) -from geotribu_cli import __about__ # noqa: E402 +from geotribu_cli import __about__ # ############################################################################# # ########### MAIN ################# diff --git a/builder/version_info_templater.py b/builder/version_info_templater.py index b52e5edc..e2efb702 100644 --- a/builder/version_info_templater.py +++ b/builder/version_info_templater.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Microsoft Version Info templater. diff --git a/geotribu_cli/__about__.py b/geotribu_cli/__about__.py index eb9619cd..d2a57b7c 100644 --- a/geotribu_cli/__about__.py +++ b/geotribu_cli/__about__.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Abstraction on the package metadata to easily retrieve them.""" diff --git a/geotribu_cli/__init__.py b/geotribu_cli/__init__.py index 8c446aca..0d7d3d1a 100644 --- a/geotribu_cli/__init__.py +++ b/geotribu_cli/__init__.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # submodules from .__about__ import __version__ # noqa: F401 diff --git a/geotribu_cli/cli.py b/geotribu_cli/cli.py index af67a204..89bcdf1d 100644 --- a/geotribu_cli/cli.py +++ b/geotribu_cli/cli.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # PYTHON_ARGCOMPLETE_OK """Main CLI entrypoint.""" diff --git a/geotribu_cli/cli_results_rich_formatters.py b/geotribu_cli/cli_results_rich_formatters.py index d6529f9d..03601ef4 100644 --- a/geotribu_cli/cli_results_rich_formatters.py +++ b/geotribu_cli/cli_results_rich_formatters.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/comments/__init__.py b/geotribu_cli/comments/__init__.py index 905f0910..752792c3 100644 --- a/geotribu_cli/comments/__init__.py +++ b/geotribu_cli/comments/__init__.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # submodules from .comments_broadcast import parser_comments_broadcast # noqa: F401 diff --git a/geotribu_cli/comments/comments_broadcast.py b/geotribu_cli/comments/comments_broadcast.py index 97d52620..08674b44 100644 --- a/geotribu_cli/comments/comments_broadcast.py +++ b/geotribu_cli/comments/comments_broadcast.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/comments/comments_latest.py b/geotribu_cli/comments/comments_latest.py index c0c7fc6e..7be7a16c 100644 --- a/geotribu_cli/comments/comments_latest.py +++ b/geotribu_cli/comments/comments_latest.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/comments/comments_open.py b/geotribu_cli/comments/comments_open.py index ea42561c..dce565e2 100644 --- a/geotribu_cli/comments/comments_open.py +++ b/geotribu_cli/comments/comments_open.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/comments/comments_toolbelt.py b/geotribu_cli/comments/comments_toolbelt.py index ce958ce5..9f11e182 100644 --- a/geotribu_cli/comments/comments_toolbelt.py +++ b/geotribu_cli/comments/comments_toolbelt.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# @@ -183,8 +183,7 @@ def get_latest_comments( list of comments objects """ # check if count is acceptable - if number < 1: - number = 1 + number = max(number, 1) # download remote latest comments comments_file = download_remote_file_to_local( diff --git a/geotribu_cli/comments/mdl_comment.py b/geotribu_cli/comments/mdl_comment.py index b2eba4b2..95bef5c5 100644 --- a/geotribu_cli/comments/mdl_comment.py +++ b/geotribu_cli/comments/mdl_comment.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Package constants.""" diff --git a/geotribu_cli/console.py b/geotribu_cli/console.py index 38559500..6a9b35a0 100644 --- a/geotribu_cli/console.py +++ b/geotribu_cli/console.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Shared console instance. diff --git a/geotribu_cli/constants.py b/geotribu_cli/constants.py index 995abf52..8eed4951 100644 --- a/geotribu_cli/constants.py +++ b/geotribu_cli/constants.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Package constants.""" diff --git a/geotribu_cli/content/new_article.py b/geotribu_cli/content/new_article.py index 448c9427..10486908 100644 --- a/geotribu_cli/content/new_article.py +++ b/geotribu_cli/content/new_article.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/content/yaml_handler.py b/geotribu_cli/content/yaml_handler.py index 776050c0..68679d96 100644 --- a/geotribu_cli/content/yaml_handler.py +++ b/geotribu_cli/content/yaml_handler.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # 3rd party from frontmatter import YAMLHandler diff --git a/geotribu_cli/history.py b/geotribu_cli/history.py index 2c173843..2d8c56f5 100644 --- a/geotribu_cli/history.py +++ b/geotribu_cli/history.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Store and load CLI history.""" @@ -61,8 +61,7 @@ def dump( out_history.write(f"{request_performed}\n") # results - for i in results_to_dump: - out_history.write(f"{i.get(key_field)}\n") + out_history.writelines(f"{i.get(key_field)}\n" for i in results_to_dump) logger.debug(f"History saved for {cmd_name}") diff --git a/geotribu_cli/images/images_optimizer.py b/geotribu_cli/images/images_optimizer.py index 20cc34b0..4a00c12d 100644 --- a/geotribu_cli/images/images_optimizer.py +++ b/geotribu_cli/images/images_optimizer.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/images/optim_pillow.py b/geotribu_cli/images/optim_pillow.py index ecceead8..ee630713 100644 --- a/geotribu_cli/images/optim_pillow.py +++ b/geotribu_cli/images/optim_pillow.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/images/optim_tinify.py b/geotribu_cli/images/optim_tinify.py index c0331a2c..f8a55565 100644 --- a/geotribu_cli/images/optim_tinify.py +++ b/geotribu_cli/images/optim_tinify.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/json/json_client.py b/geotribu_cli/json/json_client.py index 7cf341b6..458fab28 100644 --- a/geotribu_cli/json/json_client.py +++ b/geotribu_cli/json/json_client.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """JSON Feed client.""" diff --git a/geotribu_cli/rss/mdl_rss.py b/geotribu_cli/rss/mdl_rss.py index f1d7224b..46ed4256 100644 --- a/geotribu_cli/rss/mdl_rss.py +++ b/geotribu_cli/rss/mdl_rss.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Package constants.""" diff --git a/geotribu_cli/rss/rss_reader.py b/geotribu_cli/rss/rss_reader.py index a354712e..3da72671 100644 --- a/geotribu_cli/rss/rss_reader.py +++ b/geotribu_cli/rss/rss_reader.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# @@ -220,12 +220,7 @@ def run(args: argparse.Namespace): # filter on content type if args.filter_type == "article" and not item.find( "link" - ).text.startswith(f"{defaults_settings.site_base_url}articles/"): - logger.debug( - f"Résultat ignoré par le filtre {args.filter_type}: {item.find('link').text}" - ) - continue - elif args.filter_type == "rdp" and not item.find( + ).text.startswith(f"{defaults_settings.site_base_url}articles/") or args.filter_type == "rdp" and not item.find( "link" ).text.startswith(f"{defaults_settings.site_base_url}rdp/"): logger.debug( @@ -251,9 +246,7 @@ def run(args: argparse.Namespace): ) ) except Exception as err: - err_msg = "Feed item (index = {}) triggers an error. Trace: {}".format( - feed_items.index(item), err - ) + err_msg = f"Feed item (index = {feed_items.index(item)}) triggers an error. Trace: {err}" logger.error(err_msg) sys.exit(err_msg) @@ -276,7 +269,7 @@ def run(args: argparse.Namespace): prompt="Afficher le résultat n° (q pour quitter)", console=console, choices=["q"] - + [str(i) for i in range(0, min([len(feed_items), args.results_number]))], + + [str(i) for i in range(min([len(feed_items), args.results_number]))], default="q", ) diff --git a/geotribu_cli/search/mdl_search.py b/geotribu_cli/search/mdl_search.py index 056fc034..c2afa323 100644 --- a/geotribu_cli/search/mdl_search.py +++ b/geotribu_cli/search/mdl_search.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Search related models.""" diff --git a/geotribu_cli/search/search_content.py b/geotribu_cli/search/search_content.py index 915fa088..53ab902c 100644 --- a/geotribu_cli/search/search_content.py +++ b/geotribu_cli/search/search_content.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# @@ -389,13 +389,7 @@ def run(args: argparse.Namespace): # filter on content type if args.filter_type == "article" and not result.get("ref").startswith( "articles/" - ): - logger.debug( - f"Résultat ignoré par le filtre {args.filter_type}: {result.get('ref')}" - ) - count_ignored_results += 1 - continue - elif args.filter_type == "rdp" and not result.get("ref").startswith("rdp/"): + ) or args.filter_type == "rdp" and not result.get("ref").startswith("rdp/"): logger.debug( f"Résultat ignoré par le filtre {args.filter_type}: {result.get('ref')}" ) @@ -500,7 +494,7 @@ def run(args: argparse.Namespace): console=console, choices=["q"] + [ - str(i) for i in range(0, min([len(final_results), args.results_number])) + str(i) for i in range(min([len(final_results), args.results_number])) ], default="q", ) diff --git a/geotribu_cli/search/search_image.py b/geotribu_cli/search/search_image.py index f2f7a7ad..08d9f8fa 100644 --- a/geotribu_cli/search/search_image.py +++ b/geotribu_cli/search/search_image.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# @@ -198,12 +198,7 @@ def run(args: argparse.Namespace): # filter on image type if args.filter_type == "logo" and not result.get("ref").startswith( "logos-icones/" - ): - logger.debug( - f"Résultat ignoré par le filtre {args.filter_type}: {result.get('ref')}" - ) - continue - elif args.filter_type == "geoicone" and not result.get("ref").startswith( + ) or args.filter_type == "geoicone" and not result.get("ref").startswith( "internal/icons-rdp-news/" ): logger.debug( @@ -259,7 +254,7 @@ def run(args: argparse.Namespace): console=console, choices=["q"] + [ - str(i) for i in range(0, min([len(final_results), args.results_number])) + str(i) for i in range(min([len(final_results), args.results_number])) ], default="q", ) diff --git a/geotribu_cli/social/cmd_mastodon_export.py b/geotribu_cli/social/cmd_mastodon_export.py index b9378540..f3db8408 100644 --- a/geotribu_cli/social/cmd_mastodon_export.py +++ b/geotribu_cli/social/cmd_mastodon_export.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/social/mastodon_client.py b/geotribu_cli/social/mastodon_client.py index d443826f..f6e29f6e 100644 --- a/geotribu_cli/social/mastodon_client.py +++ b/geotribu_cli/social/mastodon_client.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/subcommands/__init__.py b/geotribu_cli/subcommands/__init__.py index c38d43dd..270b36fc 100644 --- a/geotribu_cli/subcommands/__init__.py +++ b/geotribu_cli/subcommands/__init__.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 F401 +#! python3 # submodules from geotribu_cli.comments import parser_comments_broadcast # noqa: F401 diff --git a/geotribu_cli/subcommands/open_result.py b/geotribu_cli/subcommands/open_result.py index 558aa10c..b9c91fab 100644 --- a/geotribu_cli/subcommands/open_result.py +++ b/geotribu_cli/subcommands/open_result.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/subcommands/upgrade.py b/geotribu_cli/subcommands/upgrade.py index b046eae9..ec6946a0 100644 --- a/geotribu_cli/subcommands/upgrade.py +++ b/geotribu_cli/subcommands/upgrade.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Sub-command in charge of checking if new versions are available. @@ -70,11 +70,7 @@ def get_download_url_for_os( opersys_code = override_opersys for asset in release_assets: - if opersys_code == "win32" and "Windows" in asset.get("name"): - return asset.get("browser_download_url"), asset.get("content-type") - elif opersys_code == "linux" and "Ubuntu" in asset.get("name"): - return asset.get("browser_download_url"), asset.get("content-type") - elif opersys_code == "darwin" and "MacOS" in asset.get("name"): + if opersys_code == "win32" and "Windows" in asset.get("name") or opersys_code == "linux" and "Ubuntu" in asset.get("name") or opersys_code == "darwin" and "MacOS" in asset.get("name"): return asset.get("browser_download_url"), asset.get("content-type") else: continue @@ -281,4 +277,3 @@ def run(args: argparse.Namespace): # ################################## if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/geotribu_cli/utils/args_types.py b/geotribu_cli/utils/args_types.py index 2e38951b..83e1f518 100644 --- a/geotribu_cli/utils/args_types.py +++ b/geotribu_cli/utils/args_types.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Static objects and variables.""" diff --git a/geotribu_cli/utils/check_image_size.py b/geotribu_cli/utils/check_image_size.py index 2fcfffa9..d2510b23 100644 --- a/geotribu_cli/utils/check_image_size.py +++ b/geotribu_cli/utils/check_image_size.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Check image size using pure Python . diff --git a/geotribu_cli/utils/check_path.py b/geotribu_cli/utils/check_path.py index bf6ccbf9..dd4f2184 100755 --- a/geotribu_cli/utils/check_path.py +++ b/geotribu_cli/utils/check_path.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Helpers to check file: readable, exists, etc.. @@ -241,4 +241,3 @@ def check_path( if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/geotribu_cli/utils/dates_manipulation.py b/geotribu_cli/utils/dates_manipulation.py index 8131a370..d8bbb92c 100644 --- a/geotribu_cli/utils/dates_manipulation.py +++ b/geotribu_cli/utils/dates_manipulation.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Extract date from content path, location or name. @@ -86,8 +86,7 @@ def get_date_from_content_location(input_content_location: str) -> date: next_part = parts[parts.index(year) + 1] # clean next part for rdp - if next_part.startswith("rdp_"): - next_part = next_part[4:] + next_part = next_part.removeprefix("rdp_") # now, the next part should contain the date within the first 10 chars date_str = next_part[:10] @@ -127,4 +126,3 @@ def get_days_until_next_month(from_date: date = None) -> int: if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/geotribu_cli/utils/file_downloader.py b/geotribu_cli/utils/file_downloader.py index 98b1ea62..27ee7b98 100644 --- a/geotribu_cli/utils/file_downloader.py +++ b/geotribu_cli/utils/file_downloader.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ diff --git a/geotribu_cli/utils/file_stats.py b/geotribu_cli/utils/file_stats.py index 874a9a7c..2f8fa26f 100644 --- a/geotribu_cli/utils/file_stats.py +++ b/geotribu_cli/utils/file_stats.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Check file statistcs.""" diff --git a/geotribu_cli/utils/formatters.py b/geotribu_cli/utils/formatters.py index 0dc87dd8..15dc044c 100644 --- a/geotribu_cli/utils/formatters.py +++ b/geotribu_cli/utils/formatters.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Helpers to format text and variables.""" diff --git a/geotribu_cli/utils/journalizer.py b/geotribu_cli/utils/journalizer.py index 84d51dba..92f170b2 100644 --- a/geotribu_cli/utils/journalizer.py +++ b/geotribu_cli/utils/journalizer.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Helper to configure logging depending on CLI options.""" diff --git a/geotribu_cli/utils/proxies.py b/geotribu_cli/utils/proxies.py index 0a180be6..86a49b1a 100644 --- a/geotribu_cli/utils/proxies.py +++ b/geotribu_cli/utils/proxies.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Small module to get network proxies configuration. @@ -98,4 +98,3 @@ def get_proxy_settings() -> dict: if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/geotribu_cli/utils/slugger.py b/geotribu_cli/utils/slugger.py index c18424cb..6a09957b 100644 --- a/geotribu_cli/utils/slugger.py +++ b/geotribu_cli/utils/slugger.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Minimalist slugifier. diff --git a/geotribu_cli/utils/str2bool.py b/geotribu_cli/utils/str2bool.py index d2bd9eae..a6442509 100644 --- a/geotribu_cli/utils/str2bool.py +++ b/geotribu_cli/utils/str2bool.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Basic string to bool. diff --git a/geotribu_cli/utils/url_helpers.py b/geotribu_cli/utils/url_helpers.py index 7789b776..824503f4 100644 --- a/geotribu_cli/utils/url_helpers.py +++ b/geotribu_cli/utils/url_helpers.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Helpers to check file: readable, exists, etc.. @@ -83,4 +83,3 @@ def check_str_is_url( if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/tests/test_about.py b/tests/test_about.py index 20855fb1..4dae6a28 100644 --- a/tests/test_about.py +++ b/tests/test_about.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_cli.py b/tests/test_cli.py index 29facb6f..6a9d68c2 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_constants.py b/tests/test_constants.py index 092f2e25..054ba891 100644 --- a/tests/test_constants.py +++ b/tests/test_constants.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_args_types.py b/tests/test_utils_args_types.py index 52eac411..15054374 100644 --- a/tests/test_utils_args_types.py +++ b/tests/test_utils_args_types.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_check_path.py b/tests/test_utils_check_path.py index 0bf7fb8d..c6df744a 100644 --- a/tests/test_utils_check_path.py +++ b/tests/test_utils_check_path.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_date_helpers.py b/tests/test_utils_date_helpers.py index 46aec011..2311e3f8 100644 --- a/tests/test_utils_date_helpers.py +++ b/tests/test_utils_date_helpers.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_file_stats.py b/tests/test_utils_file_stats.py index 65ce7e04..a9169d52 100644 --- a/tests/test_utils_file_stats.py +++ b/tests/test_utils_file_stats.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_formatters.py b/tests/test_utils_formatters.py index 4d3a6996..46bc7bc9 100644 --- a/tests/test_utils_formatters.py +++ b/tests/test_utils_formatters.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_images_size.py b/tests/test_utils_images_size.py index 8bc6c40f..ec88d5c1 100644 --- a/tests/test_utils_images_size.py +++ b/tests/test_utils_images_size.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_proxies.py b/tests/test_utils_proxies.py index 42657ce5..1a9cc2e8 100644 --- a/tests/test_utils_proxies.py +++ b/tests/test_utils_proxies.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_slugifier.py b/tests/test_utils_slugifier.py index 76ea1832..8bd4840d 100644 --- a/tests/test_utils_slugifier.py +++ b/tests/test_utils_slugifier.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_str2bool.py b/tests/test_utils_str2bool.py index 9f60fab3..d138613e 100644 --- a/tests/test_utils_str2bool.py +++ b/tests/test_utils_str2bool.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: @@ -34,8 +34,8 @@ def test_str2bool(self): # KO with self.assertRaises(TypeError): - str2bool(input_var=int(10), raise_exc=True) - self.assertIsNone(str2bool(input_var=int(10), raise_exc=False)) + str2bool(input_var=10, raise_exc=True) + self.assertIsNone(str2bool(input_var=10, raise_exc=False)) with self.assertRaises(ValueError): str2bool(input_var="vrai", raise_exc=True) diff --git a/tests/test_utils_url_helpers.py b/tests/test_utils_url_helpers.py index 396dac38..44b74493 100644 --- a/tests/test_utils_url_helpers.py +++ b/tests/test_utils_url_helpers.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: