Skip to content

Commit

Permalink
lang/py-lupa: Update to 2.0
Browse files Browse the repository at this point in the history
- Convert to USE_PYTHON=unittest

Changes:	https://github.com/scoder/lupa/blob/master/CHANGES.rst
  • Loading branch information
sunpoet committed May 27, 2023
1 parent 7bd65b8 commit bc8de8b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
10 changes: 4 additions & 6 deletions lang/py-lupa/Makefile
@@ -1,5 +1,5 @@
PORTNAME= lupa
PORTVERSION= 1.14.1
PORTVERSION= 2.0
CATEGORIES= lang python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
Expand All @@ -12,9 +12,10 @@ LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE.txt

USES= lua pkgconfig python:3.6+
USE_PYTHON= autoplist concurrent distutils
USE_PYTHON= autoplist concurrent cython distutils unittest

MAKE_ARGS= --no-bundle
MAKE_ARGS= --no-bundle --with-cython --with-lua-checks
TEST_ARGS= lupa.tests.test

post-patch:
# Clean up bundled libraries
Expand All @@ -23,7 +24,4 @@ post-patch:
post-install:
${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +

do-test:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} setup.py test

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions lang/py-lupa/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1681052954
SHA256 (lupa-1.14.1.tar.gz) = d0fd4e60ad149fe25c90530e2a0e032a42a6f0455f29ca0edb8170d6ec751c6e
SIZE (lupa-1.14.1.tar.gz) = 1061109
TIMESTAMP = 1684104502
SHA256 (lupa-2.0.tar.gz) = ad3fef486be7adddd349fe9a9c393789061312cf98ebc533b489be34f484cb79
SIZE (lupa-2.0.tar.gz) = 6278066
14 changes: 14 additions & 0 deletions lang/py-lupa/files/patch-lupa-tests-test.py
@@ -0,0 +1,14 @@
Obtained from: https://github.com/scoder/lupa/commit/9fecb31fd368043699b8a88310f2718858b18a5f

--- lupa/tests/test.py.orig 2023-04-04 07:12:27 UTC
+++ lupa/tests/test.py
@@ -52,6 +52,9 @@ class TestLuaRuntimeRefcounting(LupaTestCase):
if off_by_one and old_count == new_count + 1:
# FIXME: This happens in test_attrgetter_refcycle - need to investigate why!
self.assertEqual(old_count, new_count + 1)
+ elif off_by_one and old_count == new_count + 2 and sys.version_info >= (3,11):
+ # FIXME: This happens in test_attrgetter_refcycle - need to investigate why!
+ self.assertEqual(old_count, new_count + 2)
else:
self.assertEqual(old_count, new_count)

28 changes: 28 additions & 0 deletions lang/py-lupa/files/patch-setup.py
@@ -0,0 +1,28 @@
Obtained from: https://github.com/scoder/lupa/commit/19279acda1ad7e7a536adafe399b183701287bc1

--- setup.py.orig 2023-04-04 07:12:27 UTC
+++ setup.py
@@ -365,10 +365,11 @@ if not configs and not option_no_bundle:
or (get_machine() != "x86_64" and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
)
]
-if not configs and not option_use_bundle:
- configs = find_lua_build(no_luajit=option_no_luajit)
if not configs:
- configs = no_lua_error()
+ configs = [
+ (find_lua_build(no_luajit=option_no_luajit) if not option_use_bundle else {})
+ or no_lua_error()
+ ]


# check if Cython is installed, and use it if requested or necessary
@@ -484,7 +485,7 @@ setup(
],

packages=['lupa'],
- build_requires=['Cython>=0.29.28'],
+ setup_requires=['Cython>=0.29.28'],
ext_modules=ext_modules,
libraries=ext_libraries,
**extra_setup_args

0 comments on commit bc8de8b

Please sign in to comment.