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

75 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchpatch,
fetchFromGitHub,
buildPythonApplication,
click,
pydantic,
toml,
watchdog,
pytestCheckHook,
pytest-cov-stub,
rsync,
}:
buildPythonApplication rec {
pname = "remote-exec";
version = "1.13.3";
format = "setuptools";
src = fetchFromGitHub {
owner = "remote-cli";
repo = "remote";
tag = "v${version}";
hash = "sha256-rsboHJLOHXnpXtsVsvsfKsav8mSbloaq2lzZnU2pw6c=";
};
patches = [
# relax install requirements
# https://github.com/remote-cli/remote/pull/60.patch
(fetchpatch {
url = "https://github.com/remote-cli/remote/commit/a2073c30c7f576ad7ceb46e39f996de8d06bf186.patch";
hash = "sha256-As0j+yY6LamhOCGFzvjUQoXFv46BN/tRBpvIS7r6DaI=";
})
];
# remove legacy endpoints, we use --multi now
postPatch = ''
substituteInPlace setup.py \
--replace-fail '"mremote' '#"mremote'
'';
dependencies = [
click
pydantic
toml
watchdog
];
doCheck = true;
nativeCheckInputs = [
rsync
];
checkInputs = [
pytestCheckHook
pytest-cov-stub
];
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
# `watchdog` dependency does not correctly detect fsevents on darwin.
# this only affects `remote --stream-changes`
"test/test_file_changes.py"
];
meta = with lib; {
description = "Work with remote hosts seamlessly via rsync and ssh";
homepage = "https://github.com/remote-cli/remote";
changelog = "https://github.com/remote-cli/remote/releases/tag/v${version}";
license = licenses.bsd2;
maintainers = with maintainers; [ pbsds ];
};
}