mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-01 23:28:08 -07:00
dev-python/chardet: sync pytest-runner patch with upstream
Package-Manager: Portage-2.3.5, Repoman-2.3.2
This commit is contained in:
@@ -1,21 +1,41 @@
|
||||
From 8d5291ff2c2560cf88ef7c38d90ca6d026c9d11c Mon Sep 17 00:00:00 2001
|
||||
From: Mike Gilbert <floppym@gentoo.org>
|
||||
Date: Thu, 20 Apr 2017 15:18:35 -0400
|
||||
Subject: [PATCH] Remove dependency on pytest-runner
|
||||
From b874c25b08edd6bdbdd70a439c6cd603d6830226 Mon Sep 17 00:00:00 2001
|
||||
From: Zac Medico <zmedico@gentoo.org>
|
||||
Date: Fri, 21 Apr 2017 08:36:14 -0700
|
||||
Subject: [PATCH] setup.py: require pytest-runner only when necessary (#119)
|
||||
|
||||
This optimizes setup.py for cases when pytest-runner is not needed,
|
||||
using the approach that is suggested upstream:
|
||||
|
||||
https://pypi.python.org/pypi/pytest-runner#conditional-requirement
|
||||
---
|
||||
setup.py | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
setup.py | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 28a080a..ab49d62 100755
|
||||
index 28a080a..c214352 100755
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -46,7 +46,6 @@ setup(name='chardet',
|
||||
@@ -1,9 +1,14 @@
|
||||
#!/usr/bin/env python
|
||||
import re
|
||||
+import sys
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
|
||||
+needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv)
|
||||
+pytest_runner = ['pytest-runner'] if needs_pytest else []
|
||||
+
|
||||
+
|
||||
# Get version without importing, which avoids dependency issues
|
||||
def get_version():
|
||||
with open('chardet/version.py') as version_file:
|
||||
@@ -46,7 +51,7 @@ setup(name='chardet',
|
||||
"Modules"),
|
||||
"Topic :: Text Processing :: Linguistic"],
|
||||
packages=find_packages(),
|
||||
- setup_requires=['pytest-runner'],
|
||||
+ setup_requires=pytest_runner,
|
||||
tests_require=['pytest', 'hypothesis'],
|
||||
entry_points={'console_scripts':
|
||||
['chardetect = chardet.cli.chardetect:main']})
|
||||
|
||||
Reference in New Issue
Block a user