14
0

Accepting request 835984 from devel:languages:python

- update to 0.2.1:
  * readme conversion to markdown
  * pytest and readme updates
  * code formatting improvements
- remove remove_nose.patch (upstream)

OBS-URL: https://build.opensuse.org/request/show/835984
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-entrypoint2?expand=0&rev=16
This commit is contained in:
2020-10-29 08:45:48 +00:00
committed by Git OBS Bridge
5 changed files with 15 additions and 253 deletions

3
entrypoint2-0.2.1.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:47c33bb69abeda85e3f2a8b49e75e6eeba530afddcb9eecea477ed3f881ea56a
size 11396

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a49b160c452914b830135201e6db466c6bb39759ccd0c301cbb7943ab57802fd
size 12459

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Sep 17 11:06:16 UTC 2020 - Dirk Mueller <dmueller@suse.com>
- update to 0.2.1:
* readme conversion to markdown
* pytest and readme updates
* code formatting improvements
- remove remove_nose.patch (upstream)
-------------------------------------------------------------------
Fri Aug 14 14:07:27 UTC 2020 - John Vandenberg <jayvdb@gmail.com>

View File

@@ -26,15 +26,13 @@
%bcond_with test
%endif
Name: python-entrypoint2
Version: 0.2
Version: 0.2.1
Release: 0
Summary: Command-line interface for python modules
License: BSD-2-Clause
Group: Development/Languages/Python
URL: https://github.com/ponty/entrypoint2
Source: https://github.com/ponty/entrypoint2/archive/%{version}.tar.gz#/entrypoint2-%{version}.tar.gz
# https://github.com/ponty/entrypoint2/pull/6
Patch0: remove_nose.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -57,7 +55,6 @@ off entrypoint.
%prep
%setup -q -n entrypoint2-%{version}
%patch0 -p1
# argparse is py2.6 or older
sed -i -e '/argparse/d' requirements.txt
@@ -74,13 +71,13 @@ sed -i -e '/argparse/d' requirements.txt
%if %{with test}
%check
%pytest tests/test.py
%pytest tests/test_all.py
%endif
%if !%{with test}
%files %{python_files}
%license LICENSE.txt
%doc README.rst
%doc README.md
%{python_sitelib}/*
%endif

View File

@@ -1,244 +0,0 @@
diff -ru a/requirements-test.txt b/requirements-test.txt
--- a/requirements-test.txt 2020-03-27 14:00:49.587654335 +0100
+++ b/requirements-test.txt 2020-03-27 14:01:04.815678385 +0100
@@ -1,5 +1,4 @@
tox
-nose
coverage
path.py
easyprocess
\ No newline at end of file
diff -ru a/setup.py b/setup.py
--- a/setup.py 2020-03-27 14:00:49.587654335 +0100
+++ b/setup.py 2020-03-27 14:01:04.815678385 +0100
@@ -56,7 +56,6 @@
license='BSD',
packages=PACKAGES,
# include_package_data=True,
- # test_suite='nose.collector',
# zip_safe=False,
install_requires=install_requires,
# **extra
Only in entrypoint2-0.2: setup.py.orig
diff -ru a/tests/test.py b/tests/test.py
--- a/tests/test.py 2020-03-27 14:00:49.587654335 +0100
+++ b/tests/test.py 2020-03-27 14:01:08.703684524 +0100
@@ -1,5 +1,4 @@
from easyprocess import EasyProcess
-from nose.tools import eq_, ok_
from path import Path
import sys
@@ -13,133 +12,138 @@
PY3 = sys.version_info[0] >= 3
+def ported_eq(a, b, msg=None):
+ if not a == b:
+ raise AssertionError(msg or "%r != %r" % (a, b))
+
+
def test_1_call():
import example1
- eq_(example1.f(3), 3)
- eq_('description' in example1.f.__doc__, True)
- eq_(example1.f.__name__, 'f')
+ ported_eq(example1.f(3), 3)
+ ported_eq('description' in example1.f.__doc__, True)
+ ported_eq(example1.f.__name__, 'f')
def test_2_call():
import example2
- eq_(example2.f(5, 1), 6)
- eq_(example2.f.__doc__, None)
- eq_(example2.f.__name__, 'f')
+ ported_eq(example2.f(5, 1), 6)
+ ported_eq(example2.f.__doc__, None)
+ ported_eq(example2.f.__name__, 'f')
def test_3_call():
import example3
- eq_(example3.f(), 7)
- eq_(example3.f.__doc__, None)
- eq_(example3.f.__name__, 'f')
+ ported_eq(example3.f(), 7)
+ ported_eq(example3.f.__doc__, None)
+ ported_eq(example3.f.__name__, 'f')
def test_1_cli():
cmd = [python, example1_py, '5']
p = EasyProcess(cmd).call()
- eq_(p.return_code, 0)
- eq_(p.stdout, '')
- eq_(p.stderr, '')
+ ported_eq(p.return_code, 0)
+ ported_eq(p.stdout, '')
+ ported_eq(p.stderr, '')
cmd = [python, example1_py, '5', '--two', '7', '--debug']
p = EasyProcess(cmd).call()
- eq_(p.return_code, 0)
- eq_(p.stdout, '')
- eq_(p.stderr, '')
+ ported_eq(p.return_code, 0)
+ ported_eq(p.stdout, '')
+ ported_eq(p.stderr, '')
cmd = [python, example1_py, '5', '--three', '-t', '2', '--debug']
p = EasyProcess(cmd).call()
- eq_(p.return_code, 0)
- eq_(p.stdout, '')
- eq_(p.stderr, '')
+ ported_eq(p.return_code, 0)
+ ported_eq(p.stdout, '')
+ ported_eq(p.stderr, '')
cmd = [python, example1_py, '5', '-t', 'x']
p = EasyProcess(cmd).call()
- eq_(p.return_code > 0, 1)
- eq_(p.stdout, '')
- eq_(p.stderr != '', 1)
+ ported_eq(p.return_code > 0, 1)
+ ported_eq(p.stdout, '')
+ ported_eq(p.stderr != '', 1)
cmd = [python, example1_py, '-t', '1', '5', '--debug']
p = EasyProcess(cmd).call()
- eq_(p.return_code, 0)
- eq_(p.stdout, '')
- eq_(p.stderr, '')
+ ported_eq(p.return_code, 0)
+ ported_eq(p.stdout, '')
+ ported_eq(p.stderr, '')
def test_2_cli():
cmd = [python, example2_py, '5', '2']
p = EasyProcess(cmd).call()
- eq_(p.return_code, 0)
- eq_(p.stdout, '')
- eq_(p.stderr, '')
+ ported_eq(p.return_code, 0)
+ ported_eq(p.stdout, '')
+ ported_eq(p.stderr, '')
cmd = [python, example2_py, '--debug', '5', '2']
p = EasyProcess(cmd).call()
- eq_(p.return_code, 0)
- eq_(p.stdout, '')
- ok_('root - DEBUG - 5' in p.stderr)
+ ported_eq(p.return_code, 0)
+ ported_eq(p.stdout, '')
+ assert 'root - DEBUG - 5' in p.stderr
def test_3_cli():
cmd = [python, example3_py]
p = EasyProcess(cmd).call()
- eq_(p.return_code, 0)
- eq_(p.stdout, '')
- eq_(p.stderr, '')
+ ported_eq(p.return_code, 0)
+ ported_eq(p.stdout, '')
+ ported_eq(p.stderr, '')
def test_1_ver():
cmd = [python, example1_py, '--version']
p = EasyProcess(cmd).call()
if PY3:
- eq_(p.stderr, '')
- eq_(p.stdout, '3.2')
+ ported_eq(p.stderr, '')
+ ported_eq(p.stdout, '3.2')
else:
- eq_(p.stdout, '')
- eq_(p.stderr, '3.2')
- eq_(p.return_code, 0)
+ ported_eq(p.stdout, '')
+ ported_eq(p.stderr, '3.2')
+ ported_eq(p.return_code, 0)
def test_2_ver():
cmd = [python, example2_py, '--version']
p = EasyProcess(cmd).call()
if PY3:
- eq_(p.stderr, '')
- eq_(p.stdout, '1.2')
+ ported_eq(p.stderr, '')
+ ported_eq(p.stdout, '1.2')
else:
- eq_(p.stdout, '')
- eq_(p.stderr, '1.2')
- eq_(p.return_code, 0)
+ ported_eq(p.stdout, '')
+ ported_eq(p.stderr, '1.2')
+ ported_eq(p.return_code, 0)
def test_3_ver():
cmd = [python, example3_py, '--version']
p = EasyProcess(cmd).call()
- eq_(p.stdout, '')
- ok_(p.stderr)
- ok_(p.return_code != 0)
+ ported_eq(p.stdout, '')
+ assert p.stderr
+ assert p.return_code != 0
def test_1_help():
cmd = [python, example1_py, '--help']
p = EasyProcess(cmd).call()
- eq_(p.stderr, '')
- eq_(p.return_code, 0)
- eq_('one' in p.stdout, 1)
- eq_('--two' in p.stdout, 1)
- eq_('-t' in p.stdout, 1)
- eq_('--three' in p.stdout, 1)
+ ported_eq(p.stderr, '')
+ ported_eq(p.return_code, 0)
+ ported_eq('one' in p.stdout, 1)
+ ported_eq('--two' in p.stdout, 1)
+ ported_eq('-t' in p.stdout, 1)
+ ported_eq('--three' in p.stdout, 1)
def test_2_help():
cmd = [python, example2_py, '--help']
p = EasyProcess(cmd).call()
- eq_(p.stderr, '')
- eq_(p.return_code, 0)
+ ported_eq(p.stderr, '')
+ ported_eq(p.return_code, 0)
def test_3_help():
cmd = [python, example3_py, '--help']
p = EasyProcess(cmd).call()
- eq_(p.stderr, '')
- eq_(p.return_code, 0)
+ ported_eq(p.stderr, '')
+ ported_eq(p.return_code, 0)
diff -ru a/tox.ini b/tox.ini
--- a/tox.ini 2020-03-27 14:00:49.587654335 +0100
+++ b/tox.ini 2020-03-27 14:01:04.815678385 +0100
@@ -8,12 +8,12 @@
[testenv]
deps=
- nose
+ pytest
easyprocess
path.py
setenv=
PYTHONPATH=
changedir=tests
-commands=nosetests --verbose
+commands=pytest