15
0

Accepting request 1032583 from home:mcepl:branches:devel:languages:python

Useful tool.

OBS-URL: https://build.opensuse.org/request/show/1032583
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ast-decompiler?expand=0&rev=1
This commit is contained in:
2022-10-31 21:37:50 +00:00
committed by Git OBS Bridge
commit daa92096fd
6 changed files with 159 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

View File

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

68
no-relative-imports.patch Normal file
View File

@@ -0,0 +1,68 @@
---
tests/test_basic.py | 2 +-
tests/test_indentation.py | 2 +-
tests/test_line_length.py | 2 +-
tests/test_literal.py | 2 +-
tests/test_patma.py | 2 +-
tests/test_precedence.py | 2 +-
tests/test_py3_syntax.py | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -1,6 +1,6 @@
import ast
from ast_decompiler import decompile
-from .tests import assert_decompiles, check, only_on_version
+from tests import assert_decompiles, check, only_on_version
def test_non_module() -> None:
--- a/tests/test_indentation.py
+++ b/tests/test_indentation.py
@@ -1,4 +1,4 @@
-from .tests import assert_decompiles
+from tests import assert_decompiles
def test_indentation() -> None:
--- a/tests/test_line_length.py
+++ b/tests/test_line_length.py
@@ -1,4 +1,4 @@
-from .tests import assert_decompiles
+from tests import assert_decompiles
def check_split(original: str, multiline: str, length_reduction: int = 2) -> None:
--- a/tests/test_literal.py
+++ b/tests/test_literal.py
@@ -1,4 +1,4 @@
-from .tests import assert_decompiles, only_on_version
+from tests import assert_decompiles, only_on_version
def test_With() -> None:
--- a/tests/test_patma.py
+++ b/tests/test_patma.py
@@ -1,4 +1,4 @@
-from .tests import check, skip_before
+from tests import check, skip_before
@skip_before((3, 10))
--- a/tests/test_precedence.py
+++ b/tests/test_precedence.py
@@ -1,4 +1,4 @@
-from .tests import check, only_on_version
+from tests import check, only_on_version
def test_Yield() -> None:
--- a/tests/test_py3_syntax.py
+++ b/tests/test_py3_syntax.py
@@ -1,4 +1,4 @@
-from .tests import check, skip_before, skip_after
+from tests import check, skip_before, skip_after
@skip_before((3, 5))

View File

@@ -0,0 +1,6 @@
-------------------------------------------------------------------
Tue Oct 18 12:44:05 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Initial packaging effort for ast-decompiler 0.7.0.
- Add no-relative-imports.patch.txt to make testing work with
plain pytest (gh#JelleZijlstra/ast_decompiler#52).

View File

@@ -0,0 +1,58 @@
#
# spec file for package python-ast_decompiler
#
# Copyright (c) 2022 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/
#
Name: python-ast-decompiler
Version: 0.7.0
Release: 0
Summary: Python module to decompile AST to Python code
License: Apache-2.0
URL: https://github.com/JelleZijlstra/ast_decompiler
Source: https://files.pythonhosted.org/packages/source/a/ast-decompiler/ast_decompiler-%{version}.tar.gz
# PATCH-FIX-UPSTREAM no-relative-imports.patch gh#JelleZijlstra/ast_decompiler#52 mcepl@suse.com
# Fix erroring tests
Patch0: no-relative-imports.patch
BuildRequires: python-rpm-macros
BuildRequires: %{python_module pip}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module flit-core}
BuildRequires: %{python_module pytest}
BuildRequires: fdupes
BuildArch: noarch
%python_subpackages
%description
Python module to decompile AST to Python code
%prep
%autosetup -p1 -n ast_decompiler-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest tests/
%files %{python_files}
%{python_sitelib}/ast_decompiler
%{python_sitelib}/ast_decompiler-%{version}*-info
%changelog