Files
nixpkgs/pkgs/development/python-modules/streaming-form-data/default.nix
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00

52 lines
1.3 KiB
Nix

{
lib,
fetchFromGitHub,
buildPythonPackage,
pythonOlder,
cython,
pytestCheckHook,
requests-toolbelt,
}:
buildPythonPackage rec {
pname = "streaming-form-data";
version = "1.13.0";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "siddhantgoel";
repo = "streaming-form-data";
rev = "v${version}";
hash = "sha256-Ntiad5GZtfRd+2uDPgbDzLBzErGFroffK6ZAmMcsfXA=";
};
# streaming-form-data has a small bit of code that uses smart_open, which has a massive closure.
# The only consumer of streaming-form-data is Moonraker, which doesn't use that code.
# So, just drop the dependency to not have to deal with it.
patches = [ ./drop-smart-open.patch ];
nativeBuildInputs = [ cython ];
nativeCheckInputs = [
pytestCheckHook
requests-toolbelt
];
pytestFlagsArray = [ "tests" ];
pythonImportsCheck = [ "streaming_form_data" ];
preCheck = ''
# remove in-tree copy to make pytest find the installed one, with the native parts already built
rm -rf streaming_form_data
'';
meta = with lib; {
description = "Streaming parser for multipart/form-data";
homepage = "https://github.com/siddhantgoel/streaming-form-data";
license = licenses.mit;
maintainers = with maintainers; [ zhaofengli ];
};
}