Drop test data with problematic license status

This commit is contained in:
Benjamin A. Beasley 2022-06-25 12:53:26 -04:00
commit 500fd9ab06
4 changed files with 58 additions and 23 deletions

View file

@ -1,6 +1,3 @@
# Circular dependency on pytest
%bcond_without tests
# Sphinx-generated HTML documentation is not suitable for packaging; see
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
#
@ -12,31 +9,34 @@ Version: 4.0.0
Release: %autorelease
Summary: Python character encoding detector
# The entire source is LGPLv2+, except:
#
# - tests/ascii/howto.diveintomark.org.xml is CC-BY-SA (but is not installed)
# The entire source, after tests/ are filtered, is LGPLv2+. See the comment
# above Source0 for more details on tests/.
#
# See also:
# clarify Trove license classifier
# https://github.com/chardet/chardet/issues/162
# Clarify LGPL version in License trove classifier
# https://github.com/chardet/chardet/pull/255
# clarify Trove license classifier
# https://github.com/chardet/chardet/issues/162
# Clarify LGPL version in License trove classifier
# https://github.com/chardet/chardet/pull/255
License: LGPLv2+
URL: https://github.com/chardet/chardet
Source0: %{pypi_source chardet}
# A filtered source tarball, obtained by (see Source1):
#
# ./get_source %%{version}
#
# is required because the contents of tests/ are under various undocumented
# licenses and are, for the most part, not freely redistributable. See:
#
# problematic licensing of /tests?
# https://github.com/chardet/chardet/issues/231
Source0: chardet-%{version}-filtered.tar.xz
Source1: get_source
# Hand-written for Fedora in groff_man(7) format based on --help output
Source1: chardetect.1
Source2: chardetect.1
BuildArch: noarch
BuildRequires: python3-devel
%if %{with tests}
BuildRequires: python3dist(pytest)
# Optional; enables additional tests (see test.py)
BuildRequires: python3dist(hypothesis)
%endif
%if %{with doc_pdf}
BuildRequires: make
BuildRequires: python3dist(sphinx)
@ -112,13 +112,13 @@ PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}'
%install
%pyproject_install
%pyproject_save_files chardet
install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE1}'
install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE2}'
%if %{with tests}
%check
%pytest -v
%endif
# We cannot run the upstream tests because they would require data files with
# problematic license status.
%pyproject_check_import
%files -n python3-chardet -f %{pyproject_files}