python312Packages.spglib: cleanup (#392679)

This commit is contained in:
Gaétan Lepage
2025-03-24 20:55:19 +01:00
committed by GitHub
@@ -1,18 +1,18 @@
{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
pythonOlder,
# build-system
scikit-build-core,
numpy,
cmake,
pathspec,
ninja,
pyproject-metadata,
setuptools-scm,
# dependencies
numpy,
typing-extensions,
# tests
pytestCheckHook,
@@ -22,31 +22,32 @@
buildPythonPackage rec {
pname = "spglib";
version = "2.6.0";
format = "pyproject";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-1m7aK6AKHhT9luycO02/irD7PxJGQ+NXhcce5FW0COs=";
src = fetchFromGitHub {
owner = "spglib";
repo = "spglib";
tag = "v${version}";
hash = "sha256-rmQYFFfpyUhT9pfQZk1fN5tZWTg40wwtszhPhiZpXs4=";
};
nativeBuildInputs = [
build-system = [
scikit-build-core
numpy
cmake
pathspec
ninja
pyproject-metadata
setuptools-scm
];
dontUseCmakeConfigure = true;
postPatch = ''
# relax v2 constrain in [build-system] intended for binary backward compat
substituteInPlace pyproject.toml \
--replace-fail "numpy~=2.0" "numpy"
'';
propagatedBuildInputs = [ numpy ];
dependencies =
[
numpy
]
++ lib.optionals (pythonOlder "3.13") [
typing-extensions
];
nativeCheckInputs = [
pytestCheckHook
@@ -55,11 +56,11 @@ buildPythonPackage rec {
pythonImportsCheck = [ "spglib" ];
meta = with lib; {
meta = {
description = "Python bindings for C library for finding and handling crystal symmetries";
homepage = "https://spglib.github.io/spglib/";
changelog = "https://github.com/spglib/spglib/raw/v${version}/ChangeLog";
license = licenses.bsd3;
maintainers = with maintainers; [ psyanticy ];
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ psyanticy ];
};
}