summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Smedstad2024-04-22 16:02:00 +0200
committerCarl Smedstad2024-04-22 16:02:06 +0200
commitb06ceb0a38289849661c690d02e7f3adbdc231ac (patch)
tree218bf2a58b16a5fddd5a0c3a0e9dcd547d01e4fc
parent401b1c360d59527bec7730522bd936ee3e8fc7a4 (diff)
downloadaur-b06ceb0a38289849661c690d02e7f3adbdc231ac.tar.gz
upgpkg: 1.4.2-6: Python 3.12 compatibility
-rw-r--r--.SRCINFO5
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD24
-rw-r--r--python3.12-compatibility.patch49
4 files changed, 66 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5183eba25b54..f87aaba3f797 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,10 @@
pkgbase = cmake-lint
pkgdesc = Check for coding style issues in CMake files
pkgver = 1.4.2
- pkgrel = 5
+ pkgrel = 6
url = https://github.com/cmake-lint/cmake-lint
arch = any
license = Apache-2.0
- checkdepends = python-mock
checkdepends = python-pytest
makedepends = python-build
makedepends = python-installer
@@ -14,6 +13,8 @@ pkgbase = cmake-lint
makedepends = python-wheel
depends = python
source = cmake-lint-1.4.2.tar.gz::https://github.com/cmake-lint/cmake-lint/archive/1.4.2.tar.gz
+ source = python3.12-compatibility.patch
sha256sums = bf060987c74e07890f7314a4832c2e54ffb9c5c1e6d799387bc438010f918676
+ sha256sums = 4f1573fa02d542067f0d20eb178f50354bed451173c4f73175098ca4c6e569c1
pkgname = cmake-lint
diff --git a/.gitignore b/.gitignore
index 0df2b70016b9..f121dd0b3998 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
!.nvchecker.toml
!.SRCINFO
!PKGBUILD
+!python3.12-compatibility.patch
diff --git a/PKGBUILD b/PKGBUILD
index 07d0e3d55b6a..ee9903103fee 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,9 +1,9 @@
-# Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com>
+# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: Richard Quirk
pkgname=cmake-lint
pkgver=1.4.2
-pkgrel=5
+pkgrel=6
pkgdesc="Check for coding style issues in CMake files"
arch=(any)
url="https://github.com/cmake-lint/cmake-lint"
@@ -16,20 +16,22 @@ makedepends=(
python-setuptools
python-wheel
)
-checkdepends=(
- python-mock
- python-pytest
+checkdepends=(python-pytest)
+source=(
+ "$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"
+ "python3.12-compatibility.patch"
+)
+sha256sums=(
+ 'bf060987c74e07890f7314a4832c2e54ffb9c5c1e6d799387bc438010f918676'
+ '4f1573fa02d542067f0d20eb178f50354bed451173c4f73175098ca4c6e569c1'
)
-
-source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
-sha256sums=('bf060987c74e07890f7314a4832c2e54ffb9c5c1e6d799387bc438010f918676')
_archive="$pkgname-$pkgver"
prepare() {
cd "$_archive"
- sed -i '/scripts=/d' setup.py
+ patch --forward --strip=1 --input="$srcdir/python3.12-compatibility.patch"
}
build() {
@@ -42,10 +44,10 @@ check() {
cd "$_archive"
rm -rf tmp_install
- _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
python -m installer --destdir=tmp_install dist/*.whl
- export PYTHONPATH="$PWD/tmp_install/$_site_packages"
+ local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+ export PYTHONPATH="$PWD/tmp_install/$site_packages"
pytest --override-ini="addopts="
}
diff --git a/python3.12-compatibility.patch b/python3.12-compatibility.patch
new file mode 100644
index 000000000000..5e67b1bee5ba
--- /dev/null
+++ b/python3.12-compatibility.patch
@@ -0,0 +1,49 @@
+diff --unified --recursive --text --new-file cmake-lint-1.4.2.orig/setup.py cmake-lint-1.4.2/setup.py
+--- cmake-lint-1.4.2.orig/setup.py 2024-04-22 15:48:16.433625415 +0200
++++ cmake-lint-1.4.2/setup.py 2024-04-22 15:59:27.546256097 +0200
+@@ -1,22 +1,13 @@
+ #! /usr/bin/env python
+
+-import imp
++from importlib.machinery import SourceFileLoader
+
+ from setuptools import setup
+
+
+ def get_version():
+- ver_file = None
+- try:
+- ver_file, pathname, description = imp.find_module(
+- '__version__', ['cmakelint'])
+- vermod = imp.load_module(
+- '__version__', ver_file, pathname, description)
+- version = vermod.VERSION
+- return version
+- finally:
+- if ver_file is not None:
+- ver_file.close()
++ version_module = SourceFileLoader('__version__', 'cmakelint/__version__.py').load_module()
++ return version_module.VERSION
+
+
+ def read_without_comments(filename):
+@@ -30,7 +21,6 @@
+ setup(name='cmakelint',
+ version=get_version(),
+ packages=['cmakelint'],
+- scripts=['bin/cmakelint'],
+ entry_points={
+ 'console_scripts': [
+ 'cmakelint = cmakelint.main:main'
+diff --unified --recursive --text --new-file cmake-lint-1.4.2.orig/test/cmakelint_test.py cmake-lint-1.4.2/test/cmakelint_test.py
+--- cmake-lint-1.4.2.orig/test/cmakelint_test.py 2024-04-22 15:48:16.433625415 +0200
++++ cmake-lint-1.4.2/test/cmakelint_test.py 2024-04-22 15:59:27.539589434 +0200
+@@ -19,7 +19,7 @@
+
+ import cmakelint.__version__
+ import cmakelint.main
+-import mock
++from unittest import mock
+
+
+ # stderr suppression from https://stackoverflow.com/a/1810086