commit 2e4a34144d15c43069c43b008d51be59cebe0916954879991b45ee6f38d0aa48 Author: Matej Cepl Date: Mon May 5 15:02:39 2025 +0000 - Convert to pip-based build OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ConfigArgParse?expand=0&rev=18 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/ConfigArgParse-1.7.tar.gz b/ConfigArgParse-1.7.tar.gz new file mode 100644 index 0000000..4ba90e0 --- /dev/null +++ b/ConfigArgParse-1.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7067471884de5478c58a511e529f0f9bd1c66bfef1dea90935438d6c23306d1 +size 43817 diff --git a/py313-skip-exit.patch b/py313-skip-exit.patch new file mode 100644 index 0000000..ebeb008 --- /dev/null +++ b/py313-skip-exit.patch @@ -0,0 +1,26 @@ +From 5e9f442374bc6d9707a43df13aaff684dff6b535 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Fri, 12 Jul 2024 08:25:30 +0200 +Subject: [PATCH] skip exit_on_error* tests to fix 3.13 test failures + +Skip `exit_on_error*` tests from `test.test_argparse` to avoid test +failures on Python 3.13. The `exit_on_error=False` semantics +is not supported by ConfigArgParse at the moment. +--- + tests/test_configargparse.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests/test_configargparse.py b/tests/test_configargparse.py +index e325afd..9718d86 100644 +--- a/tests/test_configargparse.py ++++ b/tests/test_configargparse.py +@@ -1533,7 +1533,8 @@ def testYAMLConfigFileParser_w_ArgumentParser_parsed_values(self): + test_argparse_source_code = test_argparse_source_code.replace( + 'argparse.ArgumentParser', 'configargparse.ArgumentParser').replace( + 'TestHelpFormattingMetaclass', '_TestHelpFormattingMetaclass').replace( +- 'test_main', '_test_main') ++ 'test_main', '_test_main').replace( ++ 'test_exit_on_error', '_test_exit_on_error') + + # pytest tries to collect tests from TestHelpFormattingMetaclass, and + # test_main, and raises a warning when it finds it's not a test class diff --git a/py313-tests.patch b/py313-tests.patch new file mode 100644 index 0000000..befe1c7 --- /dev/null +++ b/py313-tests.patch @@ -0,0 +1,85 @@ +From c6a974211f1a13d492bb807ff6d07cefcc948a87 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Fri, 12 Jul 2024 08:15:40 +0200 +Subject: [PATCH] update test expectations for Python 3.13 + +Python 3.13 no longer repeats the placeholder for options with multiple +aliases in the help message. For example, rather than: + + -c CONFIG_FILE, --config CONFIG_FILE + +it now outputs: + + -c, --config CONFIG_FILE + +Update the regular expressions to account for both possibilities. + +Fixes #294 +--- + tests/test_configargparse.py | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/tests/test_configargparse.py b/tests/test_configargparse.py +index 288e082..e325afd 100644 +--- a/tests/test_configargparse.py ++++ b/tests/test_configargparse.py +@@ -271,9 +271,9 @@ def testBasicCase2(self, use_groups=False): + ' -h, --help \\s+ show this help message and exit\n' + ' --genome GENOME \\s+ Path to genome file\n' + ' -v\n' +- ' -g MY_CFG_FILE, --my-cfg-file MY_CFG_FILE\n' +- ' -d DBSNP, --dbsnp DBSNP\\s+\\[env var: DBSNP_PATH\\]\n' +- ' -f FRMT, --format FRMT\\s+\\[env var: OUTPUT_FORMAT\\]\n\n'%OPTIONAL_ARGS_STRING + ++ ' -g( MY_CFG_FILE)?, --my-cfg-file MY_CFG_FILE\n' ++ ' -d( DBSNP)?, --dbsnp DBSNP\\s+\\[env var: DBSNP_PATH\\]\n' ++ ' -f( FRMT)?, --format FRMT\\s+\\[env var: OUTPUT_FORMAT\\]\n\n'%OPTIONAL_ARGS_STRING + + 7*r'(.+\s*)') + else: + self.assertRegex(self.format_help(), +@@ -286,10 +286,10 @@ def testBasicCase2(self, use_groups=False): + 'g1:\n' + ' --genome GENOME \\s+ Path to genome file\n' + ' -v\n' +- ' -g MY_CFG_FILE, --my-cfg-file MY_CFG_FILE\n\n' ++ ' -g( MY_CFG_FILE)?, --my-cfg-file MY_CFG_FILE\n\n' + 'g2:\n' +- ' -d DBSNP, --dbsnp DBSNP\\s+\\[env var: DBSNP_PATH\\]\n' +- ' -f FRMT, --format FRMT\\s+\\[env var: OUTPUT_FORMAT\\]\n\n'%OPTIONAL_ARGS_STRING + ++ ' -d( DBSNP)?, --dbsnp DBSNP\\s+\\[env var: DBSNP_PATH\\]\n' ++ ' -f( FRMT)?, --format FRMT\\s+\\[env var: OUTPUT_FORMAT\\]\n\n'%OPTIONAL_ARGS_STRING + + 7*r'(.+\s*)') + + self.assertParseArgsRaises("invalid choice: 'ZZZ'", +@@ -387,9 +387,9 @@ def testMutuallyExclusiveArgs(self): + ' \\s*-f2 TYPE2_CFG_FILE\\)\\s+\\(-f FRMT \\| -b\\)\n\n' + '%s:\n' + ' -h, --help show this help message and exit\n' +- ' -f1 TYPE1_CFG_FILE, --type1-cfg-file TYPE1_CFG_FILE\n' +- ' -f2 TYPE2_CFG_FILE, --type2-cfg-file TYPE2_CFG_FILE\n' +- ' -f FRMT, --format FRMT\\s+\\[env var: OUTPUT_FORMAT\\]\n' ++ ' -f1( TYPE1_CFG_FILE)?, --type1-cfg-file TYPE1_CFG_FILE\n' ++ ' -f2( TYPE2_CFG_FILE)?, --type2-cfg-file TYPE2_CFG_FILE\n' ++ ' -f( FRMT)?, --format FRMT\\s+\\[env var: OUTPUT_FORMAT\\]\n' + ' -b, --bam\\s+\\[env var: BAM_FORMAT\\]\n\n' + 'group1:\n' + ' --genome GENOME Path to genome file\n' +@@ -875,7 +875,7 @@ def testConstructor_ConfigFileArgs(self): + 'usage: .* \\[-h\\] -c CONFIG_FILE --genome GENOME\n\n' + '%s:\n' + ' -h, --help\\s+ show this help message and exit\n' +- ' -c CONFIG_FILE, --config CONFIG_FILE\\s+ my config file\n' ++ ' -c( CONFIG_FILE)?, --config CONFIG_FILE\\s+ my config file\n' + ' --genome GENOME\\s+ Path to genome file\n\n'%OPTIONAL_ARGS_STRING + + 5*r'(.+\s*)') + +@@ -935,8 +935,8 @@ def test_FormatHelp(self): + r'\[-w CONFIG_OUTPUT_PATH\]\s* --arg1\s+ARG1\s*\[--flag\]\s*' + '%s:\\s*' + '-h, --help \\s* show this help message and exit ' +- r'-c CONFIG_FILE, --config CONFIG_FILE\s+my config file ' +- r'-w CONFIG_OUTPUT_PATH, --write-config CONFIG_OUTPUT_PATH takes ' ++ r'-c( CONFIG_FILE)?, --config CONFIG_FILE\s+my config file ' ++ r'-w( CONFIG_OUTPUT_PATH)?, --write-config CONFIG_OUTPUT_PATH takes ' + r'the current command line args and writes them ' + r'out to a config file at the given path, then exits ' + r'--arg1 ARG1 Arg1 help text ' diff --git a/python-ConfigArgParse.changes b/python-ConfigArgParse.changes new file mode 100644 index 0000000..14e2551 --- /dev/null +++ b/python-ConfigArgParse.changes @@ -0,0 +1,165 @@ +------------------------------------------------------------------- +Mon May 5 13:07:22 UTC 2025 - Markéta Machová + +- Convert to pip-based build + +------------------------------------------------------------------- +Tue Oct 29 20:09:28 UTC 2024 - Dirk Müller + +- add py313-skip-exit.patch, py313-tests.patch +- skip one more test + +------------------------------------------------------------------- +Wed Jul 26 15:58:19 UTC 2023 - Dirk Müller + +- update to 1.7: + * python 3.11 enablement + * improved apidocs, improved README + +------------------------------------------------------------------- +Sat Jul 1 20:41:52 UTC 2023 - Dirk Müller + +- update to 1.5.5: + * no upstream changelog available + +------------------------------------------------------------------- +Mon Jun 12 05:37:34 UTC 2023 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Wed Mar 9 09:34:57 UTC 2022 - pgajdos@suse.com + +- version update to 1.5.3 + * no upstream changelog found +- python-mock actually not required for build + +------------------------------------------------------------------- +Tue Jul 20 17:28:18 UTC 2021 - Matej Cepl + +- Rename the package according to PyPI + +------------------------------------------------------------------- +Sun Jul 4 19:52:10 UTC 2021 - Dirk Müller + +- update to 1.5.1: + * no changes file available + +------------------------------------------------------------------- +Tue Jun 8 06:24:49 UTC 2021 - Ferdinand Thiessen + +- Provide PyPi module name + +------------------------------------------------------------------- +Mon Mar 8 22:37:50 UTC 2021 - Dirk Müller + +- update to 1.3: + * Python 3.9 support + +------------------------------------------------------------------- +Wed Jun 10 15:57:44 UTC 2020 - Matej Cepl + +- Remove unnecessary dependency on unittest2 + +------------------------------------------------------------------- +Mon Jun 1 11:01:45 UTC 2020 - pgajdos@suse.com + +- version update to 1.2.3 + * Fixes #179 + * allow use of nargs with action=append (#177) + * Merged ConfigparserConfigFileParser - PR #173 - which adds support + for python's Configparser config file format + +------------------------------------------------------------------- +Thu Apr 23 11:15:11 UTC 2020 - Tomáš Chvátal + +- Fix build without python2 + +------------------------------------------------------------------- +Thu Feb 20 11:25:43 UTC 2020 - Steve Kowalik + +- Update to 1.0. + * Dash supported as first char of argument + +------------------------------------------------------------------- +Thu Nov 21 15:24:10 CET 2019 - Matej Cepl + +- When setting the environmental variable COLUMNS=80 + test case test_help_with_metavar works again. + gh#bw2/ConfigArgParse#146 + +------------------------------------------------------------------- +Wed Oct 23 13:07:43 UTC 2019 - Marketa Calabkova + +- Update to 0.15.1 + * Drop support for EOL Python 2.6, 3.2-3.3 + * Add Python 3.6 + * sudo no longer needed + * travis: Add latest Python versions. + * Drop support for EOL Python 3.4 + * Fix DeprecationWarning: invalid escape sequence \[ +- dropped skip-test.patch + * https://github.com/bw2/ConfigArgParse/commit/6267759da55c87508394314292c6c5286220d99d + +------------------------------------------------------------------- +Tue Sep 17 09:14:02 UTC 2019 - Tomáš Chvátal + +- Skip failing tests that were reported upstream with no reaction + +------------------------------------------------------------------- +Fri Mar 1 13:20:35 UTC 2019 - Tomáš Chvátal + +- Update to 0.14.0: + * Fixes for python3.6 and 3.7 + * Various lint fixes +- Make sure we run tests +- add patch skip-test.patch that skips test that does not work + in our test enviroment + +------------------------------------------------------------------- +Fri May 18 08:54:47 UTC 2018 - mcepl@suse.com + +- Cleanup SPEC file and add check section + +------------------------------------------------------------------- +Thu Aug 24 13:34:40 UTC 2017 - jmatejek@suse.com + +- singlespec auto-conversion + +------------------------------------------------------------------- +Thu Dec 17 17:05:23 UTC 2015 - jweberhofer@weberhofer.at + +- Updated to version 0.10.0 + * config file syntax is now easier to override or extend using the new + constructor arg: config_file_parser (via merged gh#bw2/ConfigArgParse#28 - thanks @lahwaacz ) + * support for python 2.6 (via merged gh#bw2/ConfigArgParse#18 - thanks @kuba ) + * replace dashes with underscores in env. var names when using the + auto-env-var feature (via merged gh#bw2/ConfigArgParse#29 - thanks @helgi ) + +- Fixed download-link and homepage + +- Fixed license + +------------------------------------------------------------------- +Mon Mar 9 15:30:11 UTC 2015 - freitag@owncloud.com + +- Add LICENSE file to doc section of the package +- Use python-setuptools as dependency +- Use full link to source. + +------------------------------------------------------------------- +Wed Mar 4 10:33:38 UTC 2015 - freitag@owncloud.com + +- Some minor cleanups. + +------------------------------------------------------------------- +Wed Mar 4 09:49:46 UTC 2015 - freitag@owncloud.com + +- Update to upstream version 0.9.3 to make mitmproxy work. + +------------------------------------------------------------------- +Tue Mar 3 07:07:25 UTC 2015 - freitag@opensuse.org + +- Initial package release + + diff --git a/python-ConfigArgParse.spec b/python-ConfigArgParse.spec new file mode 100644 index 0000000..2dd415b --- /dev/null +++ b/python-ConfigArgParse.spec @@ -0,0 +1,78 @@ +# +# spec file for package python-ConfigArgParse +# +# 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-ConfigArgParse +Version: 1.7 +Release: 0 +Summary: A drop-in replacement for argparse +License: MIT +Group: Development/Languages/Python +URL: https://github.com/bw2/ConfigArgParse +Source: https://files.pythonhosted.org/packages/source/C/ConfigArgParse/ConfigArgParse-%{version}.tar.gz +Patch1: https://github.com/bw2/ConfigArgParse/pull/295/commits/c6a974211f1a13d492bb807ff6d07cefcc948a87.patch#/py313-tests.patch +Patch2: https://github.com/bw2/ConfigArgParse/pull/295/commits/5e9f442374bc6d9707a43df13aaff684dff6b535.patch#/py313-skip-exit.patch +BuildRequires: %{python_module PyYAML} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-PyYAML +Requires: python-setuptools +# Old name of the package +Provides: python-configargparse = %{version}-%{release} +Obsoletes: python-configargparse < %{version}-%{release} +BuildArch: noarch +%python_subpackages + +%description +ConfigArgParse allows options to also be set via config files and/or environment +variables. + +Applications with more than a handful of user-settable options are best configured +through a combination of command line args, config files, hard-coded defaults, and +in some cases, environment variables. + +Python’s command line parsing modules such as argparse have very limited support +for config files and environment variables, so this module extends argparse to +add these features + +%prep +%autosetup -p1 -n ConfigArgParse-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# https://github.com/bw2/ConfigArgParse/issues/146 +export COLUMNS=80 +%pytest -k 'not (test_main or testGlobalInstances or testGlobalInstances_WithName or testConfigOrEnvValueErrors or testMutuallyExclusiveArgs)' + +%files %{python_files} +%doc README.rst +%license LICENSE +%{python_sitelib}/configargparse* +%{python_sitelib}/[Cc]onfig[Aa]rg[Pp]arse-%{version}*info +%pycache_only %{python_sitelib}/__pycache__ + +%changelog