mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +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" ```
92 lines
1.7 KiB
Nix
92 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
arrow,
|
|
blessed,
|
|
buildPythonPackage,
|
|
croniter,
|
|
django,
|
|
django-picklefield,
|
|
django-redis,
|
|
fetchFromGitHub,
|
|
future,
|
|
pkgs,
|
|
poetry-core,
|
|
pytest-django,
|
|
pytest-mock,
|
|
pytestCheckHook,
|
|
pythonOlder,
|
|
redis,
|
|
setuptools,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "django-q";
|
|
version = "1.3.9";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Koed00";
|
|
repo = "django-q";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-gFSrAl3QGoJEJfvTTvLQgViPPjeJ6BfvgEwgLLo+uAA=";
|
|
};
|
|
|
|
# fixes empty version string
|
|
# analog to https://github.com/NixOS/nixpkgs/pull/171200
|
|
patches = [ ./pep-621.patch ];
|
|
|
|
nativeBuildInputs = [
|
|
poetry-core
|
|
setuptools
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
django-picklefield
|
|
arrow
|
|
blessed
|
|
django
|
|
future
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
croniter
|
|
django-redis
|
|
pytest-django
|
|
pytest-mock
|
|
pytestCheckHook
|
|
] ++ django-redis.optional-dependencies.hiredis;
|
|
|
|
pythonImportsCheck = [ "django_q" ];
|
|
|
|
preCheck = ''
|
|
${pkgs.redis}/bin/redis-server &
|
|
REDIS_PID=$!
|
|
'';
|
|
|
|
postCheck = ''
|
|
kill $REDIS_PID
|
|
'';
|
|
|
|
# don't bother with two more servers to test
|
|
disabledTests = [
|
|
"test_disque"
|
|
"test_mongo"
|
|
];
|
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
|
|
|
meta = with lib; {
|
|
description = "Multiprocessing distributed task queue for Django";
|
|
homepage = "https://django-q.readthedocs.org";
|
|
changelog = "https://github.com/Koed00/django-q/releases/tag/v${version}";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ gador ];
|
|
# django-q is unmaintained at the moment
|
|
# https://github.com/Koed00/django-q/issues/733
|
|
broken = lib.versionAtLeast redis.version "5";
|
|
};
|
|
}
|