Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
python-cbor: fix building with newer setuptools
Browse files Browse the repository at this point in the history
Also backports a fix for tests [1]

See: https://wiki.archlinux.org/index.php?title=Python_package_guidelines&type=revision&diff=743435&oldid=742361
See: pypa/distutils#133

[1] brianolson/cbor_py#19



git-svn-id: file:///srv/repos/svn-community/svn@1285262 9fca08f4-af9d-4005-b8df-a31f2cc04f65
  • Loading branch information
yan12125 committed Aug 29, 2022
1 parent 02f022a commit 12d6913
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions python-cbor/trunk/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ license=(Apache)
makedepends=(python-setuptools)
depends=(python)
checkdepends=(python-pytest)
source=("$pkgname-$pkgver.tar.gz"::"https://github.com/brianolson/cbor_py/archive/$_commit.tar.gz")
sha256sums=('d9211361e37363dfbf54fcb21d23e610aa25679609044844305c2ee5b80b78d9')
source=("$pkgname-$pkgver.tar.gz"::"https://github.com/brianolson/cbor_py/archive/$_commit.tar.gz"
"$pkgname-issue6.patch::https://github.com/dol-sen/cbor_py/commit/abec52298fd89ed3f4c05ca4c0467c12df740f8d.patch")
sha256sums=('d9211361e37363dfbf54fcb21d23e610aa25679609044844305c2ee5b80b78d9'
'2f4fcc52fb28790d325355c51a3651ec8c39b85c8e6b415e3ac1394405dd0f2d')

prepare() {
cd cbor_py-$_commit
sed -i 's#logger.warn(#logger.warning(#' cbor/tests/*.py
# Backport a unmerged fix for tests https://github.com/brianolson/cbor_py/pull/19
patch -Np1 -i ../$pkgname-issue6.patch
}

build() {
Expand All @@ -27,9 +31,8 @@ build() {

check() {
cd cbor_py-$_commit
pyver=$(python -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
# test_sortkeys is broken https://github.com/brianolson/cbor_py/issues/6
PYTHONPATH=build/lib.linux-$CARCH-$pyver pytest -k 'not test_sortkeys'
pyver=$(python -c "import sys; print('{}{}'.format(*sys.version_info[:2]))")
PYTHONPATH=build/lib.linux-$CARCH-cpython-$pyver pytest
}

package() {
Expand Down

0 comments on commit 12d6913

Please sign in to comment.