summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2017-10-06 09:10:13 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-10-15 17:29:40 +0000
commit8e1de3aa5a70f6230e23f1d2dffd9183935894ee (patch)
tree73b7576955b841db60a4e5d59b6736ebdb0c958b
parent929a6543e617fc5cfd99069c1c390a6a15f093ce (diff)
downloadmeta-openembedded-8e1de3aa5a70f6230e23f1d2dffd9183935894ee.tar.gz
python-pytest: fix egg version of package
commit "python-pytest: remove fetch during do_compile phase" removed the ability of the package to version it self correctly. The version ended up as 0.0.0 which causes runtime version checking. This fixed that issues. Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-python/recipes-devtools/python/python-pytest.inc3
-rw-r--r--meta-python/recipes-devtools/python/python-pytest/pytest_version_fix.patch51
2 files changed, 53 insertions, 1 deletions
diff --git a/meta-python/recipes-devtools/python/python-pytest.inc b/meta-python/recipes-devtools/python/python-pytest.inc
index ae1d81d17..6140250ca 100644
--- a/meta-python/recipes-devtools/python/python-pytest.inc
+++ b/meta-python/recipes-devtools/python/python-pytest.inc
@@ -6,7 +6,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=c39b24965f4aef64222cb35de9d47cc4"
6SRC_URI[md5sum] = "401c005bd57f71e63ba015ab086fe67d" 6SRC_URI[md5sum] = "401c005bd57f71e63ba015ab086fe67d"
7SRC_URI[sha256sum] = "f46e49e0340a532764991c498244a60e3a37d7424a532b3ff1a6a7653f1a403a" 7SRC_URI[sha256sum] = "f46e49e0340a532764991c498244a60e3a37d7424a532b3ff1a6a7653f1a403a"
8 8
9SRC_URI_append = " file://0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch" 9SRC_URI_append = " file://0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch \
10 file://pytest_version_fix.patch "
10 11
11RDEPENDS_${PN}_class-target += " \ 12RDEPENDS_${PN}_class-target += " \
12 ${PYTHON_PN}-argparse \ 13 ${PYTHON_PN}-argparse \
diff --git a/meta-python/recipes-devtools/python/python-pytest/pytest_version_fix.patch b/meta-python/recipes-devtools/python/python-pytest/pytest_version_fix.patch
new file mode 100644
index 000000000..908f862b5
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python-pytest/pytest_version_fix.patch
@@ -0,0 +1,51 @@
1Upstream-Status: Inappropriate (OE specific)
2
3python-pytest: remove fetch during do_compile phase
4commit: c974fbf9ebf185552ab65301e07af44f36517abf
5
6introduced an issue by making the version 0.0.0
7this fixes that
8
9Signed-off-by: Armin Kuster <akuster@mvista.com>
10
11Index: pytest-3.2.2/setup.py
12===================================================================
13--- pytest-3.2.2.orig/setup.py
14+++ pytest-3.2.2/setup.py
15@@ -1,5 +1,6 @@
16 import os
17 import sys
18+import re
19 import setuptools
20 import pkg_resources
21 from setuptools import setup, Command
22@@ -22,6 +23,18 @@ classifiers = [
23 with open('README.rst') as fd:
24 long_description = fd.read()
25
26+def read(*names, **kwargs):
27+ with open(os.path.join( *names), 'r') as fp:
28+ return fp.read()
29+
30+def find_version(*file_paths):
31+ version_file = read(*file_paths)
32+ version_match = re.search(r"^version = ['\']([^'\"]*)['\']",
33+ version_file, re.M)
34+
35+ if version_match:
36+ return version_match.group(1)
37+ raise RuntimeError("Unable to find version string.")
38
39 def has_environment_marker_support():
40 """
41@@ -59,9 +72,7 @@ def main():
42 name='pytest',
43 description='pytest: simple powerful testing with Python',
44 long_description=long_description,
45- use_scm_version={
46- 'write_to': '_pytest/_version.py',
47- },
48+ version=find_version("_pytest", "_version.py"),
49 url='http://pytest.org',
50 license='MIT license',
51 platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],