python312Packages.{localstack-ext,localstack}: fix build and refactor (#354962)

This commit is contained in:
OTABI Tomoya 2024-11-11 16:43:48 +09:00 committed by GitHub
commit 76e387b030
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 19 deletions

View File

@ -2,13 +2,17 @@
lib,
buildPythonPackage,
fetchPypi,
setuptools,
setuptools-scm,
dill,
dnslib,
dnspython,
plux,
pyaes,
pyotp,
python-jose,
requests,
python-dateutil,
tabulate,
# Sensitive downstream dependencies
@ -18,7 +22,7 @@
buildPythonPackage rec {
pname = "localstack-ext";
version = "3.7.2";
format = "setuptools";
pyproject = true;
src = fetchPypi {
pname = "localstack_ext";
@ -26,32 +30,31 @@ buildPythonPackage rec {
hash = "sha256-gd+HyZnezgtKrSKJOYtxUZHTPMrrpKWQHGvaIs9FyVs=";
};
postPatch = ''
build-system = [
setuptools
setuptools-scm
];
pythonRemoveDeps = [
# Avoid circular dependency
sed -i '/localstack>=/d' setup.cfg
"localstack"
"build"
];
# Pip is unable to resolve attr logic, so it will emit version as 0.0.0
substituteInPlace setup.cfg \
--replace "version = attr: localstack_ext.__version__" "version = ${version}"
cat setup.cfg
substituteInPlace setup.cfg \
--replace "dill==0.3.2" "dill~=0.3.0" \
--replace "requests>=2.20.0,<2.26" "requests~=2.20"
'';
propagatedBuildInputs = [
dependencies = [
dill
dnslib
dnspython
plux
pyaes
pyotp
python-jose
requests
tabulate
];
python-dateutil
] ++ python-jose.optional-dependencies.cryptography;
pythonImportsCheck = [ "localstack_ext" ];
pythonImportsCheck = [ "localstack" ];
# No tests in repo
doCheck = false;
@ -60,10 +63,10 @@ buildPythonPackage rec {
inherit localstack;
};
meta = with lib; {
meta = {
description = "Extensions for LocalStack";
homepage = "https://github.com/localstack/localstack";
license = licenses.asl20;
license = lib.licenses.asl20;
maintainers = [ ];
};
}

View File

@ -19,6 +19,7 @@
rich,
semver,
setuptools,
setuptools-scm,
tailer,
}:
@ -34,7 +35,10 @@ buildPythonPackage rec {
hash = "sha256-8xdP/qpmfqmXDt1gNhzkAGlBR6dJYznKr9+/Un6N7mA=";
};
build-system = [ setuptools ];
build-system = [
setuptools
setuptools-scm
];
dependencies = [
apispec