commit de8771d808efbb22f29d428f1db058643cd2d9d77ee78aac148f714d57a02575 Author: Steve Kowalik Date: Wed Oct 29 01:10:03 2025 +0000 - Add patch support-python-314.patch: * Support Python 3.14 asyncio changes. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fire?expand=0&rev=33 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/fire-0.7.1.tar.gz b/fire-0.7.1.tar.gz new file mode 100644 index 0000000..92c5f43 --- /dev/null +++ b/fire-0.7.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b208f05c736de98fb343310d090dcc4d8c78b2a89ea4f32b837c586270a9cbf +size 88720 diff --git a/python-fire.changes b/python-fire.changes new file mode 100644 index 0000000..77f73dd --- /dev/null +++ b/python-fire.changes @@ -0,0 +1,185 @@ +------------------------------------------------------------------- +Wed Oct 29 01:09:09 UTC 2025 - Steve Kowalik + +- Add patch support-python-314.patch: + * Support Python 3.14 asyncio changes. + +------------------------------------------------------------------- +Wed Sep 17 12:04:56 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 0.7.1 + * Use Neutral theme for IPython Inspector, supporting newer IPython + versions in #588 + * Call inspectutils.GetClassAttrsDict on component, not None in #606 + * Move to pyproject.toml, adding wheel support in pypi + * Use ty in place of pytype + * Update requirements @dependabot[bot] +- Use Python 3.11 on SLE-15 by default + +------------------------------------------------------------------- +Tue Jun 17 04:14:19 UTC 2025 - Steve Kowalik + +- Switch to pyproject macros. +- Ship README as a doc. + +------------------------------------------------------------------- +Thu Oct 31 14:31:28 UTC 2024 - pgajdos@suse.com + +- version update to 0.7.0 + * This release is the first to drop Python 2 support. For Python 2 users, use <= 0.6.0. + * CI improvements from @Borda including dependabot and an expanded build matrix + * adding GH dependabot by @Borda in #432 + * Bump the pip group with 2 updates by @dependabot in #491 + * Update hypothesis requirement from <6.62.0 to <6.100.0 in /.github/scripts by @dependabot in #492 + * #444: Removed pipes dependency by @BasedDepartment1 in #447 + * Update termcolor requirement from <2.2.0 to <2.5.0 in /.github/scripts by @dependabot in #493 + * Update mock requirement from <5.0.0 to <6.0.0 in /.github/scripts by @dependabot in #495 + * Update pytest requirement from <=7.2.1 to <=8.1.1 in /.github/scripts by @dependabot in #494 + * Update pytest-runner requirement from <6.0.0 to <7.0.0 in /.github/scripts by @dependabot in #496 + * fix typo in dependabot group by @Borda in #497 + * Update setuptools requirement from <=69.1.1 to <=69.2.0 in /.github/scripts by @dependabot in #500 + * Update hypothesis requirement from <6.100.0 to <6.101.0 in /.github/scripts by @dependabot in #506 + * Update levenshtein requirement from <=0.25.0 to <=0.25.1 in /.github/scripts by @dependabot in #510 + * Use ast.Constant for recent Python versions by @wdhongtw in #526 + * Remove future imports now that we've dropped support for Python 2 by @dbieber in #539 + * remove six: Replace six.string_types and six.integer_types, etc. by @dbieber in #541 + * Remove sys.version_info checks by @dbieber in #542 + * Update setuptools requirement from <=69.2.0 to <=75.1.0 in /.github/scripts by @dependabot in #540 + * Simplify requirements.txt by assuming Python 3 by @dbieber in #543 + * Update hypothesis requirement from <6.101.0 to <6.113.0 in /.github/scripts by @dependabot in #544 + * Remove mock in favor of unittest.mock by @dbieber in #545 + * Update pytest requirement from <=8.1.1 to <=8.3.3 in /.github/scripts by @dependabot in #546 + * Update label used by dependabot by @dbieber in #547 + * Update levenshtein requirement from <=0.25.1 to <=0.26.0 in /.github/scripts by @dependabot in #548 + * Upgrade pylint version by @dbieber in #549 + * Run github action on pull_request by @dbieber in #550 + * Add current system MSYS check by @bonfy in #278 + * Remove .format in favor of f-strings by @dbieber in #551 + * Remove six from console, eliminates six entirely by @dbieber in #552 + * Move asyncio imports and update docs by @dbieber in #553 + * Include Python 3.13 in github actions by @dbieber in #554 + * Continue upgrade of codebase to Python 3 by @dbieber in #556 + * update required Python 3.7 in setup.py by @Borda in #555 + * Lint improvements and type safety by @dbieber in #558 + * ci: expand build matrix for major OS by @Borda in #490 + * Replace Python 2 type hints with real type annotations by @dbieber in #559 +- Replace upstreamed patch: + - python-fire-no-mock.patch + - support-python-311.patch + +------------------------------------------------------------------- +Tue Feb 7 01:05:45 UTC 2023 - Steve Kowalik + +- Update to 0.5.0: + * Support for custom serializers with fire.Fire(serializer=your_serializer) + * Auto-generated help text now shows short arguments (e.g. -a) when + appropriate + * Default values are now shown in help for kwonly arguments + * Completion script fix where previously completions might not show at all +- Refresh python-fire-no-mock.patch +- Add patch support-python-311.patch: + * Support Python 3.11 + +------------------------------------------------------------------- +Wed Mar 16 12:52:10 UTC 2022 - pgajdos@suse.com + +- do not require python-mock for build +- added patches + fix https://github.com/google/python-fire/pull/265/files + + python-fire-no-mock.patch + +------------------------------------------------------------------- +Fri Mar 12 04:41:30 UTC 2021 - Steve Kowalik + +- Update to 0.4.0: + * Support for Python 3.8 and Python 3.9 + * Argument types and defaults appear in help text + * Support for asyncio coroutines + * Support for modules and Python files with python -m fire + * Keyword argument info from rst docstrings appears in help text + * Bug fix for missing parts of multiline argument descriptions from + Google and Numpy style docstrings. + * Support functions even when they override getattr in non-standard ways. +- Drop patch subpoint-usage-test.patch, which is no longer required. + +------------------------------------------------------------------- +Thu Sep 17 11:09:09 UTC 2020 - Dirk Mueller + +- update to 0.3.1: + * Removes preexec_fn from pager subprocess cal + +------------------------------------------------------------------- +Thu Apr 2 01:40:27 UTC 2020 - Steve Kowalik + +- Update to 0.3.0: + * Use Fire on third-party code without making any code changes: + python -m fire + * Docstring parsing fix for all lines are blank f01aad3 + * Improved parsing of numpy-style docstrings + * #187 Expose built-in functions from the standard library (e.g. sin, cos) + * #149 Support objects implementing __getattr__ + * #205 Fix ctrl-C handling in help screens + * Support functools.wraps and lru_cache decorated functions + * Better support for objects with properties + * Objects with custom __str__ are now treated as Values. E.g. If such an + object appears in a dict, the dict will still print in line-by-line mode + rather than showing a help screen by default. + * Formatting on Windows works properly now + +------------------------------------------------------------------- +Tue Oct 15 03:36:44 UTC 2019 - Steve Kowalik + +- Add subpoint-usage-test.patch, which will change the subpoint usage string + if running under Python 3.8. + +------------------------------------------------------------------- +Fri Sep 13 07:44:29 UTC 2019 - Tomáš Chvátal + +- Update to 0.2.1: + * Improves robustness of docstring parser in the face of unexpected format docstrings. #183 + +------------------------------------------------------------------- +Tue Jul 30 07:07:56 UTC 2019 - pgajdos@suse.com + +- version update to 0.2.0 + * Help and usage screens + * Help screens now have a man-page appearance and are shown with less-style pagination. Usage screens are shown when a user-error is encountered. The help and usage screens are considerably cleaner than the default output in previous versions of Fire. + * Custom serialization + * If you define a custom __str__ method on an object, that will be used to serialize the object when it is the final result of a Fire command. This means better support for numpy arrays, and better support for custom types. + * Docstring parsing + * Notably, docstrings are parsed in order to determine the descriptions to use for arguments in the help screens. We largely support (but not fully) Google, numpy, and RST style docstrings. These are the three most common styles of docstring used in Python code. + * Access --help naturally + * You no longer need to separate --help from your command with an extra --. Simply running command -h or command --help will give help, provided there isn't an argument named help in your component. + * NamedTuples can be indexed both by their field names and by their indexes. + * Callable objects can both be called, and their members can be accessed. + * You must use flag syntax to call a callable object; you cannot pass their arguments positionally. + * Single-hyphen flags are supported + * You can now specify -flag instead of --flag if preferred. Both work. + * Short-flags are permitted when their use is unambiguous + * E.g. if your function has argument alpha, then you can specify its value with -a. + * Fish completion support +- deleted patches + - fix-issue-164.patch (upstreamed) + +------------------------------------------------------------------- +Sat Mar 9 00:26:12 CET 2019 - Matej Cepl + +- Add fix-issue-164.patch patch to fix gh#google/python-fire#164 + and we can run whole test suite. + +------------------------------------------------------------------- +Thu Feb 7 21:02:37 CET 2019 - Matej Cepl + +- Switch of tests testFireKeywordArgs, testFireObjectWithDict, + testHelpStringBuiltin, and testGetFullArgSpecFromBuiltin + gh#google/python-fire#164 + +------------------------------------------------------------------- +Wed Jan 2 12:50:28 UTC 2019 - Tomáš Chvátal + +- Simplify the tests call + +------------------------------------------------------------------- +Thu Nov 15 16:48:24 UTC 2018 - Todd R + +- Initial version diff --git a/python-fire.spec b/python-fire.spec new file mode 100644 index 0000000..f5d6b98 --- /dev/null +++ b/python-fire.spec @@ -0,0 +1,68 @@ +# +# spec file for package python-fire +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# 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-fire +Version: 0.7.1 +Release: 0 +Summary: A library for automatically generating command line interfaces +License: Apache-2.0 +URL: https://github.com/google/python-fire +Source: https://files.pythonhosted.org/packages/source/f/fire/fire-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#google/python-fire#623 +Patch0: support-python-314.patch +# Based on https://github.com/google/python-fire/pull/265/files +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-termcolor +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module Levenshtein} +BuildRequires: %{python_module hypothesis} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module termcolor} +# /SECTION +%python_subpackages + +%description +Python Fire is a library for automatically generating command line +interfaces (CLIs) from a Python object. + +%prep +%autosetup -p1 -n fire-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%doc README.md +%license LICENSE +%{python_sitelib}/fire +%{python_sitelib}/fire-%{version}.dist-info + +%changelog diff --git a/support-python-314.patch b/support-python-314.patch new file mode 100644 index 0000000..9b21d3c --- /dev/null +++ b/support-python-314.patch @@ -0,0 +1,63 @@ +From 1aa72a66acd4e9dc421deb5523a429f9f4519421 Mon Sep 17 00:00:00 2001 +From: David Bieber +Date: Sat, 16 Aug 2025 16:42:23 -0400 +Subject: [PATCH 1/4] Add Python 3.13 and 3.14 checking in build workflow + +--- + .github/workflows/build.yml | 2 +- + pyproject.toml | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +Index: fire-0.7.1/pyproject.toml +=================================================================== +--- fire-0.7.1.orig/pyproject.toml ++++ fire-0.7.1/pyproject.toml +@@ -24,6 +24,7 @@ classifiers = [ + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ++ "Programming Language :: Python :: 3.14", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: MacOS", +Index: fire-0.7.1/fire/core.py +=================================================================== +--- fire-0.7.1.orig/fire/core.py ++++ fire-0.7.1/fire/core.py +@@ -678,8 +678,14 @@ def _CallAndUpdateTrace(component, args, + + # Call the function. + if inspectutils.IsCoroutineFunction(fn): +- loop = asyncio.get_event_loop() +- component = loop.run_until_complete(fn(*varargs, **kwargs)) ++ try: ++ loop = asyncio.get_running_loop() ++ except RuntimeError: ++ # No event loop running, create a new one ++ component = asyncio.run(fn(*varargs, **kwargs)) ++ else: ++ # Event loop is already running ++ component = loop.run_until_complete(fn(*varargs, **kwargs)) + else: + component = fn(*varargs, **kwargs) + +Index: fire-0.7.1/fire/inspectutils.py +=================================================================== +--- fire-0.7.1.orig/fire/inspectutils.py ++++ fire-0.7.1/fire/inspectutils.py +@@ -14,7 +14,6 @@ + + """Inspection utility functions for Python Fire.""" + +-import asyncio + import inspect + import sys + import types +@@ -345,6 +344,6 @@ def GetClassAttrsDict(component): + + def IsCoroutineFunction(fn): + try: +- return asyncio.iscoroutinefunction(fn) ++ return inspect.iscoroutinefunction(fn) + except: # pylint: disable=bare-except + return False