From a3229ec511d14e2b14f6ec6d7edc1cebbb5568dbc21d9f06e6dca6305295e357 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Thu, 2 Mar 2017 14:38:21 +0000 Subject: [PATCH 1/4] osc copypac from project:devel:languages:python:singlespec package:python-setuptools_scm revision:2, using expand OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools_scm?expand=0&rev=12 --- python-setuptools_scm.spec | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/python-setuptools_scm.spec b/python-setuptools_scm.spec index c6a2f2f..33185d9 100644 --- a/python-setuptools_scm.spec +++ b/python-setuptools_scm.spec @@ -15,7 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-setuptools_scm Version: 1.15.0 Release: 0 @@ -23,22 +23,21 @@ Summary: Manage your versions by scm tags License: MIT Group: Development/Languages/Python Url: https://github.com/pypa/setuptools_scm -Source: https://pypi.io/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz -BuildRequires: python-devel -BuildRequires: python-setuptools +Source: https://file.pythonhosted.org/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz +BuildRequires: python-rpm-macros +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} # Testing requirements BuildRequires: git BuildRequires: mercurial -BuildRequires: python-pytest -Requires: python-setuptools +BuildRequires: %{python_module pytest} +Requires: %{python_module setuptools} Recommends: git Recommends: mecurial BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else BuildArch: noarch -%endif + +%python_subpackages %description The setuptools_scm package handles managing your python package versions @@ -48,15 +47,15 @@ in scm metadata. It also handles file finders for the supperted scm's. %setup -q -n setuptools_scm-%{version} %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install %check -PYTHONPATH=%{buildroot}%{python_sitelib} py.test +%python_expand PYTHONPATH=%{buildroot}%{python_sitelib} py.test-%{python_version} -%files +%files %python_files %defattr(-,root,root,-) %doc README.rst LICENSE CHANGELOG.rst %{python_sitelib}/* From baa64cea0c24274ceb5318a8e92711398b60961702daf9683be04e9779dc54ed Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Thu, 2 Mar 2017 14:49:06 +0000 Subject: [PATCH 2/4] - Fix python_module macro definition OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools_scm?expand=0&rev=13 --- python-setuptools_scm.changes | 5 +++++ python-setuptools_scm.spec | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python-setuptools_scm.changes b/python-setuptools_scm.changes index 4b1cc54..7ef7369 100644 --- a/python-setuptools_scm.changes +++ b/python-setuptools_scm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Mar 2 14:48:44 UTC 2017 - tbechtold@suse.com + +- Fix python_module macro definition + ------------------------------------------------------------------- Wed Jan 18 14:19:15 UTC 2017 - michael@stroeder.com diff --git a/python-setuptools_scm.spec b/python-setuptools_scm.spec index 33185d9..03cbe10 100644 --- a/python-setuptools_scm.spec +++ b/python-setuptools_scm.spec @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-setuptools_scm Version: 1.15.0 @@ -24,13 +25,13 @@ License: MIT Group: Development/Languages/Python Url: https://github.com/pypa/setuptools_scm Source: https://file.pythonhosted.org/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz -BuildRequires: python-rpm-macros BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} +BuildRequires: python-rpm-macros # Testing requirements +BuildRequires: %{python_module pytest} BuildRequires: git BuildRequires: mercurial -BuildRequires: %{python_module pytest} Requires: %{python_module setuptools} Recommends: git Recommends: mecurial From 21cda41ebac381185c85e9cfde5a029cf7eaa673e804f666b491a3f2f6123a2b Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Thu, 2 Mar 2017 15:07:15 +0000 Subject: [PATCH 3/4] - Fix Source url OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools_scm?expand=0&rev=14 --- python-setuptools_scm.changes | 5 +++++ python-setuptools_scm.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python-setuptools_scm.changes b/python-setuptools_scm.changes index 7ef7369..20c9790 100644 --- a/python-setuptools_scm.changes +++ b/python-setuptools_scm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Mar 2 15:06:07 UTC 2017 - tbechtold@suse.com + +- Fix Source url + ------------------------------------------------------------------- Thu Mar 2 14:48:44 UTC 2017 - tbechtold@suse.com diff --git a/python-setuptools_scm.spec b/python-setuptools_scm.spec index 03cbe10..7cc70d0 100644 --- a/python-setuptools_scm.spec +++ b/python-setuptools_scm.spec @@ -24,7 +24,7 @@ Summary: Manage your versions by scm tags License: MIT Group: Development/Languages/Python Url: https://github.com/pypa/setuptools_scm -Source: https://file.pythonhosted.org/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz +Source: https://files.pythonhosted.org/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros From 086506b4288e0ed7d1b8a9160c6cd3ad0740796248f07e51101869f0e52e8488 Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Fri, 3 Mar 2017 17:12:33 +0000 Subject: [PATCH 4/4] - fix singlespec build - no-generic-python.patch - run tests with the right python executable to prevent stray pyc files where they don't belong OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools_scm?expand=0&rev=15 --- no-generic-python.patch | 33 +++++++++++++++++++++++++++++++++ python-setuptools_scm.changes | 7 +++++++ python-setuptools_scm.spec | 7 +++++-- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 no-generic-python.patch diff --git a/no-generic-python.patch b/no-generic-python.patch new file mode 100644 index 0000000..c4d3597 --- /dev/null +++ b/no-generic-python.patch @@ -0,0 +1,33 @@ +diff --git a/testing/test_regressions.py b/testing/test_regressions.py +index 4a067b3..9d24d61 100644 +--- a/testing/test_regressions.py ++++ b/testing/test_regressions.py +@@ -18,16 +18,16 @@ def test_pkginfo_noscmroot(tmpdir, monkeypatch): + 'from setuptools import setup;' + 'setup(use_scm_version={"root": ".."})') + +- _, stderr, ret = do_ex('python setup.py --version', p) ++ _, stderr, ret = do_ex((sys.executable, 'setup.py', '--version'), p) + assert 'setuptools-scm was unable to detect version for' in stderr + assert ret == 1 + + p.join("PKG-INFO").write('Version: 1.0') +- res = do('python setup.py --version', p) ++ res = do((sys.executable, 'setup.py', '--version'), p) + assert res == '1.0' + + do('git init', p.dirpath()) +- res = do('python setup.py --version', p) ++ res = do((sys.executable, 'setup.py', '--version'), p) + assert res == '1.0' + + +@@ -64,7 +64,7 @@ setup(use_scm_version=vcfg) + ''') + p.join("PKG-INFO").write('Version: 1.0') + +- res = do('python setup.py --version', p) ++ res = do((sys.executable, 'setup.py', '--version'), p) + assert res == '1.0' + + diff --git a/python-setuptools_scm.changes b/python-setuptools_scm.changes index 20c9790..a3ef1bf 100644 --- a/python-setuptools_scm.changes +++ b/python-setuptools_scm.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Mar 3 15:24:56 UTC 2017 - jmatejek@suse.com + +- fix singlespec build +- no-generic-python.patch - run tests with the right python executable + to prevent stray pyc files where they don't belong + ------------------------------------------------------------------- Thu Mar 2 15:06:07 UTC 2017 - tbechtold@suse.com diff --git a/python-setuptools_scm.spec b/python-setuptools_scm.spec index 7cc70d0..c88adae 100644 --- a/python-setuptools_scm.spec +++ b/python-setuptools_scm.spec @@ -25,6 +25,8 @@ License: MIT Group: Development/Languages/Python Url: https://github.com/pypa/setuptools_scm Source: https://files.pythonhosted.org/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz +# PATCH-FIX-UPSTREAM use sys.executable for running python in test_regressions.py +Patch0: no-generic-python.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros @@ -32,7 +34,7 @@ BuildRequires: python-rpm-macros BuildRequires: %{python_module pytest} BuildRequires: git BuildRequires: mercurial -Requires: %{python_module setuptools} +Requires: python-setuptools Recommends: git Recommends: mecurial BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -46,6 +48,7 @@ in scm metadata. It also handles file finders for the supperted scm's. %prep %setup -q -n setuptools_scm-%{version} +%patch0 -p1 %build %python_build @@ -54,7 +57,7 @@ in scm metadata. It also handles file finders for the supperted scm's. %python_install %check -%python_expand PYTHONPATH=%{buildroot}%{python_sitelib} py.test-%{python_version} +%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} %files %python_files %defattr(-,root,root,-)