diff options
author | Carlos Aznarán | 2023-10-05 21:51:00 -0500 |
---|---|---|
committer | Carlos Aznarán | 2023-10-05 21:51:00 -0500 |
commit | 0ffd9519187187787bda732c27b8d8b957e402a9 (patch) | |
tree | 28a1aaf514bc55f3ea78c8a684df58164b12070a | |
parent | debcba3afcf96df91983d78be91cd7745c061e24 (diff) | |
download | aur-0ffd9519187187787bda732c27b8d8b957e402a9.tar.gz |
Follow the Python Package Guidelines with PE P517
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 20 |
2 files changed, 16 insertions, 9 deletions
@@ -5,10 +5,13 @@ pkgbase = python-dolfin url = https://bitbucket.org/fenics-project/dolfin arch = x86_64 license = LGPL3 - checkdepends = openssh checkdepends = python-pytest checkdepends = python-decorator makedepends = cmake + makedepends = python-build + makedepends = python-installer + makedepends = python-setuptools + makedepends = python-wheel depends = dolfin=2019.1.0.post0 depends = python-pkgconfig depends = python-ply @@ -16,8 +16,8 @@ depends=('dolfin=2019.1.0.post0' 'python-pkgconfig' 'python-ply' 'python-mpi4py') -makedepends=('cmake') -checkdepends=('openssh' 'python-pytest' 'python-decorator') +makedepends=('cmake' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel') +checkdepends=('python-pytest' 'python-decorator') optdepends=('petsc: interface with PETSc from python' 'slepc: interface with SLEPc from python' 'python-matplotlib: plotting support') @@ -30,23 +30,27 @@ build() { [ -n "$SLEPC_DIR" ] && source /etc/profile.d/slepc.sh cd ${_base}-${pkgver}/python - python setup.py build + python -m build --wheel --skip-dependency-check --no-isolation } check() { if [ -z "$(ldconfig -p | grep libcuda.so.1)" ]; then export OMPI_MCA_opal_warn_on_missing_libcuda=0 fi + export OMPI_MCA_rmaps_base_oversubscribe=1 export OMPI_MCA_mpi_yield_when_idle=1 export OMPI_MCA_btl_base_warn_component_unused=0 - pushd ${_base}-${pkgver}/python - python setup.py install --root="${srcdir}/tmp_install" --optimize=1 --skip-build - popd - PYTHONPATH="${PWD}/tmp_install$(python -c "import site; print(site.getsitepackages()[0])"):${PYTHONPATH}" mpirun -n 3 python -m pytest ${_base}-${pkgver}/python/test/unit -k 'not coordinate_derivative and not dofmap and not finite_element and not test_form and not local_assembler and not function and not vector and not parameters and not local_solver_dg[shared_facet] and not solve_local[shared_facet] and not elliptic_eqn_on_intersecting_surface and not bcs and not incremental_assembly[mesh_factory0] and not incremental_assembly[mesh_factory1] and not lu_solver[PETSc] and not layout_and_pattern_interface[PETSc-element0] and not layout_and_pattern_interface[PETSc-element1] and not layout_and_pattern_interface[PETSc-element2] and not layout_and_pattern_interface[PETSc-element3] and not shared_entities[shared_vertex-mesh_factory8] and not snes_solver[5-PETSc] and not newton_solver[5-PETSc] and not computed_norms_against_references and not lu_solver_reuse[PETSc] and not matrix' --ignore=${_base}-${pkgver}/python/test/unit/la/test_vector.py --ignore=${_base}-${pkgver}/python/test/unit/function/test_function_space.py + + python -m venv --system-site-packages test-env + test-env/bin/python -m installer ${_base}-${pkgver}/python/dist/*.whl + mpirun -n 3 test-env/bin/python -m pytest ${_base}-${pkgver}/python/test/unit \ + -k 'not coordinate_derivative and not dofmap and not finite_element and not test_form and not local_assembler and not function and not vector and not parameters and not local_solver_dg[shared_facet] and not solve_local[shared_facet] and not elliptic_eqn_on_intersecting_surface and not bcs and not incremental_assembly[mesh_factory0] and not incremental_assembly[mesh_factory1] and not lu_solver[PETSc] and not layout_and_pattern_interface[PETSc-element0] and not layout_and_pattern_interface[PETSc-element1] and not layout_and_pattern_interface[PETSc-element2] and not layout_and_pattern_interface[PETSc-element3] and not shared_entities[shared_vertex-mesh_factory8] and not snes_solver[5-PETSc] and not newton_solver[5-PETSc] and not computed_norms_against_references and not lu_solver_reuse[PETSc] and not matrix' \ + --ignore=${_base}-${pkgver}/python/test/unit/la/test_vector.py \ + --ignore=${_base}-${pkgver}/python/test/unit/function/test_function_space.py } package() { cd ${_base}-${pkgver}/python - PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build + PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m installer --destdir="${pkgdir}" dist/*.whl } |