From 3eca0b9879ae3824be384e5764b2e016acf67ae815e1c343151c3024e2514c1e Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 6 Aug 2024 06:32:14 +0000 Subject: [PATCH] - update to 0.31.3: * Fix type annotation of `errors` in `wrap_errors` * fix: exposing func arg in CLI under a different name via deco (fixes #224) * fix: tests were failing under Python 3.13 by @neithere (reported * Docs update in similar.rst OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-argh?expand=0&rev=44 --- .gitattributes | 23 ++++ .gitignore | 1 + argh-0.31.2.tar.gz | 3 + argh-0.31.3.tar.gz | 3 + python-argh.changes | 290 ++++++++++++++++++++++++++++++++++++++++++++ python-argh.spec | 76 ++++++++++++ 6 files changed, 396 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 argh-0.31.2.tar.gz create mode 100644 argh-0.31.3.tar.gz create mode 100644 python-argh.changes create mode 100644 python-argh.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/argh-0.31.2.tar.gz b/argh-0.31.2.tar.gz new file mode 100644 index 0000000..75e369c --- /dev/null +++ b/argh-0.31.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db1c34885804f7d4646c385dc2fb19b45298561322f4c15eae1b133993f9e323 +size 57200 diff --git a/argh-0.31.3.tar.gz b/argh-0.31.3.tar.gz new file mode 100644 index 0000000..cb1c31e --- /dev/null +++ b/argh-0.31.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f30023d8be14ca5ee6b1b3eeab829151d7bbda464ae07dc4dd5347919c5892f9 +size 57570 diff --git a/python-argh.changes b/python-argh.changes new file mode 100644 index 0000000..1540acc --- /dev/null +++ b/python-argh.changes @@ -0,0 +1,290 @@ +------------------------------------------------------------------- +Tue Aug 6 06:31:57 UTC 2024 - Dirk Müller + +- update to 0.31.3: + * Fix type annotation of `errors` in `wrap_errors` + * fix: exposing func arg in CLI under a different name via deco + (fixes #224) + * fix: tests were failing under Python 3.13 by @neithere + (reported + * Docs update in similar.rst + +------------------------------------------------------------------- +Tue Jan 30 12:20:53 UTC 2024 - Dirk Müller + +- update to 0.31.2: + * broken support for `Optional[List]` (but not + `Optional[list]`), a narrower case of the problem fixed + earlier + +------------------------------------------------------------------- +Sat Jan 20 12:41:49 UTC 2024 - Dirk Müller + +- update to 0.31.1: + * broken support for type alias `List` + * cleaned up the README, rearranged other documentation. + +------------------------------------------------------------------- +Mon Jan 8 21:09:40 UTC 2024 - Dirk Müller + +- update to 0.31.0: + * The typing hints introspection feature is automatically + enabled for any command (function) which does not have any + arguments specified via @arg decorator. + * A small change in the legacy argument mapping policy + BY_NAME_IF_HAS_DEFAULT concerning the order of variadic + positional vs. keyword-only arguments. The following function + now results in main alpha [args ...] beta instead of main + alpha beta [args ...]: def main(alpha, *args, beta): ... + This does not concern the default name mapping policy. Even + for the legacy one it's an edge case which is extremely + unlikely to appear in any real-life application. + * Added experimental support for basic typing hints (issue + #203) The following hints are currently supported: str, int, + float, bool (goes to type); list (affects nargs), list[T] + (first subtype goes into type); Literal[T1, T2, ...] + (interpreted as choices); Optional[T] AKA T | None (currently + interpreted as required=False for optional and nargs="?" for + positional arguments; likely to change in the future as use + cases accumulate). The exact interpretation of the type + hints is subject to change in the upcoming versions of Argh. + * Added always_flush argument to dispatch() (issue #145) + * High-level functions argh.dispatch_command() and + argh.dispatch_commands() now accept a new parameter + old_name_mapping_policy. The behaviour hasn't changed + because the parameter is True by default. It will change to + False in Argh v.0.33 or v.1.0. + +------------------------------------------------------------------- +Wed Dec 27 09:32:00 UTC 2023 - Dirk Müller + +- update to 0.30.5: + * A combination of `nargs` with a list as default value would + lead to the values coming from CLI being wrapped in another + list (issue #212). + * Argspec guessing: if `nargs` is not specified but the default + value is a list, `nargs="*"` is assumed and passed to argparse. + +------------------------------------------------------------------- +Fri Nov 10 13:22:29 UTC 2023 - Dirk Müller + +- update to 0.30.4: + * Regression: a positional argument with an underscore used in + `@arg` decorator would cause Argh fail on the assembling stage. + * As reported in #204 and #206, the new default name mapping + policy in fact silently changed the CLI API of some scripts: + arguments which were previously translated as CLI options + became optional positionals. + Although the instructions were supplied in the release notes, + the upgrade may not necessarily be intentional, so a waste of + users' time is quite likely. + * To alleviate this, the default value for + `name_mapping_policy` in standard functions has been changed + to `None`; if it's not specified, Argh falls back to the new + default policy, but raises `ArgumentNameMappingError` with + detailed instructions if it sees a non-kwonly argument with a + default value. + * Please specify the policy explicitly in order to avoid this + error if you need to infer optional positionals (``nargs="?"``) + from function signature. + * Regression: certain special values in argument default value + would cause an exception (#204) + * Added a more informative error message when the reason is + likely to be related to the migration from Argh v0.29 to a + version with a new argument name mapping policy. + * A new policy for mapping function arguments to CLI arguments + is used by default + * If you cannot modify the function signature to use kwonly + args for options, please consider explicitly specifying the + legacy name mapping + * The name mapping policy `BY_NAME_IF_HAS_DEFAULT` slightly + deviates from the old behaviour. Kwonly arguments without + default values used to be marked as required options + (``--foo FOO``), now they are treated as positionals + (``foo``). Please consider the new default policy + (`BY_NAME_IF_KWONLY`) for a better treatment of kwonly. + * Removed previously deprecated features (#184 → #188): + * Added support for Python 3.12. + * Added type annotations to existing Argh code (#185 → #189). + * The `dispatch()` function has been refactored, so in case you + need finer control over the process, two new, more granular + functions can be used. + +------------------------------------------------------------------- +Wed Oct 11 08:41:29 UTC 2023 - Dirk Müller + +- update to 0.29.4: + * Test coverage reported as <100% when argcomplete is installed + * Technical releases for packaging purposes. No changes in + functionality. + * Backwards incompatible changes: + * Wrapped exceptions now cause ``dispatching.dispatch()`` to + raise ``SystemExit(1)`` instead of returning without error. + For most users, this means failed commands will now exit + with a failure status instead of a success. + * Renamed arguments in `add_commands()` (#165): + * `namespace` → `group_name` + * `namespace_kwargs` → `group_kwargs` + * The old names are deprecated and will be removed in v.0.30. + * Can control exit status (see Backwards Incompatible Changes + above) when raising ``CommandError`` using the ``code`` + keyword arg. + * Bugs fixed: + * Positional arguments should not lead to removal of short + form of keyword arguments. + * Other changes: + * Avoid depending on iocapture by using pytest's built-in + feature + +------------------------------------------------------------------- +Fri Jun 2 07:12:44 UTC 2023 - pgajdos@suse.com + +- version update to 0.28.1 + Version 0.28.1 + -------------- + - Fixed bugs in tests (#171, #172) + Version 0.28.0 + -------------- + A major cleanup. + Backward incompatible changes: + - Dropped support for Python 2.7 and 3.7. + Deprecated features, to be removed in v.0.30: + - `argh.assembling.SUPPORTS_ALIASES`. + - Always `True` for recent versions of Python. + - `argh.io.safe_input()` AKA `argh.interaction.safe_input()`. + - Not relevant anymore. Please use the built-in `input()` instead. + - argument `pre_call` in `dispatch()`. + - Argument help as annotations. + - Annotations will only be used for types after v.0.30. + - Added deprecation warnings for some arguments deprecated back in v.0.26. + Version 0.27.2 + -------------- + Minor packaging fix: + * chore: include file required by tox.ini in the sdist (#155) + Version 0.27.1 + -------------- + Minor building and packaging fixes: + * docs: add Read the Docs config (#160) + * chore: include tox.ini in the sdist (#155) + Version 0.27.0 + -------------- + This is the last version to support Python 2.7. + Backward incompatible changes: + - Dropped support for Python 2.6. + Enhancements: + - Added support for Python 3.7 through 3.11. + - Support introspection of function signature behind the `@wraps` decorator + (issue #111). + Fixed bugs: + - When command function signature contained ``**kwargs`` *and* positionals + without defaults and with underscores in their names, a weird behaviour could + be observed (issue #104). + - Fixed introspection through decorators (issue #111). + - Switched to Python's built-in `unittest.mock` (PR #154). + - Fixed bug with `skip_unknown_args=True` (PR #134). + - Fixed tests for Python 3.9.7+ (issue #148). + Other changes: + - Included the license files in manifest (PR #112). + - Extended the list of similar projects (PR #87). + - Fixed typos and links in documentation (PR #110, #116, #156). + - Switched CI to Github Actions (PR #153). +- deleted patches + - python-argh-no_mock.patch (upstreamed) + - support-py39.patch (upstreamed) + +------------------------------------------------------------------- +Thu Mar 10 10:09:41 UTC 2022 - pgajdos@suse.com + +- do not use python-mock for testing +- added patches + fix https://github.com/neithere/argh/issues/152 + + python-argh-no_mock.patch + +------------------------------------------------------------------- +Wed Sep 22 04:41:45 UTC 2021 - Steve Kowalik + +- Add patch support-py39.patch: + * Deal with Python 3.9.x changes in argparse. + +------------------------------------------------------------------- +Mon May 17 11:16:59 UTC 2021 - pgajdos@suse.com + +- use %pytest macro + +------------------------------------------------------------------- +Tue May 7 06:51:47 UTC 2019 - Tomáš Chvátal + +- Do not use symlinks on fdupes + +------------------------------------------------------------------- +Mon Mar 4 16:59:56 UTC 2019 - Tomáš Chvátal + +- Update to 0.26.2: + * no changelog available +- Drop no longer needed python-argh-0.26.1-fix-testsuite.patch + +------------------------------------------------------------------- +Wed Dec 5 01:53:34 UTC 2018 - Jan Engelhardt + +- Trim rhetorics from descriptions. + +------------------------------------------------------------------- +Tue Dec 4 12:45:39 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Mon Apr 24 17:32:13 UTC 2017 - toddrme2178@gmail.com + +- Fix source URL +- Various small spec file cleanups. + +------------------------------------------------------------------- +Sun Apr 23 08:19:15 UTC 2017 - aloisio@gmx.com + +- Converted to single-spec +- Added python-argh-0.26.1-fix-testsuite.patch +- Enabled tests + +------------------------------------------------------------------- +Sun Apr 19 16:29:05 UTC 2015 - benoit.monin@gmx.fr + +- update to version 0.26.1 + * no changelog available +- update project URL +- package README.rst instead of README + +------------------------------------------------------------------- +Thu Oct 24 10:58:54 UTC 2013 - speilicke@suse.com + +- Require python-setuptools instead of distribute (upstreams merged) + +------------------------------------------------------------------- +Wed Sep 25 17:18:00 UTC 2013 - p.drouand@gmail.com + +- Update to version 0.23.3 + + No changelog available + +------------------------------------------------------------------- +Thu Mar 7 20:43:50 UTC 2013 - darin@darins.net + +- Update to verios 0.23.0 + + Upstream provides no changelog + +------------------------------------------------------------------- +Fri Nov 23 10:45:39 UTC 2012 - saschpe@suse.de + +- Update to version 0.17.2: + + Upstream provides no changelog + +------------------------------------------------------------------- +Wed Jun 6 23:41:39 UTC 2012 - os-dev@jacraig.com + +- Update to version 0.15.1: + + Upstream provides no changelog + +------------------------------------------------------------------- +Tue Jan 31 12:26:26 UTC 2012 - saschpe@suse.de + +- Initial version + diff --git a/python-argh.spec b/python-argh.spec new file mode 100644 index 0000000..cf7d2f1 --- /dev/null +++ b/python-argh.spec @@ -0,0 +1,76 @@ +# +# spec file for package python-argh +# +# Copyright (c) 2024 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-argh +Version: 0.31.3 +Release: 0 +Summary: An argparse wrapper +License: LGPL-3.0-or-later +URL: https://github.com/neithere/argh/ +Source: https://files.pythonhosted.org/packages/source/a/argh/argh-%{version}.tar.gz +BuildRequires: %{python_module flit-core} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +%python_subpackages + +%description +This Python module provides a wrapper for argparse with support for hierarchical +commands that can be bound to modules or classes. + +Features that argh adds to argparse: + +* mark a function as a CLI command and specify its arguments before the parser + is instantiated; +* nested commands made easy: no messing with subparsers (though they are of + course used under the hood); +* infer agrument type from the default value; +* infer command name from function name; +* add an alias root command help for the --help argument; +* enable passing unwrapped arguments to certain functions instead of a + argparse.Namespace object. + +Argh is fully compatible with argparse. argh-agnostic and argh-aware code +can be mixed. Keep in mind that argh.dispatch does some extra +work that a custom dispatcher may not do. + +%prep +%autosetup -p1 -n argh-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# do not run test_integration, which requires dropped iocapture +rm tests/test_integration.py +%pytest -v + +%files %{python_files} +%doc README.rst +%{python_sitelib}/argh/ +%{python_sitelib}/argh-%{version}.dist-info + +%changelog