From 6097d35cfb4698dab95c7d5defa98f0b5e664d4a027fe68765d1247d79945cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 17 Jun 2025 09:24:31 +0000 Subject: [PATCH] - Convert to libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-calmjs?expand=0&rev=26 --- .gitattributes | 23 ++++++++++ .gitignore | 1 + 3.4.4.tar.gz | 3 ++ python-calmjs.changes | 98 ++++++++++++++++++++++++++++++++++++++++ python-calmjs.spec | 89 ++++++++++++++++++++++++++++++++++++ support-python-313.patch | 54 ++++++++++++++++++++++ 6 files changed, 268 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 3.4.4.tar.gz create mode 100644 python-calmjs.changes create mode 100644 python-calmjs.spec create mode 100644 support-python-313.patch 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/3.4.4.tar.gz b/3.4.4.tar.gz new file mode 100644 index 0000000..079c4d5 --- /dev/null +++ b/3.4.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0342078dd6717164fe214476b602822fdbf674c0c1ede58630438c3f34d831e6 +size 229746 diff --git a/python-calmjs.changes b/python-calmjs.changes new file mode 100644 index 0000000..9a1f222 --- /dev/null +++ b/python-calmjs.changes @@ -0,0 +1,98 @@ +------------------------------------------------------------------- +Tue Jun 17 09:24:11 UTC 2025 - Markéta Machová + +- Convert to libalternatives + +------------------------------------------------------------------- +Mon Jan 27 16:46:53 UTC 2025 - Markéta Machová + +- Tweak support-python-313.patch to adapt to yet another change + in argparse + +------------------------------------------------------------------- +Tue Jan 7 03:37:22 UTC 2025 - Steve Kowalik + +- Rejig patch support-python-313.patch to also cope with other argparse + changes. + +------------------------------------------------------------------- +Mon Dec 9 03:34:48 UTC 2024 - Steve Kowalik + +- 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 + +- Use sle15_python_module_pythons + +------------------------------------------------------------------- +Sun Apr 16 09:24:02 UTC 2023 - Dirk Müller + +- update to 3.4.4: + * Upgrading to ``setuptools-65.6.0`` and beyond will result in + a new version of ``distutils`` that "fixed" how logging + works, but now the hooks and expected workarounds no + longer work. Given that the deprecation of ``distutils`` + is in the works, no fixes will be done until ``setuptools`` + fully replaces it beyond the release of Python 3.12, + as the author no longer trust Python to provide a + stable platform to develop software on. + Thus, any future "fixes" will only be provided on an + even more reactive (rather than proactive) basis. + +------------------------------------------------------------------- +Thu Mar 2 04:28:45 UTC 2023 - John Vandenberg + +- Update to v3.4.3 + * This is a maintenance release for Python 3.11 + * The registration of subparser of the same name will now be blocked, + rather than cascade to result into a ArgumentError that cannot be + recovered from. + +------------------------------------------------------------------- +Tue Dec 20 17:22:18 UTC 2022 - Daniel Garcia + +- Use pytest to run tests in %check and disable logging tests that fails in + obs. + +------------------------------------------------------------------- +Tue Nov 16 14:18:02 UTC 2021 - Matej Cepl + +- Remove creation of the unnecessary __init__py, which breaks the test + suite (gh#calmjs/calmjs#61). + +------------------------------------------------------------------- +Thu Nov 11 22:29:55 UTC 2021 - Matej Cepl + +- Update to 3.4.2: + - This is a maintenance release for Python 3.10; no substantial + changes were been made. + - Provided a check for disabling integration tests using the + CALMJS_SKIP_INTEGRATION environment variable, when set to a non- + empty string, the integration tests found in test_dist will be + skipped. [ #60 ] +- Fix running of tests (gh#calmjs/calmjs#61). + +------------------------------------------------------------------- +Fri Jan 22 14:00:18 UTC 2021 - Markéta Machová + +- Launch the tests again. + +------------------------------------------------------------------- +Tue Jan 14 15:04:12 UTC 2020 - pgajdos@suse.com + +- fix build in SLE-15: set en_US.UTF-8 encoding +- %check the package + +------------------------------------------------------------------- +Mon Jan 6 15:32:29 UTC 2020 - Tomáš Chvátal + +- Disable tests as getting them to work is too much of a pain + +------------------------------------------------------------------- +Mon Jan 6 14:36:15 UTC 2020 - Tomáš Chvátal + +- Initial commit, needed by django-compressor + diff --git a/python-calmjs.spec b/python-calmjs.spec new file mode 100644 index 0000000..cbc95be --- /dev/null +++ b/python-calmjs.spec @@ -0,0 +1,89 @@ +# +# spec file for package python-calmjs +# +# 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/ +# + + +%bcond_without libalternatives +%{?sle15_python_module_pythons} +Name: python-calmjs +Version: 3.4.4 +Release: 0 +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: python-setuptools +BuildArch: noarch +# SECTION test requirements +BuildRequires: nodejs-common +# /SECTION +%python_subpackages + +%description +A Python framework for building toolchains and utilities for working +with the Node.js ecosystem from within a Python environment. + +%prep +%autosetup -p1 -n calmjs-%{version} +# needs network and npm +rm src/calmjs/tests/test_npm.py +# we don't have yarn binary +rm src/calmjs/tests/test_yarn.py + +%build +export LANG=en_US.UTF-8 +%pyproject_wheel + +%install +export LANG=en_US.UTF-8 +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/calmjs +# see https://github.com/calmjs/calmjs/issues/65 for maintainer feedback +# regarding these two subpackages. +# %%python_expand rm -r %%{buildroot}%%{$python_sitelib}/calmjs/testing +# %%python_expand rm -r %%{buildroot}%%{$python_sitelib}/calmjs/tests +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +export LANG=en_US.UTF-8 +# DistLoggerTestCase is not working correctly in obs build environment +%pytest -v --pyargs calmjs.tests -k 'not DistLoggerTestCase' + +%pre +%python_libalternatives_reset_alternative calmjs + +%files %{python_files} +%license LICENSE +%doc CHANGES.rst +%python_alternative %{_bindir}/calmjs +%{python_sitelib}/calmjs +%{python_sitelib}/calmjs-%{version}*-nspkg.pth +%{python_sitelib}/calmjs-%{version}.dist-info + +%changelog diff --git a/support-python-313.patch b/support-python-313.patch new file mode 100644 index 0000000..dab784a --- /dev/null +++ b/support-python-313.patch @@ -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'])