[Python-modules-commits] [parsedatetime] 06/11: Ensure only test targets require pytest-runner

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sat Mar 11 11:28:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/experimental
in repository parsedatetime.

commit 2bf48a3ad4ecdb4938cfe6baca369c61c570b740
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Sat Mar 11 07:12:24 2017 +0000

    Ensure only test targets require pytest-runner
    
    - New patch Conditional-requirement-on-pytest-runner.patch
    
    Gbp-Dch: full
---
 .../Conditional-requirement-on-pytest-runner.patch | 41 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 42 insertions(+)

diff --git a/debian/patches/Conditional-requirement-on-pytest-runner.patch b/debian/patches/Conditional-requirement-on-pytest-runner.patch
new file mode 100644
index 0000000..a27d44c
--- /dev/null
+++ b/debian/patches/Conditional-requirement-on-pytest-runner.patch
@@ -0,0 +1,41 @@
+From: Ghislain Antony Vaillant <ghisvail at gmail.com>
+Date: Sat, 11 Mar 2017 07:09:38 +0000
+Subject: Conditional requirement on pytest-runner
+
+---
+ setup.py | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index b6d4b29..27e43af 100644
+--- a/setup.py
++++ b/setup.py
+@@ -4,6 +4,7 @@
+ import os
+ import re
+ import codecs
++import sys
+ 
+ from setuptools import setup, find_packages
+ 
+@@ -23,6 +24,11 @@ def extract_metaitem(meta):
+         return meta_match.group(1)
+     raise RuntimeError('Unable to find __{meta}__ string.'.format(meta=meta))
+ 
++# Conditional requirement for pytest-runner,
++# see <https://github.com/pytest-dev/pytest-runner#conditional-requirement>
++needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
++pytest_runner = ['pytest-runner'] if needs_pytest else []
++
+ setup(
+     name='parsedatetime',
+     version=extract_metaitem('version'),
+@@ -36,7 +42,7 @@ setup(
+     platforms=['Any'],
+     long_description=read('README.rst'),
+     install_requires=['future'],
+-    setup_requires=['pytest-runner'],
++    setup_requires=pytest_runner,
+     tests_require=['pytest'],
+     test_suite='tests',
+     classifiers=[
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..ecbcf85 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+Conditional-requirement-on-pytest-runner.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/parsedatetime.git



More information about the Python-modules-commits mailing list