python313Packages.streaming-form-data: 1.13.0 -> 1.19.1 (#415656)

This commit is contained in:
Sandro
2025-12-21 20:49:04 +00:00
committed by GitHub
2 changed files with 38 additions and 33 deletions
@@ -2,23 +2,22 @@
lib,
fetchFromGitHub,
buildPythonPackage,
pythonOlder,
cython,
setuptools,
pytestCheckHook,
requests-toolbelt,
}:
buildPythonPackage rec {
pname = "streaming-form-data";
version = "1.13.0";
format = "setuptools";
disabled = pythonOlder "3.6";
version = "1.19.1";
pyproject = true;
src = fetchFromGitHub {
owner = "siddhantgoel";
repo = "streaming-form-data";
rev = "v${version}";
hash = "sha256-Ntiad5GZtfRd+2uDPgbDzLBzErGFroffK6ZAmMcsfXA=";
tag = "v${version}";
hash = "sha256-3tK7dX5p1uH/azmFxzELM1bflGI/SHoLvsw+Ta+7rC4=";
};
# streaming-form-data has a small bit of code that uses smart_open, which has a massive closure.
@@ -26,13 +25,10 @@ buildPythonPackage rec {
# So, just drop the dependency to not have to deal with it.
patches = [ ./drop-smart-open.patch ];
# The repo has a vendored copy of the cython output, which doesn't build on 3.13,
# so regenerate it with our cython, which does.
preBuild = ''
cython streaming_form_data/_parser.pyx
'';
nativeBuildInputs = [ cython ];
build-system = [
cython
setuptools
];
nativeCheckInputs = [
pytestCheckHook
@@ -43,14 +39,10 @@ buildPythonPackage rec {
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 = {
description = "Streaming parser for multipart/form-data";
homepage = "https://github.com/siddhantgoel/streaming-form-data";
changelog = "https://github.com/siddhantgoel/streaming-form-data/blob/${src.tag}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ zhaofengli ];
};
@@ -1,36 +1,49 @@
diff --git a/streaming_form_data/targets.py b/streaming_form_data/targets.py
index a399f3a..b816714 100644
--- a/streaming_form_data/targets.py
+++ b/streaming_form_data/targets.py
@@ -1,6 +1,5 @@
import hashlib
diff --git a/pyproject.toml b/pyproject.toml
index 43b7231..51c5e9c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -27,7 +27,6 @@ classifiers = [
]
keywords = ["cython", "form-data", "forms", "http", "multipart", "streaming", "web"]
dependencies = [
- "smart-open>=7.0.5",
]
[project.urls]
diff --git a/src/streaming_form_data/targets.py b/src/streaming_form_data/targets.py
index fc31f67..219c183 100644
--- a/src/streaming_form_data/targets.py
+++ b/src/streaming_form_data/targets.py
@@ -2,7 +2,6 @@ import hashlib
from pathlib import Path
from typing import Callable, List, Optional, Union
-import smart_open # type: ignore
from typing import Callable, List, Optional
@@ -164,6 +163,7 @@ class S3Target(BaseTarget):
S3Target enables chunked uploads to S3 buckets (using smart_open)"""
def __init__(self, file_path, mode, transport_params=None, **kwargs):
class BaseTarget:
@@ -313,6 +312,7 @@ class SmartOpenTarget(BaseTarget):
mode:
The mode in which the file should be opened
"""
+ raise Exception("Nixpkgs: disabled")
super().__init__(**kwargs)
self._file_path = file_path
diff --git a/tests/test_targets.py b/tests/test_targets.py
index 0cc79ab..78ab40b 100644
index 4aa6b57..d768e2f 100644
--- a/tests/test_targets.py
+++ b/tests/test_targets.py
@@ -2,8 +2,6 @@ import os.path
import tempfile
import pytest
-from moto import mock_s3
-from moto import mock_aws
-import boto3
from streaming_form_data.targets import (
BaseTarget,
@@ -271,6 +269,7 @@ def mock_client():
@@ -305,6 +303,7 @@ def mock_client():
yield client