Skip to content

Commit

Permalink
python-ncls: fix build for 0.0.68 release using PEP 518
Browse files Browse the repository at this point in the history
  • Loading branch information
kbipinkumar committed May 19, 2023
1 parent 22adbf9 commit 0907763
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
15 changes: 8 additions & 7 deletions BioArchLinux/python-ncls/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Maintainer: bipin kumar <bipin@ccmb.res.in>
# Maintainer: bipin kumar <kbipinkumar@pm.me>

pkgname=python-ncls
_module=${pkgname#python-}
pkgver=0.0.67
pkgrel=3
pkgdesc="A wrapper for the nested containment list data structure"
pkgver=0.0.68
pkgrel=1
pkgdesc="A wrapper for the nested containment list data structure. http://dx.doi.org/10.1093/bioinformatics/btz615"
arch=('x86_64')
url="https://github.com/biocore-ntnu/ncls"
license=('BSD-2')
depends=(
'python'
'python-numpy'
'glibc'
'python-setuptools'
)
makedepends=(
'python-setuptools'
'python-setuptools-scm'
'cython'
'python-build'
'python-installer'
Expand All @@ -25,9 +26,9 @@ options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_module::1}/$_module/$_module-$pkgver.tar.gz"
"LICENSE"
"cython3.patch")
sha256sums=('fa3e673d60e97bb021a516287d74bb959870cf9d910ec82403b99c443d8f447e'
sha256sums=('81aaa5abb123bb21797ed2f8ef921e20222db14a3ecbc61ccf447532f2b7ba93'
'48186409eb1721726d28884f40346a8380a893e95a50bef75584e2e9c2d4fcd5'
'174a620d7dce0952e9e657ff40f25e73f0f5a9e38c96fffc91ccbc20805a7ee4')
'80fbdf0c5c2a805c953df3c359d84e63bc801d14457ad5b8a6c140250ccec7d2')

prepare() {
cp LICENSE "$_module-$pkgver"
Expand Down
28 changes: 13 additions & 15 deletions BioArchLinux/python-ncls/cython3.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
--- a/setup.py 2023-05-14 00:15:53.983680836 +0530
+++ b/setup.py 2023-05-14 00:17:57.185420794 +0530
@@ -63,12 +63,14 @@
"ncls.src.fncls", ["ncls/src/fncls.pyx", "ncls/src/fintervaldb.c"],
# define_macros=macros,
include_dirs=include_dirs)]
--- a/setup.py 2023-05-19 08:59:27.619223728 +0530
+++ b/setup.py 2023-05-19 09:03:12.750132242 +0530
@@ -28,10 +28,12 @@
include_dirs=include_dirs,
),
]
+for e in extensions:
+ e.cython_directives = {'language_level': "3"}

# using setuptools to cythonize if cython not found
# not recommended by cython docs, but still
try:
from Cython.Build import cythonize
- ext_modules = cythonize(extensions, language_level=2)
+ ext_modules = cythonize(extensions, compiler_directives={'language_level' : "3"})
except ImportError:
print()
print("Warning: Cannot compile with Cython. Using legacy build.")
from Cython.Build import cythonize

-ext_modules = cythonize(extensions, language_level=2)
+ext_modules = cythonize(extensions, compiler_directives={'language_level' : "3"})


setup(ext_modules=ext_modules)

3 comments on commit 0907763

@starsareintherose
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to PR to upstream, and use upstream online patch

@kbipinkumar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to PR to upstream, and use upstream online patch

upstream is already in the process of merging the PR.

@starsareintherose
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

Please sign in to comment.