nixpkgs/pkgs/development/python-modules/sqlalchemy-file/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

78 lines
1.9 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
hatchling,
fasteners,
libcloud,
pillow,
pytestCheckHook,
sqlalchemy,
sqlmodel,
}:
buildPythonPackage rec {
pname = "sqlalchemy-file";
version = "0.6.0";
pyproject = true;
src = fetchFromGitHub {
owner = "jowilf";
repo = "sqlalchemy-file";
rev = version;
hash = "sha256-gtW7YA/rQ48tnqPdypMnSqqtwb90nhAkiQNhgEr1M3I=";
};
build-system = [ hatchling ];
dependencies = [
libcloud
sqlalchemy
];
nativeCheckInputs = [
pytestCheckHook
fasteners
pillow
sqlmodel
];
preCheck = ''
# used in get_test_container in tests/utils.py
# fixes FileNotFoundError: [Errno 2] No such file or directory: '/tmp/storage/...'
mkdir .storage
export LOCAL_PATH="$PWD/.storage"
'';
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
# very flaky, sandbox issues?
# libcloud.storage.types.ContainerDoesNotExistError
# sqlite3.OperationalError: attempt to write a readonly database
"tests/test_content_type_validator.py"
"tests/test_image_field.py"
"tests/test_image_validator.py"
"tests/test_metadata.py"
"tests/test_multiple_field.py"
"tests/test_multiple_storage.py"
"tests/test_processor.py"
"tests/test_single_field.py"
"tests/test_size_validator.py"
"tests/test_sqlmodel.py"
];
pythonImportsCheck = [
"sqlalchemy_file"
"sqlalchemy_file.file"
"sqlalchemy_file.types"
"sqlalchemy_file.helpers"
];
meta = with lib; {
description = "SQLAlchemy extension for attaching files to SQLAlchemy model and uploading them to various storage with Apache Libcloud";
homepage = "https://github.com/jowilf/sqlalchemy-file";
changelog = "https://github.com/jowilf/sqlalchemy-file/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ pbsds ];
};
}