diff --git a/.gitignore b/.gitignore index ed2078b..ea36422 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ /*.src.rpm /tomlkit-0.5.3.tar.gz +/tomlkit-sources-0.5.3.tar.gz + +/toml-test-39bb76d.tar.gz diff --git a/python-tomlkit.spec b/python-tomlkit.spec index b94d70e..456d7d1 100644 --- a/python-tomlkit.spec +++ b/python-tomlkit.spec @@ -1,4 +1,7 @@ %global pypi_name tomlkit +%global tests_name toml-test +%global tests_commit 39bb76d631ba103a94b377aaf52c979456677fb1 +%global tests_shortcommit %(c=%{tests_commit}; echo ${c:0:7}) %{?python_enable_dependency_generator} @@ -18,16 +21,23 @@ Molten.} Name: python-%{pypi_name} Summary: Style preserving TOML library Version: 0.5.3 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: https://github.com/sdispater/tomlkit Source0: %{pypi_source} +# pypi source doesn't have tests +Source1: %{url}/archive/%{version}/%{pypi_name}-sources-%{version}.tar.gz + +# data for unit tests from a separate git submodule +Source2: https://github.com/BurntSushi/%{tests_name}/archive/%{tests_commit}/%{tests_name}-%{tests_shortcommit}.tar.gz + BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(pytest) %description %{common_description} @@ -42,6 +52,16 @@ Summary: %{summary} %prep %autosetup -n %{pypi_name}-%{version} -p1 +# extract unit tests +tar -xzf %{SOURCE1} +cp -rp ./%{pypi_name}-%{version}/tests ./tests +rm -rf ./%{pypi_name}-%{version} + +# extract test data +tar -xzf %{SOURCE2} +cp -rp ./%{tests_name}-%{tests_commit}/tests/ ./tests/toml-test/ +rm -rf ./%{tests_name}-%{tests_commit} + %build %py3_build @@ -51,6 +71,10 @@ Summary: %{summary} %py3_install +%check +%{__python3} -m pytest tests/ + + %files -n python3-%{pypi_name} %license LICENSE %doc README.md @@ -60,6 +84,9 @@ Summary: %{summary} %changelog +* Mon Feb 11 2019 Patrik Kopkan - 0.5.3-3 +- Added check section. + * Sat Feb 02 2019 Fedora Release Engineering - 0.5.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index b4b86bc..b0768da 100644 --- a/sources +++ b/sources @@ -1 +1,3 @@ SHA512 (tomlkit-0.5.3.tar.gz) = 90939b380fb8c58a1825c45740d599f116adf5075b1efb327ceb72353b1d1b3d6d6b960ed7673d46af586fc3ed56a866a6a8eb8dfc2a78ea128b5b7f214b0b55 +SHA512 (tomlkit-sources-0.5.3.tar.gz) = 68f2c2df5bfe0986a8530bb72d35179be974105a11427a59d8d88ea2c1828284ed5518e9fdd90f82ab508e44e63176f7efb78acccc8f4baaa901805979f32c90 +SHA512 (toml-test-39bb76d.tar.gz) = 931ba91b77da576979bde290c99f6cb1a2eeec3aee55b5041b0216094c584934d560487d329df21caa64b405ec50b4dd417dc910bbe4f15b1440686efc58da29