15
0
forked from pool/python-calmjs

Compare commits

8 Commits

Author SHA256 Message Date
5bd8e749dc Accepting request 1286313 from devel:languages:python
- Convert to libalternatives

OBS-URL: https://build.opensuse.org/request/show/1286313
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-calmjs?expand=0&rev=13
2025-06-17 16:23:37 +00:00
6097d35cfb - Convert to libalternatives
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-calmjs?expand=0&rev=26
2025-06-17 09:24:31 +00:00
45138a33d1 Accepting request 1240689 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1240689
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-calmjs?expand=0&rev=12
2025-01-28 13:59:35 +00:00
683f55fc3d - Tweak support-python-313.patch to adapt to yet another change
in argparse

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-calmjs?expand=0&rev=24
2025-01-28 01:53:55 +00:00
03904e93b2 Accepting request 1235476 from devel:languages:python
- Rejig patch support-python-313.patch to also cope with other argparse
  changes.

OBS-URL: https://build.opensuse.org/request/show/1235476
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-calmjs?expand=0&rev=11
2025-01-07 19:53:38 +00:00
bcbbb297bd - Rejig patch support-python-313.patch to also cope with other argparse
changes.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-calmjs?expand=0&rev=22
2025-01-07 03:39:26 +00:00
fea6992a43 Accepting request 1229184 from devel:languages:python
- Add patch support-python-313.patch:
  * Support Python 3.13+ argparse output changes.
- Switch to pyrpoject macros.

OBS-URL: https://build.opensuse.org/request/show/1229184
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-calmjs?expand=0&rev=10
2024-12-09 20:12:14 +00:00
3a609d7034 - Add patch support-python-313.patch:
* Support Python 3.13+ argparse output changes.
- Switch to pyrpoject macros.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-calmjs?expand=0&rev=20
2024-12-09 03:35:27 +00:00
3 changed files with 90 additions and 11 deletions

View File

@@ -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>

View File

@@ -1,7 +1,7 @@
#
# 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
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
#
%bcond_without libalternatives
%{?sle15_python_module_pythons}
Name: python-calmjs
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
URL: https://github.com/calmjs/calmjs/
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.types}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: alts
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: alts
Requires: python-calmjs.parse >= 1.0.0
Requires: python-calmjs.types
Requires(post): update-alternatives
Requires(postun):update-alternatives
Requires: python-setuptools
BuildArch: noarch
# SECTION test requirements
BuildRequires: nodejs-common
@@ -54,11 +58,11 @@ rm src/calmjs/tests/test_yarn.py
%build
export LANG=en_US.UTF-8
%python_build
%pyproject_wheel
%install
export LANG=en_US.UTF-8
%python_install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/calmjs
# see https://github.com/calmjs/calmjs/issues/65 for maintainer feedback
# regarding these two subpackages.
@@ -71,11 +75,8 @@ export LANG=en_US.UTF-8
# DistLoggerTestCase is not working correctly in obs build environment
%pytest -v --pyargs calmjs.tests -k 'not DistLoggerTestCase'
%post
%python_install_alternative calmjs
%postun
%python_uninstall_alternative calmjs
%pre
%python_libalternatives_reset_alternative calmjs
%files %{python_files}
%license LICENSE
@@ -83,6 +84,6 @@ export LANG=en_US.UTF-8
%python_alternative %{_bindir}/calmjs
%{python_sitelib}/calmjs
%{python_sitelib}/calmjs-%{version}*-nspkg.pth
%{python_sitelib}/calmjs-%{version}*-info
%{python_sitelib}/calmjs-%{version}.dist-info
%changelog

54
support-python-313.patch Normal file
View 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'])