From 3ceb3023e12753d70e5faded71f2d9d15b0330ea5dc933b2127de3cd122891a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 22 Aug 2018 07:32:12 +0000 Subject: [PATCH] - Do not copy around but use PYTHONPATH to find the module OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyodbc?expand=0&rev=2 --- python-pyodbc.changes | 6 ++++- python-pyodbc.spec | 52 ++++++++++++++++++++++++++----------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/python-pyodbc.changes b/python-pyodbc.changes index f123dcb..290a0d9 100644 --- a/python-pyodbc.changes +++ b/python-pyodbc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 22 07:31:31 UTC 2018 - tchvatal@suse.com + +- Do not copy around but use PYTHONPATH to find the module + ------------------------------------------------------------------- Sun Aug 19 09:54:09 UTC 2018 - monex@liquid-co.de @@ -10,7 +15,6 @@ Thu Aug 9 18:39:28 UTC 2018 - monex@liquid-co.de Unfortunaly the test cases are broken at the moment a bug report was created at github. - ------------------------------------------------------------------- Sun Aug 5 17:44:33 UTC 2018 - monex@liquid-co.de diff --git a/python-pyodbc.spec b/python-pyodbc.spec index b71771e..6eb83e7 100644 --- a/python-pyodbc.spec +++ b/python-pyodbc.spec @@ -1,52 +1,62 @@ # # spec file for package python-pyodbc # +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# +# 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 http://bugs.opensuse.org/ +# + %{?!python_module:%define python_module() python-%{**} python3-%{**}} - Name: python-pyodbc Version: 4.0.24 Release: 0 -Url: https://github.com/mkleehammer/pyodbc Summary: Python ODBC API License: MIT Group: Development/Languages/Python +URL: https://github.com/mkleehammer/pyodbc Source: https://files.pythonhosted.org/packages/source/p/pyodbc/pyodbc-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: %{python_module devel} -BuildRequires: unixODBC-devel +BuildRequires: %{python_module setuptools} BuildRequires: gcc-c++ BuildRequires: python-rpm-macros BuildRequires: sqliteodbc - +BuildRequires: unixODBC-devel %python_subpackages - + %description -pyodbc is a Python 2.x and 3.x module that allows you to use ODBC +pyodbc is a Python 2.x and 3.x module that allows you to use ODBC to connect to almost any database from Windows, Linux, OS/X, and more. -It implements the Python Database API Specification v2.0, but additional features -have been added to simplify database programming even more. - +It implements the Python Database API Specification v2.0, but additional features +have been added to simplify database programming even more. + %prep %setup -q -n pyodbc-%{version} - + %build %python_build - + %install %python_install %check -python3 tests3/sqlitetests.py -v "Driver=SQLITE3;Database=sqlite.db" -mv build/ _build.python3/ && mv _build.python2/ build/ -python2 tests2/sqlitetests.py -v "Driver=SQLITE3;Database=sqlite.db" -mv build/ _build.python2/ && mv _build.python3/ build/ - -%files %python_files -%defattr(-,root,root,-) +export PYTHONDONTWRITEBYTECODE=1 +PYTHONPATH=%{buildroot}%{python3_sitearch} python3 tests3/sqlitetests.py -v "Driver=SQLITE3;Database=sqlite.db" +PYTHONPATH=%{buildroot}%{python2_sitearch} python2 tests2/sqlitetests.py -v "Driver=SQLITE3;Database=sqlite.db" + +%files %{python_files} %{python_sitearch}/* -%license LICENSE.txt +%license LICENSE.txt %doc README.md - + %changelog