3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/django-compat/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

43 lines
1.1 KiB
Nix

{ lib, stdenv, buildPythonPackage, fetchFromGitHub, python,
django, six
}:
buildPythonPackage rec {
pname = "django-compat";
version = "1.0.15";
# the pypi packages don't include everything required for the tests
src = fetchFromGitHub {
owner = "arteria";
repo = "django-compat";
rev = "v${version}";
sha256 = "1pr6v38ahrsvxlgmcx69s4b5q5082f44gzi4h3c32sccdc4pwqxp";
};
patches = [
./fix-tests.diff
];
checkPhase = ''
runHook preCheck
# to convince the tests to run against the installed package, not the source directory, we extract the
# tests directory from it then dispose of the actual source
mv compat/tests .
rm -r compat
substituteInPlace runtests.py --replace compat.tests tests
${python.interpreter} runtests.py
runHook postCheck
'';
propagatedBuildInputs = [ django six ];
meta = with lib; {
description = "Forward and backwards compatibility layer for Django 1.4, 1.7, 1.8, 1.9, 1.10 and 1.11";
homepage = "https://github.com/arteria/django-compat";
license = licenses.mit;
maintainers = with maintainers; [ ris ];
};
}