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

69 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
beautifulsoup4,
pythonOlder,
pandas,
python,
numpy,
scikit-learn,
scipy,
lxml,
matplotlib,
sarge,
unittestCheckHook,
setuptools,
}:
buildPythonPackage {
pname = "trectools";
version = "0.0.50";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "joaopalotti";
repo = "trectools";
# https://github.com/joaopalotti/trectools/issues/41
rev = "8a896def007e3d657eb29f820ee3de98e2f32691";
hash = "sha256-p8BvLO+rD/l+ATE4+u3I6k25R1RVKlk2dn+RLQZTLDs=";
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail "bs4 >= 0.0.0.1" "beautifulsoup4 >= 4.11.1"
'';
build-system = [ setuptools ];
dependencies = [
pandas
numpy
scikit-learn
scipy
lxml
beautifulsoup4
matplotlib
sarge
];
unittestFlagsArray = [
"unittests/"
];
nativeCheckInputs = [
unittestCheckHook
];
pythonImportsCheck = [ "trectools" ];
meta = {
homepage = "https://github.com/joaopalotti/trectools";
description = "Library for assisting Information Retrieval (IR) practitioners with TREC-like campaigns";
license = lib.licenses.bsdOriginal;
maintainers = with lib.maintainers; [ MoritzBoehme ];
};
}