Date: Monday, January 9, 2023 @ 19:38:34
  Author: dvzrv
Revision: 1382173

upgpkg: python-solidpython 1.1.3-2: Rebuild to fix dependencies.

Switch to using correct dependencies.
Add upstreamed patch to fix build-system and direct dependencies:
https://github.com/SolidCode/SolidPython/pull/203
Use unittest in check() and drop unneeded checkdepends.
Open upstream ticket about missing 1.1.3 tag:
https://github.com/SolidCode/SolidPython/issues/202

Added:
  python-solidpython/trunk/0001-Switch-to-correct-PEP517-build-system.patch
  python-solidpython/trunk/0002-Add-setuptools-to-dependencies.patch
Modified:
  python-solidpython/trunk/PKGBUILD

--------------------------------------------------+
 0001-Switch-to-correct-PEP517-build-system.patch |   39 +++++++++++++++++++
 0002-Add-setuptools-to-dependencies.patch        |   28 ++++++++++++++
 PKGBUILD                                         |   41 +++++++++++++--------
 3 files changed, 93 insertions(+), 15 deletions(-)

Added: 0001-Switch-to-correct-PEP517-build-system.patch
===================================================================
--- 0001-Switch-to-correct-PEP517-build-system.patch                            
(rev 0)
+++ 0001-Switch-to-correct-PEP517-build-system.patch    2023-01-09 19:38:34 UTC 
(rev 1382173)
@@ -0,0 +1,39 @@
+From d6568ee7e1f85025725597d1cdcb62b3d0a1ded1 Mon Sep 17 00:00:00 2001
+From: David Runge <[email protected]>
+Date: Mon, 9 Jan 2023 20:09:25 +0100
+Subject: [PATCH 1/2] Switch to correct PEP517 build-system
+
+pyproject.toml:
+Since poetry is used, switch to the build-system setup as documented
+upstream (https://python-poetry.org/docs/pyproject#poetry-and-pep-517).
+---
+ pyproject.toml | 16 ++--------------
+ 1 file changed, 2 insertions(+), 14 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index 6554128..1ab7617 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -44,17 +44,5 @@ tox = "^tox 3.11"
+ 
+ 
+ [build-system]
+-requires = [
+-    "poetry>=0.12",
+-    # See 
https://github.com/pypa/setuptools/issues/2353#issuecomment-683781498
+-    # for the rest of these requirements, 
+-    # -ETJ 31 December 2020
+-    "setuptools>=30.3.0,<50",
+-    "wheel",
+-    "pytest-runner",
+-    "setuptools_scm>=3.3.1",
+-
+-]
+-
+-build-backend = "poetry.masonry.api"
+-
++requires = ["poetry-core>=1.0.0"]
++build-backend = "poetry.core.masonry.api"
+-- 
+2.39.0
+

Added: 0002-Add-setuptools-to-dependencies.patch
===================================================================
--- 0002-Add-setuptools-to-dependencies.patch                           (rev 0)
+++ 0002-Add-setuptools-to-dependencies.patch   2023-01-09 19:38:34 UTC (rev 
1382173)
@@ -0,0 +1,28 @@
+From 025ca1c1bd9848bf12bff72b80b8d05d8e24968d Mon Sep 17 00:00:00 2001
+From: David Runge <[email protected]>
+Date: Mon, 9 Jan 2023 20:25:43 +0100
+Subject: [PATCH 2/2] Add setuptools to dependencies
+
+pyproject.toml:
+Pkg_resources is used in solid/solidpython.py, hence this project
+depends on setuptools until the use of pkg_resources is replaced with
+something else.
+---
+ pyproject.toml | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index 1ab7617..8b31bb7 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -38,6 +38,7 @@ euclid3 = "^0.1.0"
+ pypng = "^0.0.19"
+ PrettyTable = "=0.7.2"
+ ply = "^3.11"
++setuptools = ">=65.6.3"
+ 
+ [tool.poetry.dev-dependencies]
+ tox = "^tox 3.11"
+-- 
+2.39.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-01-09 19:34:48 UTC (rev 1382172)
+++ PKGBUILD    2023-01-09 19:38:34 UTC (rev 1382173)
@@ -3,38 +3,49 @@
 _pkgname=SolidPython
 pkgname=python-solidpython
 pkgver=1.1.3
-pkgrel=1
-_commit=0a4f539c31a25df52a42bab2ceeffafd45596f73 # missing tag for 1.1.3
+pkgrel=2
+# missing tag for 1.1.3: https://github.com/SolidCode/SolidPython/issues/202
+_commit=0a4f539c31a25df52a42bab2ceeffafd45596f73
 pkgdesc='Python frontend for solid modelling that compiles to OpenSCAD'
 arch=('any')
 url='https://github.com/SolidCode/SolidPython'
-license=('LGPL')
-depends=('python-euclid3' 'python-pypng' 'python-prettytable')
-makedepends=('python-build' 'python-installer' 'python-poetry' 
'python-setuptools-scm' 'python-wheel')
-checkdepends=('python-pytest-runner')
-source=("https://github.com/SolidCode/SolidPython/archive/$_commit.tar.gz";)
-sha512sums=('d0f701e9508721e3f7f5a2b65dfe5692cac425374f3b0136a5792c5fa93ba7c3295288149cc07ad9c902df7b973e1c80f1023d44ec6919c33f52590a15573f6d')
+license=('LGPL2.1')
+depends=('python-euclid3' 'python-prettytable' 'python-ply' 'python-pypng' 
'python-setuptools')
+makedepends=('git' 'python-build' 'python-installer' 'python-poetry-core' 
'python-wheel')
+source=(
+  "git+https://github.com/SolidCode/SolidPython#commit=$_commit";
+  0001-Switch-to-correct-PEP517-build-system.patch
+  0002-Add-setuptools-to-dependencies.patch
+)
+sha512sums=('SKIP'
+            
'696a2ff91c898a46072d1f766f5be98ba98024d87095c535cec8488cf78a1e629d2311c80e34f095bb2f7d36396bd834c149c2a107f09023362c505b568b8b27'
+            
'b16fec04ec3c28d7f2f83fb956c7a042ee749df5c1977b079a1bd162c8c644449c5a1f50b83fd2a1a1debe77adaff01511cf0915e0e3c46d2b08cc17a1f140a0')
 
 prepare() {
-  cd $_pkgname-*
-
-  sed -i -e '/tox/d' -e 's|setuptools>=.*|setuptools\",|' pyproject.toml
+  # switch to proper PEP517 build-system and fix direct dependencies:
+  # https://github.com/SolidCode/SolidPython/pull/203
+  patch -Np1 -d $_pkgname -i 
../0001-Switch-to-correct-PEP517-build-system.patch
+  patch -Np1 -d $_pkgname -i ../0002-Add-setuptools-to-dependencies.patch
 }
 
 build() {
-  cd $_pkgname-*
+  cd $_pkgname
 
   python -m build --wheel --no-isolation
 }
 
 check() {
-  cd $_pkgname-*
+  local site_packages=$(python -c "import site; 
print(site.getsitepackages()[0])")
 
-  PYTHONPATH=$(pwd) solid/test/run_all_tests.sh
+  cd $_pkgname
+  python -m installer --destdir=test_dir dist/*.whl
+  export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
+
+  python -m unittest discover -vs solid/test/
 }
 
 package() {
-  cd $_pkgname-*
+  cd $_pkgname
 
   python -m installer --destdir="$pkgdir" dist/*.whl
 }

Reply via email to