diff --git a/.gitignore b/.gitignore index 479004f..9b1020d 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ /pyp2rpm-3.1.1-tests.tgz /pyp2rpm-3.1.2.tar.gz /pyp2rpm-3.1.3.tar.gz +/pyp2rpm-3.2.0.tar.gz +/pyp2rpm-3.2.1.tar.gz diff --git a/add_mybin.patch b/add_mybin.patch new file mode 100644 index 0000000..4eb110f --- /dev/null +++ b/add_mybin.patch @@ -0,0 +1,11 @@ +diff --git a/mybin.py b/mybin.py +new file mode 100755 +index 0000000..d5c5dea +--- /dev/null ++++ b/mybin.py +@@ -0,0 +1,4 @@ ++#!/usr/bin/env python3 ++# -*- coding: utf-8 -*- ++from pyp2rpm.bin import main ++ ++main() diff --git a/archive_encoding.patch b/archive_encoding.patch index 269fbe1..7e65f83 100644 --- a/archive_encoding.patch +++ b/archive_encoding.patch @@ -1,5 +1,5 @@ diff --git a/pyp2rpm/archive.py b/pyp2rpm/archive.py -index 49d6bef..fab45a8 100644 +index 24606e0..0971ca9 100644 --- a/pyp2rpm/archive.py +++ b/pyp2rpm/archive.py @@ -152,7 +152,7 @@ class Archive(object): diff --git a/no-venv-testfix.patch b/no-venv-testfix.patch deleted file mode 100644 index 247a20d..0000000 --- a/no-venv-testfix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/tests/test_metadata_extractors.py b/tests/test_metadata_extractors.py -index 34c5226..8fc75f4 100644 ---- a/tests/test_metadata_extractors.py -+++ b/tests/test_metadata_extractors.py -@@ -338,7 +338,7 @@ class TestDistMetadataExtractor(object): - (2, 'py_modules', ['pytest']), - (2, 'packages', set(['_pytest'])), - (3, 'py_modules', ['simpleeval']), -- (3, 'packages', set()) -+ (3, 'packages', 'TODO:') - ]) - def test_extract(self, i, what, expected): - data = self.e[i].extract_data() diff --git a/pyp2rpm.spec b/pyp2rpm.spec index b6e3a74..5e6af13 100644 --- a/pyp2rpm.spec +++ b/pyp2rpm.spec @@ -2,7 +2,7 @@ %global pypi_name pyp2rpm Name: %{pypi_name} -Version: 3.1.3 +Version: 3.2.1 Release: 1%{?dist} Summary: Convert Python packages to RPM SPECFILES @@ -14,20 +14,25 @@ Source0: http://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{p Patch0: remove_pytest-runner.patch # Fixes encoding in koji builds Patch1: archive_encoding.patch -# Fixes metadata extraction tests when virtualenv is disabled -Patch2: no-venv-testfix.patch +# Adds mybin.py script to toplevel for the purpose of integration tests +Patch2: add_mybin.patch +# Correct binary path in integration_test, add marker for specfile diff tests and remove +# virtualenv dependent test. +Patch3: test_fix.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-setuptools -BuildRequires: python3-pytest -BuildRequires: python3-flexmock >= 0.9.3 BuildRequires: python3-virtualenv-api BuildRequires: python3-jinja2 BuildRequires: python3-click BuildRequires: python3-virtualenv BuildRequires: python2-virtualenv + +BuildRequires: python3-pytest +BuildRequires: python3-flexmock >= 0.9.3 +BuildRequires: python3-scripttest Requires: python3-jinja2 Requires: python3-setuptools @@ -54,17 +59,21 @@ rm -rf %{pypi_name}.egg-info %py3_install %check -PYTHONPATH="." py.test-3 -m "not webtest" +PYTHONPATH="." py.test-3 -vv -m "not (webtest or spectest)" %files %license LICENSE %doc README.md %{_bindir}/pyp2rpm %{python3_sitelib}/%{pypi_name} +%{python3_sitelib}/command %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %changelog +* Thu Oct 13 2016 Michal Cyprian - 3.2.0-1 +- Update to 3.2.1 + * Wed Aug 10 2016 Michal Cyprian - 3.1.3-1 - Update to 3.1.3 diff --git a/remove_pytest-runner.patch b/remove_pytest-runner.patch index e04b5c2..f849fcf 100644 --- a/remove_pytest-runner.patch +++ b/remove_pytest-runner.patch @@ -1,12 +1,12 @@ diff --git a/setup.py b/setup.py -index 0a29364..33bb01b 100644 +index 3bd3b39..4ffd846 100644 --- a/setup.py +++ b/setup.py -@@ -34,7 +34,6 @@ setup( +@@ -33,7 +33,6 @@ setup( ], setup_requires=['setuptools', 'flexmock >= 0.9.3', - 'pytest-runner', + 'click', + 'Jinja2', ], - tests_require=['pytest'], - extras_require = { diff --git a/sources b/sources index 66c8fbc..f74dd2f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dfe92228578b699dbad4868fe12e49ae pyp2rpm-3.1.3.tar.gz +05587a058ac4b0ba2e52125d9afa0f15 pyp2rpm-3.2.1.tar.gz diff --git a/test_fix.patch b/test_fix.patch new file mode 100644 index 0000000..c1f619a --- /dev/null +++ b/test_fix.patch @@ -0,0 +1,51 @@ +diff --git a/MANIFEST.in b/MANIFEST.in +index f6c42b1..844bd37 100644 +--- a/MANIFEST.in ++++ b/MANIFEST.in +@@ -6,3 +6,4 @@ include tests/*.py + include tests/test_data/*.spec *.gz *.whl *.zip *.egg + include tests/test_data/LICENSE + include pyp2rpm.1 ++include mybin.py +diff --git a/tests/test_integration.py b/tests/test_integration.py +index fe410d1..16fe376 100644 +--- a/tests/test_integration.py ++++ b/tests/test_integration.py +@@ -10,7 +10,7 @@ tests_dir = os.path.split(os.path.abspath(__file__))[0] + class TestSpec(object): + td_dir = '{0}/test_data/'.format(tests_dir) + bin_dir = os.path.split(tests_dir)[0] + '/' +- exe = 'python {0}mybin.py'.format(bin_dir) ++ exe = 'python3 {0}mybin.py'.format(bin_dir) + + def setup_method(self, method): + self.env = TestFileEnvironment('{0}/test_output/'.format(tests_dir)) +@@ -22,6 +22,7 @@ class TestSpec(object): + ('Jinja2', '-t epel6', 'python-Jinja2_epel6.spec'), + ('buildkit', '-b2', 'python-buildkit.spec'), + ]) ++ @pytest.mark.spectest + def test_spec(self, package, options, expected): + with open(self.td_dir + expected) as fi: + self.spec_content = fi.read() +@@ -33,7 +34,7 @@ class TestSpec(object): + class TestSrpm(object): + td_dir = '{0}/test_data/'.format(tests_dir) + bin_dir = os.path.split(tests_dir)[0] + '/' +- exe = 'python {0}mybin.py'.format(bin_dir) ++ exe = 'python3 {0}mybin.py'.format(bin_dir) + + def setup_method(self, method): + self.env = TestFileEnvironment('{0}/test_output/'.format(tests_dir)) +diff --git a/tests/test_metadata_extractors.py b/tests/test_metadata_extractors.py +index 55eb619..bf9453e 100644 +--- a/tests/test_metadata_extractors.py ++++ b/tests/test_metadata_extractors.py +@@ -262,7 +262,6 @@ class TestSetupPyMetadataExtractor(object): + ['BuildRequires', 'python-sphinx']]), + (1, 'py_modules', set(['pytest'])), + (1, 'packages', set(['_pytest'])), +- (1, 'scripts', set(['py.test', 'pytest'])), + (1, 'home_page', 'http://pytest.org'), + (1, 'summary', 'py.test: simple powerful testing with Python'), + (1, 'license', 'MIT license'),