Compare commits
8 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 5744ed2207 | |||
| edf3f0daa6 | |||
| d659892c1b | |||
| b496983b0f | |||
| a3dfd18efc | |||
| a588b26265 | |||
| 75c61c3b0e | |||
| a6164d1db0 |
@@ -1,3 +1,27 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jun 17 09:24:11 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
- Convert to libalternatives
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jan 27 16:46:53 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
- Tweak support-python-313.patch to adapt to yet another change
|
||||||
|
in argparse
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jan 7 03:37:22 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Rejig patch support-python-313.patch to also cope with other argparse
|
||||||
|
changes.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 9 03:34:48 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add patch support-python-313.patch:
|
||||||
|
* Support Python 3.13+ argparse output changes.
|
||||||
|
- Switch to pyrpoject macros.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Jun 18 16:34:42 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>
|
Sun Jun 18 16:34:42 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-calmjs
|
# spec file for package python-calmjs
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%bcond_without libalternatives
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-calmjs
|
Name: python-calmjs
|
||||||
Version: 3.4.4
|
Version: 3.4.4
|
||||||
@@ -24,17 +25,20 @@ Summary: A Python framework for working with the Node.js ecosystem
|
|||||||
License: GPL-2.0-or-later
|
License: GPL-2.0-or-later
|
||||||
URL: https://github.com/calmjs/calmjs/
|
URL: https://github.com/calmjs/calmjs/
|
||||||
Source: https://github.com/calmjs/calmjs/archive/%{version}.tar.gz
|
Source: https://github.com/calmjs/calmjs/archive/%{version}.tar.gz
|
||||||
|
# PATCH-FIX-OPENSUSE Support Python 3.13 argparse output changes
|
||||||
|
Patch0: support-python-313.patch
|
||||||
BuildRequires: %{python_module calmjs.parse >= 1.0.0}
|
BuildRequires: %{python_module calmjs.parse >= 1.0.0}
|
||||||
BuildRequires: %{python_module calmjs.types}
|
BuildRequires: %{python_module calmjs.types}
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
|
BuildRequires: alts
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
|
Requires: alts
|
||||||
Requires: python-calmjs.parse >= 1.0.0
|
Requires: python-calmjs.parse >= 1.0.0
|
||||||
Requires: python-calmjs.types
|
Requires: python-calmjs.types
|
||||||
Requires(post): update-alternatives
|
Requires: python-setuptools
|
||||||
Requires(postun):update-alternatives
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: nodejs-common
|
BuildRequires: nodejs-common
|
||||||
@@ -54,11 +58,11 @@ rm src/calmjs/tests/test_yarn.py
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_clone -a %{buildroot}%{_bindir}/calmjs
|
%python_clone -a %{buildroot}%{_bindir}/calmjs
|
||||||
# see https://github.com/calmjs/calmjs/issues/65 for maintainer feedback
|
# see https://github.com/calmjs/calmjs/issues/65 for maintainer feedback
|
||||||
# regarding these two subpackages.
|
# regarding these two subpackages.
|
||||||
@@ -71,11 +75,8 @@ export LANG=en_US.UTF-8
|
|||||||
# DistLoggerTestCase is not working correctly in obs build environment
|
# DistLoggerTestCase is not working correctly in obs build environment
|
||||||
%pytest -v --pyargs calmjs.tests -k 'not DistLoggerTestCase'
|
%pytest -v --pyargs calmjs.tests -k 'not DistLoggerTestCase'
|
||||||
|
|
||||||
%post
|
%pre
|
||||||
%python_install_alternative calmjs
|
%python_libalternatives_reset_alternative calmjs
|
||||||
|
|
||||||
%postun
|
|
||||||
%python_uninstall_alternative calmjs
|
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
@@ -83,6 +84,6 @@ export LANG=en_US.UTF-8
|
|||||||
%python_alternative %{_bindir}/calmjs
|
%python_alternative %{_bindir}/calmjs
|
||||||
%{python_sitelib}/calmjs
|
%{python_sitelib}/calmjs
|
||||||
%{python_sitelib}/calmjs-%{version}*-nspkg.pth
|
%{python_sitelib}/calmjs-%{version}*-nspkg.pth
|
||||||
%{python_sitelib}/calmjs-%{version}*-info
|
%{python_sitelib}/calmjs-%{version}.dist-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|||||||
54
support-python-313.patch
Normal file
54
support-python-313.patch
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
Index: calmjs-3.4.4/src/calmjs/tests/test_argparse.py
|
||||||
|
===================================================================
|
||||||
|
--- calmjs-3.4.4.orig/src/calmjs/tests/test_argparse.py
|
||||||
|
+++ calmjs-3.4.4/src/calmjs/tests/test_argparse.py
|
||||||
|
@@ -112,7 +112,10 @@ class HelpFormatterTestCase(unittest.Tes
|
||||||
|
for line in stream.getvalue().splitlines() if
|
||||||
|
'--' in line
|
||||||
|
]
|
||||||
|
- self.assertEqual(options, ['-a', '-g', '-s', '-z'])
|
||||||
|
+ expected = ['-a', '-g', '-s', '-z']
|
||||||
|
+ if sys.version_info >= (3, 13):
|
||||||
|
+ expected = [f"{x}," for x in expected]
|
||||||
|
+ self.assertEqual(options, expected)
|
||||||
|
|
||||||
|
def test_sorted_case_insensitivity(self):
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
@@ -131,7 +134,10 @@ class HelpFormatterTestCase(unittest.Tes
|
||||||
|
'--' in line
|
||||||
|
]
|
||||||
|
# the case is unspecified due to in-place sorting
|
||||||
|
- self.assertEqual(options, ['-a', '-A', '-g', '-S', '-s', '-z'])
|
||||||
|
+ expected = ['-a', '-A', '-g', '-S', '-s', '-z']
|
||||||
|
+ if sys.version_info >= (3, 13):
|
||||||
|
+ expected = [f"{x}," for x in expected]
|
||||||
|
+ self.assertEqual(options, expected)
|
||||||
|
|
||||||
|
def test_sorted_simple_first(self):
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
@@ -150,8 +156,11 @@ class HelpFormatterTestCase(unittest.Tes
|
||||||
|
'--' in line and '[' not in line
|
||||||
|
]
|
||||||
|
# the case is unspecified due to in-place sorting
|
||||||
|
- self.assertEqual(options, [
|
||||||
|
- '-a', '-A', '-z', '--goat', '--sheep', '--SNAKE'])
|
||||||
|
+ long_options = ['--goat', '--sheep', '--SNAKE']
|
||||||
|
+ expected = ['-a', '-A', '-z']
|
||||||
|
+ if sys.version_info >= (3, 13):
|
||||||
|
+ expected = [f"{x}," for x in expected]
|
||||||
|
+ self.assertEqual(options, expected + long_options)
|
||||||
|
|
||||||
|
|
||||||
|
class ArgumentParserTestCase(unittest.TestCase):
|
||||||
|
@@ -306,7 +315,10 @@ class StoreCommaDelimitedListTestCase(un
|
||||||
|
with self.assertRaises(SystemExit):
|
||||||
|
argparser.parse_known_args(['-p', '3,2,1,0'])
|
||||||
|
|
||||||
|
- self.assertIn("(choose from '1', '2', '3')", sys.stderr.getvalue())
|
||||||
|
+ msg = "(choose from '1', '2', '3')"
|
||||||
|
+ if sys.version_info[:2] >= (3, 12):
|
||||||
|
+ msg = "(choose from 1, 2, 3)"
|
||||||
|
+ self.assertIn(msg, sys.stderr.getvalue())
|
||||||
|
|
||||||
|
with self.assertRaises(SystemExit):
|
||||||
|
argparser.parse_known_args(['-p', '0'])
|
||||||
Reference in New Issue
Block a user