Run tests (require six + upstream patch)

This commit is contained in:
Miro Hrončok 2018-06-12 13:46:56 +02:00
parent d29e6e08f8
commit 8a0b79b537
2 changed files with 37 additions and 6 deletions

24
lesscpy-fix-test.patch Normal file
View File

@ -0,0 +1,24 @@
From 964905dc09406a55097d9c644b45bbec6944170a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 12 Jun 2018 13:43:47 +0200
Subject: [PATCH] Allow to run tests from versioned folder
If I download and unpack lesscpy-0.13.0 the tests from within
were failing, because the 0.13.0 got split. this fixes it.
---
test/core.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/core.py b/test/core.py
index 438ec54..63e3689 100644
--- a/test/core.py
+++ b/test/core.py
@@ -24,7 +24,7 @@ def find_and_load_cases(cls, less_dir, css_dir, less_files=None, css_minimized=T
else:
LESS = glob.glob(os.path.join(_less_path, '*.less'))
for less in LESS:
- lessf = less.split('.')[0].split('/')[-1]
+ lessf = less.rpartition('.')[0].split('/')[-1]
css = os.path.join(_css_path, lessf + '.css')
if css_minimized:
mincss = os.path.join(_css_path, lessf + '.min.css')

View File

@ -15,6 +15,9 @@ Summary: Lesscss compiler
License: MIT
URL: https://github.com/robotis/lesscpy
Source0: https://pypi.python.org/packages/source/l/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
Patch0: https://github.com/lesscpy/lesscpy/pull/99.patch#/%{pypi_name}-fix-test.patch
BuildArch: noarch
%global _description\
@ -29,12 +32,14 @@ supported (JavaScript evaluation).
%package -n python2-lesscpy
Summary: %summary
Requires: python2-ply
Requires: python2-six
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-ply
BuildRequires: python2-nose
BuildRequires: python2-coverage
BuildRequires: python2-flake8
BuildRequires: python2-six
%{?python_provide:%python_provide python2-lesscpy}
%description -n python2-lesscpy %_description
@ -43,12 +48,14 @@ BuildRequires: python2-flake8
%package -n python3-lesscpy
Summary: %summary
Requires: python3-ply
Requires: python3-six
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-ply
BuildRequires: python3-nose
BuildRequires: python3-flake8
BuildRequires: python3-coverage
BuildRequires: python3-six
%{?python_provide:%python_provide python3-lesscpy}
%description -n python3-lesscpy
@ -58,7 +65,7 @@ of lesscss are supported (yet). Some features wil probably never be
supported (JavaScript evaluation).
%prep
%setup -q -n %{pypi_name}-%{version}
%autosetup -p1 -n %{pypi_name}-%{version}
%build
%if %{with python2}
@ -79,11 +86,11 @@ rm %{buildroot}/%{_bindir}/lesscpy
ln -s ./lesscpy %{buildroot}/%{_bindir}/py3-lesscpy
#%check
#%%if %{with python2}
#nosetests -v
#%%endif # with python2
#nosetests-3.3 -v
%check
%if %{with python2}
%{__python2} -m nose -v
%endif # with python2
%{__python3} -m nose -v
%if %{with python2}
%files -n python2-lesscpy