net/py-pynsq: Update to 0.6.9, Modernize

- Update PORTVERSION and distinfo checksum (0.6.9)
- Update TEST_DEPENDS and test target
- Remove TESTS option bits accordingly
- Sort USE{S} entries
- Enable NO_ARCH (architecture independent)
- Patch setup.py to remove unnecessary tornado entry and exclude tests
  from installation, for a future upstream patch that adds tests to the
  PyPI sdist.

Changes:

  https://github.com/nsqio/pynsq/blob/v0.6.9/ChangeLog.md
This commit is contained in:
Kubilay Kocak 2016-02-25 13:48:06 +00:00
parent 4cef6ede8f
commit c51087fa15
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=409516
3 changed files with 58 additions and 19 deletions

View File

@ -2,9 +2,8 @@
# $FreeBSD$
PORTNAME= pynsq
PORTVERSION= 0.5.1
PORTVERSION= 0.6.9
DISTVERSIONPREFIX= v
PORTREVISION= 1
CATEGORIES= net python
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -12,27 +11,24 @@ MAINTAINER= koobs@FreeBSD.org
COMMENT= Official Python client library for NSQ
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tornado>0:${PORTSDIR}/www/py-tornado
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tornado>0:${PORTSDIR}/www/py-tornado \
${PYTHON_PKGNAMEPREFIX}pytest>0:${PORTSDIR}/devel/py-pytest \
${PYTHON_PKGNAMEPREFIX}mock>0:${PORTSDIR}/devel/py-mock
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:${PORTSDIR}/devel/py-pytest \
${PYTHON_PKGNAMEPREFIX}mock>0:${PORTSDIR}/devel/py-mock \
${PYTHON_PKGNAMEPREFIX}python-snappy>0:${PORTSDIR}/archivers/py-python-snappy \
${PYTHON_PKGNAMEPREFIX}simplejson>0:${PORTSDIR}/devel/py-simplejson
OPTIONS_DEFINE= TESTS
TESTS_DESC= Install tools to run test suite
USES= python
USE_PYTHON= distutils autoplist
USES= python:-2.7
USE_GITHUB= yes
USE_PYTHON= distutils autoplist
GH_ACCOUNT= bitly
.include <bsd.port.options.mk>
NO_ARCH= yes
.if ${PORT_OPTIONS:MTESTS}
BUILD_DEPENDS:= ${TEST_DEPENDS}
.endif
regression-test: build
@cd ${WRKSRC} && ${PYTHON_CMD} ${PYSETUP} test
# test_reader requires nsqd(8)
do-test:
@cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test -a "--ignore=tests/test_reader.py"
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (bitly-pynsq-v0.5.1_GH0.tar.gz) = a0c2714faef2401cbebddd3f95bf26bedd34f09e7063e5f15cb1bbf0a40215b2
SIZE (bitly-pynsq-v0.5.1_GH0.tar.gz) = 25714
SHA256 (bitly-pynsq-v0.6.9_GH0.tar.gz) = c874715a843528c7f10480c7137cd3bb3b867f5f080d34798071a9629dfdb281
SIZE (bitly-pynsq-v0.6.9_GH0.tar.gz) = 40001

View File

@ -0,0 +1,43 @@
--- setup.py.orig 2016-02-21 16:49:18 UTC
+++ setup.py
@@ -1,17 +1,19 @@
-from setuptools import setup
+from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import sys
class PyTest(TestCommand):
- def finalize_options(self):
- TestCommand.finalize_options(self)
- self.test_args = []
- self.test_suite = True
+ user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
+
+ def initialize_options(self):
+ TestCommand.initialize_options(self)
+ self.pytest_args = []
def run_tests(self):
+ #import here, cause outside the eggs aren't loaded
import pytest
- errno = pytest.main(self.test_args)
+ errno = pytest.main(self.pytest_args)
sys.exit(errno)
@@ -31,12 +33,12 @@ setup(
'https://s3.amazonaws.com/bitly-downloads/nsq/pynsq-%s.tar.gz' %
version
),
- packages=['nsq'],
install_requires=['tornado'],
include_package_data=True,
+ packages=find_packages(exclude=['tests']),
zip_safe=False,
tests_require=['pytest', 'mock', 'simplejson',
- 'python-snappy', 'tornado'],
+ 'python-snappy'],
cmdclass={'test': PyTest},
classifiers=[
'Development Status :: 4 - Beta',