15
0
forked from pool/python-calmjs

- 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
This commit is contained in:
2025-01-28 01:53:55 +00:00
committed by Git OBS Bridge
commit 683f55fc3d
6 changed files with 265 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
3.4.4.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0342078dd6717164fe214476b602822fdbf674c0c1ede58630438c3f34d831e6
size 229746

93
python-calmjs.changes Normal file
View File

@@ -0,0 +1,93 @@
-------------------------------------------------------------------
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>
- Use sle15_python_module_pythons
-------------------------------------------------------------------
Sun Apr 16 09:24:02 UTC 2023 - Dirk Müller <dmueller@suse.com>
- 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 <jayvdb@gmail.com>
- 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 <daniel.garcia@suse.com>
- 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 <mcepl@suse.com>
- 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 <mcepl@suse.com>
- 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á <mmachova@suse.com>
- 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 <tchvatal@suse.com>
- Disable tests as getting them to work is too much of a pain
-------------------------------------------------------------------
Mon Jan 6 14:36:15 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Initial commit, needed by django-compressor

91
python-calmjs.spec Normal file
View File

@@ -0,0 +1,91 @@
#
# 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/
#
%{?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: fdupes
BuildRequires: python-rpm-macros
Requires: python-calmjs.parse >= 1.0.0
Requires: python-calmjs.types
Requires: python-setuptools
Requires(post): update-alternatives
Requires(postun): update-alternatives
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'
%post
%python_install_alternative calmjs
%postun
%python_uninstall_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

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'])