From c7033a3008b7f3703c9013e9ff5b8cab2993afc58231e7f20be4db749ec0562e Mon Sep 17 00:00:00 2001 From: Nico Krapp Date: Tue, 15 Apr 2025 07:39:15 +0000 Subject: [PATCH] - Update to 0.5.1 * Bump workflow versions * README: Remove references to Python 2 * README: Update packaging overview * fix: Correct entrypoint * pre-commit: Bump versions OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click-man?expand=0&rev=11 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + click-man-0.4.1.tar.gz | 3 ++ click_man-0.5.0.tar.gz | 3 ++ click_man-0.5.1.tar.gz | 3 ++ get-short-help.patch | 36 +++++++++++++++++++ python-click-man.changes | 75 ++++++++++++++++++++++++++++++++++++++++ python-click-man.spec | 74 +++++++++++++++++++++++++++++++++++++++ 8 files changed, 218 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 click-man-0.4.1.tar.gz create mode 100644 click_man-0.5.0.tar.gz create mode 100644 click_man-0.5.1.tar.gz create mode 100644 get-short-help.patch create mode 100644 python-click-man.changes create mode 100644 python-click-man.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/click-man-0.4.1.tar.gz b/click-man-0.4.1.tar.gz new file mode 100644 index 0000000..2a65cd0 --- /dev/null +++ b/click-man-0.4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d255c14ecee52afa915228f7dc87603ddb571c3d7d1a2eb219244e440fa88bbb +size 8390 diff --git a/click_man-0.5.0.tar.gz b/click_man-0.5.0.tar.gz new file mode 100644 index 0000000..ef073d3 --- /dev/null +++ b/click_man-0.5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c2b3016c533dd315fa45ef9ab9bfa5bfd71017ea6d5bbcd454c179aee6b2343 +size 20863 diff --git a/click_man-0.5.1.tar.gz b/click_man-0.5.1.tar.gz new file mode 100644 index 0000000..ab7c7dc --- /dev/null +++ b/click_man-0.5.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2db2163ef51a1b746d6d7781f78856430a2bcf0f10df428fe5986ecc0ef9809c +size 21345 diff --git a/get-short-help.patch b/get-short-help.patch new file mode 100644 index 0000000..0a0201c --- /dev/null +++ b/get-short-help.patch @@ -0,0 +1,36 @@ +Index: click-man-0.4.1/click_man/core.py +=================================================================== +--- click-man-0.4.1.orig/click_man/core.py ++++ click-man-0.4.1/click_man/core.py +@@ -16,6 +16,14 @@ import click + + from .man import ManPage + ++ ++def get_short_help_str(command, limit=45): ++ """ ++ Gets short help for the command or makes it by shortening the long help string. ++ """ ++ return command.short_help or command.help and click.utils.make_default_short_help(command.help, limit) or '' ++ ++ + def generate_man_page(ctx, version=None): + """ + Generate documentation for the given command. +@@ -29,14 +37,14 @@ def generate_man_page(ctx, version=None) + # Create man page with the details from the given context + man_page = ManPage(ctx.command_path) + man_page.version = version +- man_page.short_help = ctx.command.get_short_help_str() ++ man_page.short_help = get_short_help_str(ctx.command) + man_page.description = ctx.command.help + man_page.synopsis = ' '.join(ctx.command.collect_usage_pieces(ctx)) + man_page.options = [x.get_help_record(ctx) for x in ctx.command.params if isinstance(x, click.Option)] + commands = getattr(ctx.command, 'commands', None) + if commands: + man_page.commands = [ +- (k, v.get_short_help_str()) for k, v in commands.items() ++ (k, get_short_help_str(v)) for k, v in commands.items() + ] + + return str(man_page) diff --git a/python-click-man.changes b/python-click-man.changes new file mode 100644 index 0000000..eeb6047 --- /dev/null +++ b/python-click-man.changes @@ -0,0 +1,75 @@ +------------------------------------------------------------------- +Tue Apr 15 06:19:22 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 0.5.1 + * Bump workflow versions + * README: Remove references to Python 2 + * README: Update packaging overview + * fix: Correct entrypoint + * pre-commit: Bump versions + +------------------------------------------------------------------- +Mon Feb 10 16:48:55 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 0.5.0 + * Fix typo + * Explicitly require setuptools, __main__.py imports pkg_resources + * Fix typos + * Update README.md + * Fix typo + * tests: Switch to pytest + * Add GitHub Actions workflow, remove Travis + * Fix man generation for CLI with hidden options + * Move 'cli()' method to 'click_man.shell' + * Add shell unit tests + * cli: Expose knobs for date and version + * README: Remove references to distutils command + * Remove distutils command + * Remove use of pkg_resources + * Drop support for Python < 3.9 + * Add ruff configuration + * Format with ruff-format + * Add pre-commit + * Add lint CI job + * Migrate to pyproject.toml +- from version 0.4.2 + * get_short_help method only exists in Click 7. +- Add update-alternatives to Requires(post) and Requires(postun) +- Drop get-short-help.patch, merged upstream +- Limit Python files matched in %files section +- Switch package to modern Python Stack on SLE-15 + * Use Python 3.11 on SLE-15 by default + * Drop support for older Python versions +- Switch build system from setuptools to pyproject.toml + * Add python-pip and python-wheel to BuildRequires + * Replace %python_build with %pyproject_wheel + * Replace %python_install with %pyproject_install + +------------------------------------------------------------------- +Thu May 16 14:47:29 UTC 2024 - Dominique Leuenberger + +- Use %autosetup macro: allows us to eliminate usage of deprecated + %patchN syntax. + +------------------------------------------------------------------- +Tue Mar 31 12:35:39 UTC 2020 - Marketa Calabkova + +- Update to 0.4.1 + * Discover command if not in entry_points +- Reapplied patch get-short-help.patch +- No need to use upstream tarball, download PyPI tarball instead + +------------------------------------------------------------------- +Thu Dec 5 11:03:35 UTC 2019 - Tomáš Chvátal + +- Switch to github archive as the tests are not present on pypi + version + +------------------------------------------------------------------- +Mon Nov 25 20:45:00 UTC 2019 - Sean Marlow + +- Initial release. v0.3.0 +- get-short-help.patch adds get_short_help_str function and + supports older versions of python-click. get_short_help_str was + added to Click in version >= 7.0.0. +- Use pytest instead of nose for unit tests. diff --git a/python-click-man.spec b/python-click-man.spec new file mode 100644 index 0000000..4588932 --- /dev/null +++ b/python-click-man.spec @@ -0,0 +1,74 @@ +# +# spec file for package python-click-man +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-click-man +Version: 0.5.1 +Release: 0 +Summary: Automate generation of man pages for python click applications +License: MIT +URL: https://github.com/click-contrib/click-man +Source: https://files.pythonhosted.org/packages/source/c/click_man/click_man-%{version}.tar.gz +BuildRequires: %{python_module click} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module sure} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-click +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildArch: noarch +%python_subpackages + +%description +Automate generation of man pages for Python Click applications. + +%prep +%autosetup -p1 -n click_man-%{version} + +%build +export LANG=en_US.UTF-8 +%pyproject_wheel + +%install +export LANG=en_US.UTF-8 +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%python_clone -a %{buildroot}%{_bindir}/click-man + +%check +export LANG=en_US.UTF-8 +%pytest + +%post +%python_install_alternative click-man + +%postun +%python_uninstall_alternative click-man + +%files %{python_files} +%license LICENSE +%doc CHANGELOG.md README.md +%python_alternative %{_bindir}/click-man +%{python_sitelib}/click_man +%{python_sitelib}/click_man-%{version}.dist-info + +%changelog