Martin Weinelt ae4a1a485a
treewide: add explicit format attribute for Python packages
If a Python package does not come with either `format` or `pyproject` we
consider it a setuptools build, that calls `setup.py` directly, which is
deprecated.

This change, as a first step, migrates a large chunk of these packages to
set setuptools as their explicit format

This is so we can unify the problem space for the next step of the
migration.
2025-07-02 05:56:47 +02:00

58 lines
1.1 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
pythonOlder,
fetchPypi,
libngspice,
numpy,
ply,
scipy,
pyyaml,
cffi,
requests,
matplotlib,
setuptools,
}:
buildPythonPackage rec {
pname = "pyspice";
version = "1.5";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchPypi {
pname = "PySpice";
inherit version;
sha256 = "d28448accad98959e0f5932af8736e90a1f3f9ff965121c6881d24cdfca23d22";
};
propagatedBuildInputs = [
setuptools
requests
pyyaml
cffi
matplotlib
numpy
ply
scipy
libngspice
];
doCheck = false;
pythonImportsCheck = [ "PySpice" ];
postPatch = ''
substituteInPlace PySpice/Spice/NgSpice/Shared.py --replace \
"ffi.dlopen(self.library_path)" \
"ffi.dlopen('${libngspice}/lib/libngspice${stdenv.hostPlatform.extensions.sharedLibrary}')"
'';
meta = with lib; {
description = "Simulate electronic circuit using Python and the Ngspice / Xyce simulators";
homepage = "https://github.com/FabriceSalvaire/PySpice";
license = licenses.gpl3Only;
maintainers = with maintainers; [ matthuszagh ];
};
}