Our existing py-test-benchmark is not compatible with Python 3.7.
This new version wants py-cpuinfo, but it doesn't run on OpenBSD, and
even if it did, it doesn't work for most of our architectures. I've
patched it out here and it works just fine.
This update allowed py-pluggy 0.9.0 tests to pass with Python 3.7.
OK?
--Kurt
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/py-test-benchmark/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- Makefile 28 Apr 2019 20:51:37 -0000 1.4
+++ Makefile 29 Apr 2019 03:14:37 -0000
@@ -2,11 +2,10 @@
COMMENT = fixture for benchmarking code
-MODPY_EGG_VERSION = 3.0.0
+MODPY_EGG_VERSION = 3.2.2
DISTNAME = pytest-benchmark-${MODPY_EGG_VERSION}
PKGNAME = ${DISTNAME:S/py/py-/}
CATEGORIES = devel
-REVISION = 1
HOMEPAGE = https://pytest-benchmark.readthedocs.org/en/stable/
@@ -15,8 +14,6 @@ MAINTAINER = Alexandr Shadchin <shadchi
# BSD
PERMIT_PACKAGE_CDROM = Yes
-EXTRACT_SUFX = .zip
-
MODULES = lang/python
MODPY_PI = Yes
@@ -25,7 +22,9 @@ MODPY_PYTEST = Yes
MODPY_PYTEST_ARGS = tests
RUN_DEPENDS = devel/py-test${MODPY_FLAVOR}
-TEST_DEPENDS = ${FULLPKGNAME}:${FULLPKGPATH}
+TEST_DEPENDS = ${FULLPKGNAME}:${FULLPKGPATH} \
+ devel/py-freezegun${MODPY_FLAVOR} \
+ textproc/py-elasticsearch${MODPY_FLAVOR}
FLAVORS = python3
FLAVOR ?=
@@ -33,5 +32,10 @@ FLAVOR ?=
.if !${FLAVOR:Mpython3}
RUN_DEPENDS += math/py-statistics
.endif
+
+post-install:
+ for i in ${PREFIX}/bin/*; do \
+ mv $${i} $${i}${MODPY_BIN_SUFFIX} ;\
+ done
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/py-test-benchmark/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo 15 Apr 2016 18:32:04 -0000 1.1.1.1
+++ distinfo 29 Apr 2019 03:14:37 -0000
@@ -1,2 +1,2 @@
-SHA256 (pytest-benchmark-3.0.0.zip) = zsHR0lm5hprDBvkZNvlgdQihGcNPIcynnVBSG8Kb+YA=
-SIZE (pytest-benchmark-3.0.0.zip) = 368146
+SHA256 (pytest-benchmark-3.2.2.tar.gz) = RRLGgFMY0Hkm78s7Ofe5ihDQNTBak+39UynIbL+c+/c=
+SIZE (pytest-benchmark-3.2.2.tar.gz) = 338715
Index: patches/patch-src_pytest_benchmark_plugin_py
===================================================================
RCS file: patches/patch-src_pytest_benchmark_plugin_py
diff -N patches/patch-src_pytest_benchmark_plugin_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_pytest_benchmark_plugin_py 29 Apr 2019 03:14:37 -0000
@@ -0,0 +1,41 @@
+$OpenBSD$
+
+py-cpuinfo claims to support FreeBSD, but doesn't seem to.
+It seems to only be for informational purposes, so leave it
+out for now.
+
+Index: src/pytest_benchmark/plugin.py
+--- src/pytest_benchmark/plugin.py.orig
++++ src/pytest_benchmark/plugin.py
+@@ -324,14 +324,14 @@ def pytest_terminal_summary(terminalreporter):
+ raise
+
+
+-def get_cpu_info():
+- import cpuinfo
+- all_info = cpuinfo.get_cpu_info()
+- all_info = all_info or {}
+- info = {}
+- for key in ('vendor_id', 'hardware', 'brand'):
+- info[key] = all_info.get(key, 'unknown')
+- return info
++#def get_cpu_info():
++# import cpuinfo
++# all_info = cpuinfo.get_cpu_info()
++# all_info = all_info or {}
++# info = {}
++# for key in ('vendor_id', 'hardware', 'brand'):
++# info[key] = all_info.get(key, 'unknown')
++# return info
+
+
+ def pytest_benchmark_scale_unit(config, unit, benchmarks, best, worst, sort):
+@@ -364,7 +364,7 @@ def pytest_benchmark_generate_machine_info():
+ "python_build": platform.python_build(),
+ "release": platform.release(),
+ "system": platform.system(),
+- "cpu": get_cpu_info(),
++ #"cpu": get_cpu_info(),
+ }
+
+
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/py-test-benchmark/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST 15 Apr 2016 18:32:04 -0000 1.1.1.1
+++ pkg/PLIST 29 Apr 2019 03:14:37 -0000
@@ -1,4 +1,6 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2016/04/15 18:32:04 shadchin Exp $
+bin/py.test-benchmark${MODPY_BIN_SUFFIX}
+bin/pytest-benchmark${MODPY_BIN_SUFFIX}
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO
@@ -9,23 +11,43 @@ lib/python${MODPY_VERSION}/site-packages
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/requires.txt
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/__init__.py
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/__main__.py
${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}/
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}__main__.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}cli.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}compat.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}csv.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}fixture.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}histogram.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}hookspec.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}logger.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}pep418.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}plugin.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}session.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}stats.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}table.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}timers.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/${MODPY_PYCACHE}utils.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/cli.py
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/compat.py
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/csv.py
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/fixture.py
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/histogram.py
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/hookspec.py
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/logger.py
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/pep418.py
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/plugin.py
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/session.py
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/stats.py
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/storage/
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/storage/__init__.py
+${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/storage/${MODPY_PYCACHE}/
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/storage/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/storage/${MODPY_PYCACHE}elasticsearch.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/storage/${MODPY_PYCACHE}file.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/storage/elasticsearch.py
+lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/storage/file.py
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/table.py
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/timers.py
lib/python${MODPY_VERSION}/site-packages/pytest_benchmark/utils.py
No comments:
Post a Comment