14
0

- Add patches

- factory_tests.patch rename tests_factory to tests so it is
    not recognized by pytest
  - remove_shebang.patch just cleaning superfluous shebang
  - location_testing_script.patch use actual Python executable

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xmlschema?expand=0&rev=21
This commit is contained in:
2020-11-09 19:32:34 +00:00
committed by Git OBS Bridge
parent a646dc083c
commit 89a32e9a2c
5 changed files with 165 additions and 5 deletions

View File

@@ -25,6 +25,15 @@ Summary: An XML Schema validator and decoder
License: MIT
URL: https://github.com/sissaschool/xmlschema
Source: https://files.pythonhosted.org/packages/source/x/xmlschema/xmlschema-%{version}.tar.gz
# PATCH-FIX-UPSTREAM factory_tests.patch gh#sissaschool/xmlschema#210 mcepl@suse.com
# rename tests_factory to factory_tests so it is not discovered by pytest.
Patch0: factory_tests.patch
# PATCH-FIX-UPSTREAM remove_shebang.patch gh#sissaschool/xmlschema#210 mcepl@suse.com
# Remove superfluous shebang
Patch1: remove_shebang.patch
# PATCH-FIX-UPSTREAM location_testing_script.patch gh#sissaschool/xmlschema#210 mcepl@suse.com
# this patch makes things totally awesome
Patch2: location_testing_script.patch
BuildRequires: %{python_module elementpath >= 1.4.0}
BuildRequires: %{python_module lxml}
BuildRequires: %{python_module pip}
@@ -52,8 +61,6 @@ sed -i -e 's:~=:>=:' setup.py
rm tests/check_memory.py
rm tests/test_memory.py
sed -i -e '1s@/usr/bin/env python@/usr/bin/python@' xmlschema/testing/builders.py
%build
export LANG="en_US.UTF8"
%python_build
@@ -71,11 +78,11 @@ done
export LANG="en_US.UTF8"
# test_element_tree_import_script is (easily workaroundable) gh#sissaschool/xmlschema#167
# tests_factory setup is broken
SKIP_TESTS="test_element_tree_import_script or tests_factory"
# SKIP_TESTS="test_element_tree_import_script"
# gh#sissaschool/xmlschema#210
SKIP_TESTS="$SKIP_TESTS or test_imported_element_tree or test_xml_resource_defuse"
SKIP_TESTS="test_imported_element_tree or test_xml_resource_defuse"
SKIP_TESTS="$SKIP_TESTS or test_xml_resource_from_string"
%pytest -k "not ($SKIP_TESTS)" tests
%pytest -s -k "not ($SKIP_TESTS)" tests
%post
%python_install_alternative xmlschema-json2xml