mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 12:53:05 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
47 lines
996 B
Nix
47 lines
996 B
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildPythonPackage,
|
|
fetchFromSourcehut,
|
|
pytestCheckHook,
|
|
pythonOlder,
|
|
sqlparse,
|
|
wrapt,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "embrace";
|
|
version = "4.2.1";
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromSourcehut {
|
|
vc = "hg";
|
|
owner = "~olly";
|
|
repo = "embrace-sql";
|
|
rev = "v${version}-release";
|
|
hash = "sha256-B/xW5EfaQWW603fjKYcf+RHQJVZrnFoqVnIl6xSwS0E=";
|
|
};
|
|
|
|
propagatedBuildInputs = [
|
|
sqlparse
|
|
wrapt
|
|
];
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
pythonImportsCheck = [ "embrace" ];
|
|
|
|
# Some test for hot-reload fails on Darwin, but the rest of the library
|
|
# should remain usable. (https://todo.sr.ht/~olly/embrace-sql/4)
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
|
|
|
meta = with lib; {
|
|
description = "Embrace SQL keeps your SQL queries in SQL files";
|
|
homepage = "https://pypi.org/project/embrace/";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ pacien ];
|
|
};
|
|
}
|