[oe-commits] [meta-openembedded] 08/11: python-pytest: fix egg version of package

git at git.openembedded.org git at git.openembedded.org
Mon Oct 9 06:28:25 UTC 2017


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

martin_jansa pushed a commit to branch master-next
in repository meta-openembedded.

commit a6efaf97f7d92af003a3e6c6eaf933289bacfcb7
Author: Armin Kuster <akuster808 at gmail.com>
AuthorDate: Fri Oct 6 09:10:13 2017 -0700

    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 at gmail.com>
    Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
 .../recipes-devtools/python/python-pytest.inc      |  3 +-
 .../python/python-pytest/pytest_version_fix.patch  | 51 ++++++++++++++++++++++
 2 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/meta-python/recipes-devtools/python/python-pytest.inc b/meta-python/recipes-devtools/python/python-pytest.inc
index ae1d81d..6140250 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"
 SRC_URI[md5sum] = "401c005bd57f71e63ba015ab086fe67d"
 SRC_URI[sha256sum] = "f46e49e0340a532764991c498244a60e3a37d7424a532b3ff1a6a7653f1a403a"
 
-SRC_URI_append = " file://0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch"
+SRC_URI_append = " file://0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch \
+                   file://pytest_version_fix.patch "
 
 RDEPENDS_${PN}_class-target += " \
     ${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 0000000..908f862
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python-pytest/pytest_version_fix.patch
@@ -0,0 +1,51 @@
+Upstream-Status: Inappropriate (OE specific) 
+
+python-pytest: remove fetch during do_compile phase
+commit: c974fbf9ebf185552ab65301e07af44f36517abf 
+
+introduced an issue by making the version 0.0.0
+this fixes that
+
+Signed-off-by: Armin Kuster <akuster at mvista.com>
+
+Index: pytest-3.2.2/setup.py
+===================================================================
+--- pytest-3.2.2.orig/setup.py
++++ pytest-3.2.2/setup.py
+@@ -1,5 +1,6 @@
+ import os
+ import sys
++import re
+ import setuptools
+ import pkg_resources
+ from setuptools import setup, Command
+@@ -22,6 +23,18 @@ classifiers = [
+ with open('README.rst') as fd:
+     long_description = fd.read()
+ 
++def read(*names, **kwargs):
++    with open(os.path.join( *names), 'r') as fp:
++        return fp.read()
++
++def find_version(*file_paths):
++    version_file = read(*file_paths)
++    version_match = re.search(r"^version = ['\']([^'\"]*)['\']",
++                              version_file, re.M)
++
++    if version_match:
++        return version_match.group(1)
++    raise RuntimeError("Unable to find version string.")
+ 
+ def has_environment_marker_support():
+     """
+@@ -59,9 +72,7 @@ def main():
+         name='pytest',
+         description='pytest: simple powerful testing with Python',
+         long_description=long_description,
+-        use_scm_version={
+-            'write_to': '_pytest/_version.py',
+-        },
++	version=find_version("_pytest", "_version.py"),
+         url='http://pytest.org',
+         license='MIT license',
+         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list