Files
Brian McGillion 3d3bbb85bf python3Packages.gcp-storage-emulator: fix version in package metadata
setup.py only picks up the real version from GITHUB_REF when upstream CI
builds a tag, so the wheel recorded 0.0.0.dev0 and pythonMetadataCheckPhase
rejected it. pyprojectVersionPatchHook cannot help here the pyproject.toml has
no [project] or [tool.poetry] section.

Needs #562745 to build.

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
2026-09-13 06:39:35 +04:00

64 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
fs,
google-cloud-storage,
google-crc32c,
pytestCheckHook,
pytest-cov-stub,
requests,
}:
buildPythonPackage rec {
pname = "gcp-storage-emulator";
version = "2024.08.03";
pyproject = true;
src = fetchFromGitHub {
owner = "oittaa";
repo = "gcp-storage-emulator";
tag = "v${version}";
hash = "sha256-Lp9Wvod0wSE2+cnvLXguhagT30ax9TivyR8gC/kB7w0=";
};
# upstream only sets the real version from GITHUB_REF when its CI builds a tag
postPatch = ''
substituteInPlace setup.py \
--replace-fail '"0.0.0.dev0"' '"${version}"'
'';
build-system = [
setuptools
];
dependencies = [
fs
google-crc32c
];
nativeCheckInputs = [
google-cloud-storage
pytest-cov-stub
pytestCheckHook
requests
];
disabledTests = [
"test_invalid_crc32c_hash" # AssertionError
];
pythonImportsCheck = [
"gcp_storage_emulator"
];
meta = {
description = "Local emulator for Google Cloud Storage";
homepage = "https://github.com/oittaa/gcp-storage-emulator";
license = lib.licenses.bsd3;
maintainers = [ ];
mainProgram = "gcp-storage-emulator";
};
}