From 6465c41ff25235b9dc0e7e666d45c8c8a5958b7405cf4c62a805a43baf5c6dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 20:07:55 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main python-astor revision abf47049ea80b3b703646ec9661dd9bc --- .gitattributes | 23 ++++++++ astor-0.8.1.tar.gz | 3 + python-astor.changes | 130 +++++++++++++++++++++++++++++++++++++++++++ python-astor.spec | 99 ++++++++++++++++++++++++++++++++ remove_nose.patch | 12 ++++ 5 files changed, 267 insertions(+) create mode 100644 .gitattributes create mode 100644 astor-0.8.1.tar.gz create mode 100644 python-astor.changes create mode 100644 python-astor.spec create mode 100644 remove_nose.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/astor-0.8.1.tar.gz b/astor-0.8.1.tar.gz new file mode 100644 index 0000000..9a4fbfc --- /dev/null +++ b/astor-0.8.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eee1edbf7d58dbc01f0e42fa1a6a1e15470335ec6b82f090dfcf18c10d27c89c +size 41340 diff --git a/python-astor.changes b/python-astor.changes new file mode 100644 index 0000000..2079286 --- /dev/null +++ b/python-astor.changes @@ -0,0 +1,130 @@ +------------------------------------------------------------------- +Thu Sep 28 12:10:03 UTC 2023 - Daniel Garcia + +- Skip same tests for python-3.12 + +------------------------------------------------------------------- +Fri Apr 21 12:22:08 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:40:03 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Tue Jan 10 09:47:36 UTC 2023 - Daniel Garcia + +- Skip same tests for python-3.11 + +------------------------------------------------------------------- +Mon Sep 12 11:52:11 UTC 2022 - Markéta Machová + +- Skip test_huge_int due to new security feature in Python + * https://github.com/python/cpython/issues/95778 + +------------------------------------------------------------------- +Sun Dec 12 18:45:55 UTC 2021 - Ben Greiner + +- Also skip convert_stdlib in python310: still not fixed + +------------------------------------------------------------------- +Fri Mar 19 19:13:12 UTC 2021 - Ben Greiner + +- Skip failing stdlib roundtrip test on python39 + gh#berkerpeksag/astor#196 + +------------------------------------------------------------------- +Mon Jun 1 09:54:30 UTC 2020 - Tomáš Chvátal + +- Remove patch remove_unittest2.patch as we use pytest to load + stuff it is no longer really needed + +------------------------------------------------------------------- +Fri May 29 12:49:31 UTC 2020 - pgajdos@suse.com + +- for python3, drop dependency on unittest2 +- added patches + + remove_unittest2.patch + +------------------------------------------------------------------- +Fri Apr 3 21:34:35 UTC 2020 - Marcus Rueckert + +- remove the shebang line from the rtrip.py otherwise the python3 + package will require /usr/bin/python. + +------------------------------------------------------------------- +Wed Mar 25 15:11:49 UTC 2020 - Paolo Stivanin + +- Add remove_nose.patch + * test suite runs fine without nose, because it was written for unittest2 + and, because nose won't work with Python 3.9/3.10, this patch removes + the requirement from setup.cfg and use unittest2 in the spec file + instead of nose + +------------------------------------------------------------------- +Fri Jan 17 12:59:09 UTC 2020 - Marketa Calabkova + +- update to 0.8.1 + * Create sdist before making a test release too + * remove expr_text handler from fstrings +- Drop obsolete python38.patch and setuptools-gt-41_1.patch + +------------------------------------------------------------------- +Thu Nov 14 14:30:21 CET 2019 - Matej Cepl + +- Add patch to build with setuptools >= 41.4: + * setuptools-gt-41_1.patch + +------------------------------------------------------------------- +Tue Sep 10 13:45:54 UTC 2019 - Tomáš Chvátal + +- Add patch to build with py 3.8: + * python38.patch + +------------------------------------------------------------------- +Mon Jun 3 08:18:07 UTC 2019 - pgajdos@suse.com + +- version update to 0.8 + * Support ``ast.Constant`` nodes being emitted by Python 3.8 (and initially + created in Python 3.6). + (Reported and fixed by Chris Rink in `Issue 120`_ and `PR 121`_.) + * Support Python 3.8's assignment expressions. + (Reported and fixed by Kodi Arfer in `Issue 126`_ and `PR 134`_.) + * Support Python 3.8's f-string debugging syntax. + (Reported and fixed by Batuhan Taskaya in `Issue 138`_ and `PR 139`_.) + * :func:`astor.to_source` now has a *source_generator_class* parameter to + customize source code generation. + (Reported and fixed by matham in `Issue 113`_ and `PR 114`_.) + * The :class:`~SourceGenerator` class can now be imported from the + :mod:`astor` package directly. Previously, the ``astor.code_gen`` + submodule was needed to be imported. + * Support Python 3.8's positional only arguments. See :pep:`570` for + more details. + (Reported and fixed by Batuhan Taskaya in `Issue 142`_ and `PR 143`_.) + * bug fixes, see changelog.rst +- run the testsuite + +------------------------------------------------------------------- +Fri Nov 9 12:03:52 UTC 2018 - Petr Cervinka + +- Removed copied link reference from spec file + +------------------------------------------------------------------- +Fri Nov 9 10:27:55 UTC 2018 - cgoll@suse.com + +- fixed rpmlint warnings + +------------------------------------------------------------------- +Thu Nov 8 14:04:28 UTC 2018 - cgoll@suse.com + +- removed not needed module devel + * removed check section + * using license macro + +------------------------------------------------------------------- +Wed Jul 25 08:13:46 UTC 2018 - cgoll@suse.com + +- initial commit of astor 0.7.1 for python2 and python3 + * skipped check section, as this was faling diff --git a/python-astor.spec b/python-astor.spec new file mode 100644 index 0000000..42507b5 --- /dev/null +++ b/python-astor.spec @@ -0,0 +1,99 @@ +# +# spec file for package python-astor +# +# 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 +# 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 python2 +%{?sle15_python_module_pythons} +Name: python-astor +Version: 0.8.1 +Release: 0 +Summary: Read/rewrite/write Python ASTs +License: BSD-3-Clause +Group: Development/Languages/Python +URL: https://github.com/berkerpeksag/astor +Source: https://github.com/berkerpeksag/astor/archive/%{version}.tar.gz#/astor-%{version}.tar.gz +# https://github.com/berkerpeksag/astor/pull/177 +Patch0: remove_nose.patch +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module pytest} +%if %{with python2} +# The tests use it internally, even when called from pytest-2 +BuildRequires: python-unittest2 +%endif +# /SECTION +%python_subpackages + +%description +astor is designed to allow easy manipulation of Python source via the AST. +There are some other similar libraries, but astor focuses on the following areas: +- Round-trip an AST back to Python: + - Modified AST doesn't need linenumbers, ctx, etc. or otherwise + be directly compileable for the round-trip to work. + - Easy to read generated code as, well, code + - Can round-trip two different source trees to compare for functional + differences, using the astor.rtrip tool (for example, after PEP8 edits). +- Dump pretty-printing of AST + - Harder to read than round-tripped code, but more accurate to figure out what + is going on. + - Easier to read than dump from built-in AST module +- Non-recursive treewalk + - Sometimes you want a recursive treewalk (and astor supports that, starting + at any node on the tree), but sometimes you don't need to do that. astor + doesn't require you to explicitly visit sub-nodes unless you want to: + - You can add code that executes before a node's children are visited, and/or + - You can add code that executes after a node's children are visited, and/or + - You can add code that executes and keeps the node's children from being + visited (and optionally visit them yourself via a recursive call) + - Write functions to access the tree based on object names and/or attribute names + - Enjoy easy access to parent node(s) for tree rewriting + +%prep +%autosetup -p1 -n astor-%{version} + +%build +# ugly fix for the use of /usr/bin/env +sed -i 's@#!.*@@' astor/rtrip.py +chmod a-x astor/rtrip.py +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} +# fix executeable bits +%python_expand chmod 755 %{buildroot}%{$python_sitelib}/astor/rtrip.py + +%check +# https://github.com/berkerpeksag/astor/issues/212 +python38_donttest="test_huge_int" +# https://github.com/berkerpeksag/astor/issues/196 +python39_donttest="${python38_donttest} or test_convert_stdlib" +python310_donttest=${python39_donttest} +python311_donttest=${python310_donttest} +python312_donttest=${python311_donttest} +%pytest tests ${$python_donttest:+ -k "not (${$python_donttest})"} + +%files %{python_files} +%doc AUTHORS README.rst docs/*.rst +%license LICENSE +%{python_sitelib}/astor +%{python_sitelib}/astor-%{version}*-info + +%changelog diff --git a/remove_nose.patch b/remove_nose.patch new file mode 100644 index 0000000..928dcc4 --- /dev/null +++ b/remove_nose.patch @@ -0,0 +1,12 @@ +--- a/setup.cfg.orig 2020-03-25 16:06:14.496510596 +0100 ++++ b/setup.cfg 2020-03-25 16:08:28.672752421 +0100 +@@ -35,8 +35,7 @@ + include_package_data = True + packages = find: + python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +-tests_requires = ["nose", "astunparse"] +-test_suite = nose.collector ++tests_requires = ["astunparse"] + + [options.packages.find] + exclude = tests