From c6021cccd5e3ab433b91374541905e1b0156085836ba64c12dc12a428ea6a602 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 21 Apr 2023 21:25:12 +0000 Subject: [PATCH] Accepting request 1081486 from home:dirkmueller:acdc:as_python3_module SR for python stack proposal OBS-URL: https://build.opensuse.org/request/show/1081486 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=23 --- python-libcst.changes | 15 +++++++++++++++ python-libcst.spec | 17 +++++------------ replace-python-call.patch | 22 ++++++++++++++++++---- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/python-libcst.changes b/python-libcst.changes index c34efd5..e53989f 100644 --- a/python-libcst.changes +++ b/python-libcst.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Fri Apr 21 12:27:55 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Wed Apr 19 02:01:37 UTC 2023 - Matej Cepl + +- Refresh replace-python-call.patch to make tests working. + +------------------------------------------------------------------- +Thu Apr 13 22:42:28 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + ------------------------------------------------------------------- Wed Dec 14 11:41:04 UTC 2022 - Daniel Garcia diff --git a/python-libcst.spec b/python-libcst.spec index f346cdb..4f8bd3c 100644 --- a/python-libcst.spec +++ b/python-libcst.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,6 +27,7 @@ %bcond_with test %endif %define modname libcst +%{?sle15_python_module_pythons} Name: python-libcst%{psuffix} Version: 0.4.9 Release: 0 @@ -61,7 +62,6 @@ BuildRequires: %{python_module black} BuildRequires: %{python_module dataclasses if %python-base < 3.7} BuildRequires: %{python_module hypothesis >= 4.36.0} BuildRequires: %{python_module hypothesmith >= 0.0.4} -BuildRequires: %{python_module isort >= 5.5.3} BuildRequires: %{python_module typing-inspect >= 0.4.0} BuildRequires: %{python_module typing_extensions >= 3.7.4.2} %endif @@ -90,7 +90,7 @@ rm \ libcst/tests/test_pyre_integration.py # gh#Instagram/LibCST#467 -sed -i 's/import AbstractBaseMatcherNodeMeta/import Optional, AbstractBaseMatcherNodeMeta/' libcst/codegen/gen_matcher_classes.py +sed -i -e 's/import AbstractBaseMatcherNodeMeta/import Optional, AbstractBaseMatcherNodeMeta/' libcst/codegen/gen_matcher_classes.py %if !%{with test} %build @@ -107,15 +107,8 @@ export CARGO_NET_OFFLINE=true PROFILE=release %if %{with test} %check -# test_fuzz needs network access because of 'from hypothesmith import from_grammar' -rm libcst/tests/test_fuzz.py - -%{python_exec # https://github.com/Instagram/LibCST/issues/331 + 467 -$python -m libcst.codegen.generate matchers -$python -m libcst.codegen.generate return_types -$python -m libcst.codegen.generate visitors -$python -m unittest -v -} +%python_exec -m libcst.codegen.generate all +%pyunittest -v %endif %if !%{with test} diff --git a/replace-python-call.patch b/replace-python-call.patch index 181f083..73e8dae 100644 --- a/replace-python-call.patch +++ b/replace-python-call.patch @@ -1,7 +1,21 @@ -Index: libcst-0.4.9/libcst/codemod/tests/test_codemod_cli.py -=================================================================== ---- libcst-0.4.9.orig/libcst/codemod/tests/test_codemod_cli.py -+++ libcst-0.4.9/libcst/codemod/tests/test_codemod_cli.py +--- + libcst/codegen/generate.py | 2 +- + libcst/codemod/tests/test_codemod_cli.py | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/libcst/codegen/generate.py ++++ b/libcst/codegen/generate.py +@@ -69,7 +69,7 @@ def codegen_visitors() -> None: + # by attempting to run codegen again in a new process. + with open(os.devnull, "w") as devnull: + subprocess.check_call( +- ["python3", "-m", "libcst.codegen.gen_visitor_functions"], ++ [sys.executable, "-m", "libcst.codegen.gen_visitor_functions"], + cwd=base, + stdout=devnull, + ) +--- a/libcst/codemod/tests/test_codemod_cli.py ++++ b/libcst/codemod/tests/test_codemod_cli.py @@ -4,7 +4,7 @@ # LICENSE file in the root directory of this source tree. #